vue2-client 1.8.39 → 1.8.41
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/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/src/App.vue
CHANGED
|
@@ -10,7 +10,7 @@ import { mapState, mapMutations } from 'vuex'
|
|
|
10
10
|
import themeUtil from '@vue2-client/utils/themeUtil'
|
|
11
11
|
import { getI18nKey } from '@vue2-client/utils/routerUtil'
|
|
12
12
|
import { setSystemVersion } from '@vue2-client/utils/request'
|
|
13
|
-
import
|
|
13
|
+
import waterMark from '@vue2-client/utils/waterMark'
|
|
14
14
|
|
|
15
15
|
export default {
|
|
16
16
|
name: 'App',
|
|
@@ -31,7 +31,7 @@ export default {
|
|
|
31
31
|
const config = JSON.parse(configStr)
|
|
32
32
|
if (config.$globalProp.environment === 'dev') {
|
|
33
33
|
// 设置水印
|
|
34
|
-
|
|
34
|
+
waterMark('开发环境')
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
// 设置系统版本
|
|
@@ -104,14 +104,13 @@ export default {
|
|
|
104
104
|
getDataParams: {},
|
|
105
105
|
// 是否为临时表
|
|
106
106
|
isTableTemp: false,
|
|
107
|
+
// 是否处理表单key
|
|
108
|
+
isKeyHandle: true,
|
|
107
109
|
// 动态简易表单集合
|
|
108
110
|
simpleFormJsonData: {}
|
|
109
111
|
}
|
|
110
112
|
},
|
|
111
113
|
computed: {
|
|
112
|
-
businessTitle () {
|
|
113
|
-
return this.businessType + this.title
|
|
114
|
-
},
|
|
115
114
|
// 过滤出用于新增/修改场景的表单项
|
|
116
115
|
realJsonData: function () {
|
|
117
116
|
return this.formItems.filter((item) => {
|
|
@@ -151,7 +150,7 @@ export default {
|
|
|
151
150
|
methods: {
|
|
152
151
|
init (params) {
|
|
153
152
|
const {
|
|
154
|
-
configName, configContent, formItems, viewMode, isHandleFormKey = true, showSubmitBtn = true, serviceName, isTableTemp = false, modifyModelData = {}, businessType, title, fixedAddForm = {}, getDataParams = {}, simpleFormJsonData = {}
|
|
153
|
+
configName, configContent, formItems, viewMode, isHandleFormKey = true, showSubmitBtn = true, serviceName, isTableTemp = false, isKeyHandle = true, modifyModelData = {}, businessType, title, fixedAddForm = {}, getDataParams = {}, simpleFormJsonData = {}
|
|
155
154
|
} = params
|
|
156
155
|
this.loaded = false
|
|
157
156
|
this.configName = configName
|
|
@@ -170,6 +169,7 @@ export default {
|
|
|
170
169
|
this.getDataParams = getDataParams
|
|
171
170
|
this.simpleFormJsonData = simpleFormJsonData
|
|
172
171
|
this.isTableTemp = isTableTemp
|
|
172
|
+
this.isKeyHandle = isKeyHandle
|
|
173
173
|
// 设置普通表单项的相关参数
|
|
174
174
|
const formData = Object.assign({}, fixedAddForm)
|
|
175
175
|
for (let i = 0; i < this.realJsonData.length; i++) {
|
|
@@ -340,7 +340,7 @@ export default {
|
|
|
340
340
|
}
|
|
341
341
|
realForm[extraFormKey][realKey] = value
|
|
342
342
|
} else {
|
|
343
|
-
const realKey = this.getRealKey(key)
|
|
343
|
+
const realKey = this.isKeyHandle ? this.getRealKey(key) : key
|
|
344
344
|
realForm[realKey] = value
|
|
345
345
|
}
|
|
346
346
|
}
|
|
@@ -402,7 +402,7 @@ export default {
|
|
|
402
402
|
}
|
|
403
403
|
// 对动态简易表单项特殊处理
|
|
404
404
|
for (const key in modifyModelData.data) {
|
|
405
|
-
const realKey = this.getRealKey(key)
|
|
405
|
+
const realKey = this.isKeyHandle ? this.getRealKey(key) : key
|
|
406
406
|
if (this.simpleFormJsonData[realKey]) {
|
|
407
407
|
const extraForm = JSON.parse(modifyModelData.data[key])
|
|
408
408
|
for (const key in extraForm) {
|
package/src/utils/waterMark.js
CHANGED
|
@@ -15,8 +15,8 @@ export default function createWaterMark (waterMarkName) {
|
|
|
15
15
|
if (!waterMarkName) {
|
|
16
16
|
return
|
|
17
17
|
}
|
|
18
|
-
const width = document.body.clientWidth
|
|
19
|
-
const canvasWidth = width / width / 320
|
|
18
|
+
const width = window.parseInt(document.body.clientWidth)
|
|
19
|
+
const canvasWidth = width / window.parseInt(width / 320)
|
|
20
20
|
const fontFamily = window.getComputedStyle(document.body)['font-family']
|
|
21
21
|
const fragment = document.createDocumentFragment()
|
|
22
22
|
waterMarkDOM = document.createElement('div')
|