@zscreate/form-component 1.0.21 → 1.0.22
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.
|
@@ -3709,7 +3709,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core
|
|
|
3709
3709
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
3710
3710
|
|
|
3711
3711
|
"use strict";
|
|
3712
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _common_CorrectionModal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/CorrectionModal */ \"./src/form/modules/common/CorrectionModal.vue\");\n/* harmony import */ var _components_index__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/index */ \"./src/form/modules/components/index.js\");\n/* harmony import */ var pubsub_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! pubsub-js */ \"./node_modules/_pubsub-js@1.9.4@pubsub-js/src/pubsub.js\");\n/* harmony import */ var pubsub_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(pubsub_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ \"./node_modules/_lodash@4.17.21@lodash/lodash.js\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__);\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: \"layoutItem\",\n props: {\n showLabel: {\n type: Boolean,\n default: true\n },\n rules: {\n type: Object\n },\n tableKey: {\n type: String,\n default: \"\"\n },\n tableIndex: {\n type: [String, Number],\n default: \"\"\n },\n widget: {\n type: Object,\n default: () => {\n return {};\n }\n },\n models: {\n type: Object,\n default: () => {\n return {};\n }\n }\n },\n inject: {\n isCorrect: {\n // 健名\n from: \"isCorrect\",\n // 来源\n default: false // 默认值\n },\n\n record: {\n from: \"record\",\n default: {}\n }\n },\n data() {\n return {\n dataModel: \"\",\n correctObj: \"\" //纠错信息\n };\n },\n\n components: {\n CorrectionModal: _common_CorrectionModal__WEBPACK_IMPORTED_MODULE_0__[\"default\"],\n ..._components_index__WEBPACK_IMPORTED_MODULE_1__[\"default\"].componentList\n },\n created() {},\n watch: {\n \"widget.options.canView\": {\n handler(val) {\n this.viewDisableHandler(val);\n },\n immediate: true\n },\n \"widget.options.disabled\": {\n handler(val) {\n this.viewDisableHandler(!val);\n },\n immediate: true\n }\n },\n methods: {\n submitCorrectObj(correctObj) {\n this.correctObj = correctObj;\n this.setStatus(correctObj);\n // this.$set(this.widget.options,'oldValue', correctObj.newDataObj)\n let publishKey = this.record.record.appId;\n publishKey && pubsub_js__WEBPACK_IMPORTED_MODULE_2___default().publish(publishKey, {\n msg: correctObj\n });\n },\n setStatus(correctObj) {\n try {\n if (this.widget.options.oldValue === undefined) {\n // 如果当前oldValue为undefined,说明是第一次纠错,需要保存一下oldValue;之后oldValue值不变\n let oldValue = this.tableKey ? this.models[this.tableKey][this.tableIndex][this.widget.model] : this.models[this.widget.model];\n // 获取select radio select 字典信息\n const dictOptions = correctObj.dictOptions;\n const getOldValue = (oldValue, keyName) => {\n return Array.isArray(oldValue) ? oldValue.reduce((i, j) => j[keyName] + \",\" + i, \"\").slice(0, -1) : \"\";\n };\n const getDictValue = oldValue => {\n if (!Array.isArray(oldValue)) {\n const findItem = dictOptions.find(item => item.value === oldValue);\n if (findItem) {\n return findItem.text;\n }\n }\n return oldValue.reduce((i, j) => {\n const findItem = dictOptions.find(item => item.value === j);\n if (findItem) return findItem['text'] + \",\" + i;\n }, \"\").slice(0, -1);\n };\n if (oldValue) {\n switch (this.widget.type) {\n case \"userSelectorByRole\":\n case \"userSelector\":\n oldValue = Array.isArray(oldValue) ? oldValue.reduce((i, j) => i + \" \" + (j.realname || j.username), \"\") : \"\";\n break;\n case 'radio':\n case 'checkbox':\n case \"select\":\n oldValue = getDictValue(oldValue);\n break;\n case \"imgupload\":\n case \"fileupload\":\n oldValue = getOldValue(correctObj['oldValue'], 'name');\n break;\n case \"deptSelector\":\n oldValue = getOldValue(oldValue, 'departName');\n break;\n }\n }\n console.log(oldValue);\n this.$set(this.widget.options, \"oldValue\", oldValue);\n this.getOldValueByWidgetComponenent();\n }\n this.$set(this.widget.options, \"isCorrected\", true);\n this.updateModels(correctObj.newDataObj);\n } catch (err) {\n console.log(err);\n }\n },\n getOldValueByWidgetComponenent() {\n // 通过不同组件设置不同的oldValue\n },\n handlecorrection(widget) {\n this.$refs.CorrectionModal.edit(widget, this.models, this.rules, this.tableKey, this.tableIndex, this.correctObj);\n },\n viewDisableHandler(val) {\n const key = (this.widget.tableKey ? `${this.widget.tableKey}.` : '') + this.widget.model;\n let currRules = lodash__WEBPACK_IMPORTED_MODULE_3___default().cloneDeep(eval(`this.rules.${key}`));\n if (currRules && Array.isArray(currRules)) {\n currRules.forEach(item => {\n if (!item.required) return;\n item.required = val;\n });\n }\n console.log(currRules);\n eval(`this.rules.${key} = currRules`);\n this.$emit(\"update:rules\", this.rules);\n console.log(this.widget.type, \"canView: \", val);\n },\n updateModels(val) {\n if (this.tableKey) {\n this.tableInit(val);\n return false;\n } else {\n let obj = {\n ...this.models,\n [this.widget.model]: val\n };\n this.$emit(\"update:models\", obj);\n }\n },\n tableInit(val) {\n var cloneArr = this.models[this.tableKey];\n if (!(typeof cloneArr[this.tableIndex] == \"object\")) {\n cloneArr[this.tableIndex] = {};\n }\n cloneArr[this.tableIndex][this.widget.model] = val;\n this.$emit(\"update:models\", {\n ...this.models,\n [this.tableKey]: cloneArr\n });\n }\n }\n});\n\n//# sourceURL=webpack://form-component/./src/form/modules/layout/layoutItem.vue?./node_modules/_babel-loader@8.3.0@babel-loader/lib/index.js??clonedRuleSet-40.use%5B0%5D!./node_modules/_vue-loader@15.10.1@vue-loader/lib/index.js??vue-loader-options");
|
|
3712
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _common_CorrectionModal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/CorrectionModal */ \"./src/form/modules/common/CorrectionModal.vue\");\n/* harmony import */ var _components_index__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/index */ \"./src/form/modules/components/index.js\");\n/* harmony import */ var pubsub_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! pubsub-js */ \"./node_modules/_pubsub-js@1.9.4@pubsub-js/src/pubsub.js\");\n/* harmony import */ var pubsub_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(pubsub_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ \"./node_modules/_lodash@4.17.21@lodash/lodash.js\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__);\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: \"layoutItem\",\n props: {\n showLabel: {\n type: Boolean,\n default: true\n },\n rules: {\n type: Object\n },\n tableKey: {\n type: String,\n default: \"\"\n },\n tableIndex: {\n type: [String, Number],\n default: \"\"\n },\n widget: {\n type: Object,\n default: () => {\n return {};\n }\n },\n models: {\n type: Object,\n default: () => {\n return {};\n }\n }\n },\n inject: {\n isCorrect: {\n // 健名\n from: \"isCorrect\",\n // 来源\n default: false // 默认值\n },\n\n record: {\n from: \"record\",\n default: {}\n }\n },\n data() {\n return {\n dataModel: \"\",\n correctObj: \"\" //纠错信息\n };\n },\n\n components: {\n CorrectionModal: _common_CorrectionModal__WEBPACK_IMPORTED_MODULE_0__[\"default\"],\n ..._components_index__WEBPACK_IMPORTED_MODULE_1__[\"default\"].componentList\n },\n created() {},\n watch: {\n \"widget.options.canView\": {\n handler(val) {\n this.viewDisableHandler(val);\n },\n immediate: true\n },\n \"widget.options.disabled\": {\n handler(val) {\n this.viewDisableHandler(!val);\n },\n immediate: true\n }\n },\n methods: {\n submitCorrectObj(correctObj) {\n this.correctObj = correctObj;\n this.setStatus(correctObj);\n // this.$set(this.widget.options,'oldValue', correctObj.newDataObj)\n let publishKey = this.record.record.appId;\n publishKey && pubsub_js__WEBPACK_IMPORTED_MODULE_2___default().publish(publishKey, {\n msg: correctObj\n });\n },\n setStatus(correctObj) {\n try {\n if (this.widget.options.oldValue === undefined) {\n // 如果当前oldValue为undefined,说明是第一次纠错,需要保存一下oldValue;之后oldValue值不变\n let oldValue = this.tableKey ? this.models[this.tableKey][this.tableIndex][this.widget.model] : this.models[this.widget.model];\n if (correctObj.oldValue) oldValue = correctObj.oldValue;\n // 获取select radio select 字典信息\n const dictOptions = correctObj.dictOptions;\n const getOldValue = (oldValue, keyName) => {\n return Array.isArray(oldValue) ? oldValue.reduce((i, j) => j[keyName] + \",\" + i, \"\").slice(0, -1) : \"\";\n };\n const getDictValue = oldValue => {\n if (!Array.isArray(oldValue)) {\n const findItem = dictOptions.find(item => item.value === oldValue);\n if (findItem) {\n return findItem.text;\n }\n }\n return oldValue.reduce((i, j) => {\n const findItem = dictOptions.find(item => item.value === j);\n if (findItem) return findItem['text'] + \",\" + i;\n }, \"\").slice(0, -1);\n };\n if (oldValue) {\n switch (this.widget.type) {\n case \"userSelectorByRole\":\n case \"userSelector\":\n oldValue = Array.isArray(oldValue) ? oldValue.reduce((i, j) => i + \" \" + (j.realname || j.username), \"\") : \"\";\n break;\n case 'time':\n oldValue = Array.isArray(oldValue) ? oldValue.reduce((i, j) => i + \" \" + j, '') : oldValue;\n break;\n case 'radio':\n case 'checkbox':\n case \"select\":\n oldValue = getDictValue(oldValue);\n break;\n case \"imgupload\":\n case \"fileupload\":\n oldValue = getOldValue(correctObj['oldValue'], 'name');\n break;\n case \"deptSelector\":\n oldValue = getOldValue(oldValue, 'departName');\n break;\n }\n }\n console.log(oldValue);\n this.$set(this.widget.options, \"oldValue\", oldValue);\n this.getOldValueByWidgetComponenent();\n }\n this.$set(this.widget.options, \"isCorrected\", true);\n this.updateModels(correctObj.newDataObj);\n } catch (err) {\n console.log(err);\n }\n },\n getOldValueByWidgetComponenent() {\n // 通过不同组件设置不同的oldValue\n },\n handlecorrection(widget) {\n this.$refs.CorrectionModal.edit(widget, this.models, this.rules, this.tableKey, this.tableIndex, this.correctObj);\n },\n viewDisableHandler(val) {\n const key = (this.widget.tableKey ? `${this.widget.tableKey}.` : '') + this.widget.model;\n let currRules = lodash__WEBPACK_IMPORTED_MODULE_3___default().cloneDeep(eval(`this.rules.${key}`));\n if (currRules && Array.isArray(currRules)) {\n currRules.forEach(item => {\n if (!item.required) return;\n item.required = val;\n });\n }\n console.log(currRules);\n eval(`this.rules.${key} = currRules`);\n this.$emit(\"update:rules\", this.rules);\n console.log(this.widget.type, \"canView: \", val);\n },\n updateModels(val) {\n if (this.tableKey) {\n this.tableInit(val);\n return false;\n } else {\n let obj = {\n ...this.models,\n [this.widget.model]: val\n };\n this.$emit(\"update:models\", obj);\n }\n },\n tableInit(val) {\n var cloneArr = this.models[this.tableKey];\n if (!(typeof cloneArr[this.tableIndex] == \"object\")) {\n cloneArr[this.tableIndex] = {};\n }\n cloneArr[this.tableIndex][this.widget.model] = val;\n this.$emit(\"update:models\", {\n ...this.models,\n [this.tableKey]: cloneArr\n });\n }\n }\n});\n\n//# sourceURL=webpack://form-component/./src/form/modules/layout/layoutItem.vue?./node_modules/_babel-loader@8.3.0@babel-loader/lib/index.js??clonedRuleSet-40.use%5B0%5D!./node_modules/_vue-loader@15.10.1@vue-loader/lib/index.js??vue-loader-options");
|
|
3713
3713
|
|
|
3714
3714
|
/***/ }),
|
|
3715
3715
|
|
|
@@ -12325,7 +12325,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE_vue__;
|
|
|
12325
12325
|
/***/ (function(module) {
|
|
12326
12326
|
|
|
12327
12327
|
"use strict";
|
|
12328
|
-
eval("module.exports = JSON.parse('{\"name\":\"@zscreate/form-component\",\"version\":\"1.0.
|
|
12328
|
+
eval("module.exports = JSON.parse('{\"name\":\"@zscreate/form-component\",\"version\":\"1.0.22\",\"private\":false,\"description\":\"\",\"main\":\"dist/form-component.umd.js\",\"unpkg\":\"dist/form-component.umd.js\",\"scripts\":{\"build\":\"vue-cli-service build --target lib --name form-component src/main.js --formats umd --report\",\"build:watch\":\"vue-cli-service build --target lib --name form-component src/main.js --formats umd --watch\"},\"exports\":{\".\":{\"import\":{\"default\":\"./dist/form-component.umd.js\"},\"require\":\"./dist/form-component.common.js\"}},\"publishConfig\":{\"access\":\"public\",\"registry\":\"https://registry.npmjs.org/\"},\"files\":[\"/dist/*\"],\"exclude\":[\"node_modules\"],\"keywords\":[],\"author\":\"\",\"license\":\"ISC\",\"dependencies\":{\"core-js\":\"^3.8.3\",\"vue\":\"^2.6.14\",\"pubsub-js\":\"^1.9.3\",\"vue-draggable-resizable\":\"2.2.0\",\"vue-draggable-resizable-gorkys\":\"2.0.0\",\"vue-grid-layout\":\"^2.3.12\",\"vue-signature-pad\":\"^2.0.2\",\"vuedraggable\":\"^2.24.3\",\"moment\":\"^2.29.1\"},\"devDependencies\":{\"clipboard\":\"2.0.4\",\"codemirror\":\"^5.46.0\",\"vue-codemirror\":\"^4.0.6\",\"@vue/cli-plugin-babel\":\"~5.0.0\",\"@vue/cli-service\":\"~5.0.0\",\"vue-template-compiler\":\"^2.6.14\",\"less\":\"^3.0.4\",\"less-loader\":\"^5.0.0\",\"node-sass\":\"^4.11.0\",\"sass-loader\":\"^7.0.1\"}}');\n\n//# sourceURL=webpack://form-component/./package.json?");
|
|
12329
12329
|
|
|
12330
12330
|
/***/ })
|
|
12331
12331
|
|