agilebuilder-ui 1.1.50-rc1 → 1.1.50-sit2
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/lib/{401-aaa4054d.js → 401-49465ead.js} +1 -1
- package/lib/{404-ef3b10e9.js → 404-e8160cb7.js} +1 -1
- package/lib/{iframe-page-28c30283.js → iframe-page-6bfb095d.js} +1 -1
- package/lib/{index-bece2c1c.js → index-d6261c73.js} +13936 -13859
- package/lib/super-ui.css +1 -1
- package/lib/super-ui.js +1 -1
- package/lib/super-ui.umd.cjs +98 -98
- package/lib/{tab-content-iframe-index-87ac3b2b.js → tab-content-iframe-index-d31749cc.js} +1 -1
- package/lib/{tab-content-index-956a0533.js → tab-content-index-43b5bbb8.js} +1 -1
- package/lib/{tache-subprocess-history-2c4f98f2.js → tache-subprocess-history-7caf5c5a.js} +1 -1
- package/package.json +1 -1
- package/packages/department-tree-inline/src/search-result.vue +2 -1
- package/packages/department-user-tree-inline/src/search-result.vue +2 -1
- package/packages/fs-preview/src/fs-preview.vue +19 -7
- package/packages/fs-upload/src/fs-upload-multi.vue +5 -3
- package/packages/fs-upload/src/fs-upload-single.vue +6 -3
- package/packages/fs-upload-list/src/fs-upload-list.vue +6 -1
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-app.vue +6 -0
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-browser.vue +6 -0
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-component.vue +6 -1
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-input.vue +6 -0
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload.vue +7 -0
- package/packages/fs-upload-new/src/fs-button-upload.vue +5 -0
- package/packages/fs-upload-new/src/fs-drag-upload.vue +5 -0
- package/packages/fs-upload-new/src/fs-preview-new.vue +25 -7
- package/packages/fs-upload-new/src/fs-upload-new.vue +16 -1
- package/packages/multipart-upload/src/multipart-upload-form.vue +6 -3
- package/packages/multipart-upload/src/multipart-upload-list.vue +6 -3
- package/packages/plugins/export-data-new.js +14 -1
- package/packages/super-grid/src/dynamic-input.vue +25 -5
- package/packages/super-grid/src/normal-column-content.vue +1 -0
- package/packages/super-grid/src/row-operation.vue +13 -9
- package/packages/super-grid/src/search-form-item.vue +17 -13
- package/packages/super-grid/src/utils.js +1 -0
- package/packages/super-grid/src/view-image-dialog.vue +6 -3
- package/packages/utils/value-set.js +49 -9
- package/src/utils/auth.js +3 -0
- package/src/utils/common-util.js +20 -5
- package/src/utils/request.js +7 -1
- package/src/utils/watermark-cache.js +13 -0
- package/src/utils/watermark.js +47 -6
- package/src/views/layout/EmptyLayout.vue +9 -1
- package/src/views/layout/Layout.vue +4 -0
- package/src/views/layout/NewLayout.vue +4 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<!--将@click改为@mousedown.native是因为操作列保存按钮时事件和input等组件的@blur冲突,导致保存需要保存两次,因为
|
|
3
3
|
@blur先于@click执行的,所以只会执行@blur,@click就失效了,@mousedown是先于@blur执行的-->
|
|
4
|
-
<span :style="myStyle">
|
|
4
|
+
<span class="table-operation-row-btn" :style="myStyle">
|
|
5
5
|
<template v-if="isShowButton()">
|
|
6
6
|
<el-tooltip :disabled="tooltipDisabled" :content="label" placement="top">
|
|
7
|
-
<template v-if="operationSettingData
|
|
7
|
+
<template v-if="operationSettingData?.permission">
|
|
8
8
|
<component
|
|
9
9
|
v-bind="operationSettingData"
|
|
10
10
|
:is="isElementType"
|
|
@@ -77,9 +77,13 @@ export default {
|
|
|
77
77
|
type: String,
|
|
78
78
|
default: null,
|
|
79
79
|
},
|
|
80
|
+
operation: {
|
|
81
|
+
type: Object,
|
|
82
|
+
default: () => ({}),
|
|
83
|
+
},
|
|
80
84
|
operationSetting: {
|
|
81
85
|
type: Object,
|
|
82
|
-
default:
|
|
86
|
+
default: () => ({}),
|
|
83
87
|
},
|
|
84
88
|
operationIndex: {
|
|
85
89
|
type: Number,
|
|
@@ -148,16 +152,16 @@ export default {
|
|
|
148
152
|
},
|
|
149
153
|
// 后置图标
|
|
150
154
|
suffixIcon() {
|
|
151
|
-
if(['right'].includes(this.
|
|
155
|
+
if(['right'].includes(this.operationSetting.iconPosition)) return this.operationSetting.iconValue
|
|
152
156
|
return undefined
|
|
153
157
|
},
|
|
154
158
|
// 是否显示文字按钮 > 图标模式
|
|
155
159
|
isTextIcon() {
|
|
156
160
|
if (this.isTableBtnLinkShow) {
|
|
157
|
-
if (this.
|
|
161
|
+
if (this.operationSetting.isTextIcon === undefined) {
|
|
158
162
|
return this.isSaveRow || this.isDeleteRow || this.isEditRow || this.isRestoreRow
|
|
159
163
|
}
|
|
160
|
-
return this.
|
|
164
|
+
return this.operationSetting.isTextIcon
|
|
161
165
|
} else {
|
|
162
166
|
return false
|
|
163
167
|
}
|
|
@@ -172,14 +176,14 @@ export default {
|
|
|
172
176
|
},
|
|
173
177
|
// 是否自动开启表格 按钮 转 文字按钮
|
|
174
178
|
isTableBtnLinkShow() {
|
|
175
|
-
if (this.operationSetting
|
|
179
|
+
if (this.operationSetting?.text) return true
|
|
176
180
|
if (this.isTableBtnLink && this.elementType === 'el-button') {
|
|
177
|
-
return [this.operationSetting
|
|
181
|
+
return [this.operationSetting?.text, this.operationSetting?.plain, this.operationSetting?.round].every(v => v === undefined)
|
|
178
182
|
}
|
|
179
183
|
return false
|
|
180
184
|
},
|
|
181
185
|
operationSettingData() {
|
|
182
|
-
const dataList = { ...this.operationSetting }
|
|
186
|
+
const dataList = { ...(this.operationSetting ?? {}) }
|
|
183
187
|
if (this.isTableBtnLinkShow) {
|
|
184
188
|
dataList.underline = false
|
|
185
189
|
delete dataList.text
|
|
@@ -157,7 +157,7 @@
|
|
|
157
157
|
>
|
|
158
158
|
<dynamic-source-select
|
|
159
159
|
v-model:value="searchForm[column.prop]"
|
|
160
|
-
:allow-create="
|
|
160
|
+
:allow-create="dataSourceOptions?.controlConfig?.allowCreate"
|
|
161
161
|
:base-props="{
|
|
162
162
|
multiple: column.componentType === 'multiselect' ? true : false
|
|
163
163
|
}"
|
|
@@ -166,7 +166,7 @@
|
|
|
166
166
|
:is-join-table="isJoinTable"
|
|
167
167
|
:list-code="code"
|
|
168
168
|
:list-toolbar-form-data="listToolbarFormData"
|
|
169
|
-
:options="
|
|
169
|
+
:options="dataSourceOptions"
|
|
170
170
|
:table-name="tableName"
|
|
171
171
|
@change="multiselectChange"
|
|
172
172
|
/>
|
|
@@ -289,7 +289,8 @@ export default {
|
|
|
289
289
|
moduleConfig: {},
|
|
290
290
|
dateVal: this.getFormItemValue(this.column.prop),
|
|
291
291
|
controlConfig: getControlConfig(this.column),
|
|
292
|
-
isShowEmtptyFlag: false
|
|
292
|
+
isShowEmtptyFlag: false,
|
|
293
|
+
dataSourceOptions: {}
|
|
293
294
|
// checkedEmpty: false,
|
|
294
295
|
}
|
|
295
296
|
},
|
|
@@ -323,6 +324,14 @@ export default {
|
|
|
323
324
|
if (this.column.valueSetOptions) {
|
|
324
325
|
this.moduleConfig = JSON.parse(this.column.valueSetOptions)
|
|
325
326
|
}
|
|
327
|
+
const componentType = this.column.componentType
|
|
328
|
+
if (
|
|
329
|
+
componentType &&
|
|
330
|
+
(componentType === 'multiselect' || componentType === 'select') &&
|
|
331
|
+
this.isDynamicDataSourceSource(this.column)
|
|
332
|
+
) {
|
|
333
|
+
this.dataSourceOptions = this.getDynamicDataSourceOptions(this.column)
|
|
334
|
+
}
|
|
326
335
|
console.log('searchitem页面', this.column)
|
|
327
336
|
},
|
|
328
337
|
mounted() {
|
|
@@ -346,12 +355,7 @@ export default {
|
|
|
346
355
|
return isDynamicDataSourceSource(column)
|
|
347
356
|
},
|
|
348
357
|
setValueToModelProp(prop, value, componentName, index) {
|
|
349
|
-
console.log('setValueToModelProp',
|
|
350
|
-
prop,
|
|
351
|
-
value,
|
|
352
|
-
componentName,
|
|
353
|
-
index
|
|
354
|
-
)
|
|
358
|
+
console.log('setValueToModelProp', prop, value, componentName, index)
|
|
355
359
|
if (prop && prop.indexOf('.') > 0) {
|
|
356
360
|
const parentOjbect = this.getParentObject(prop)
|
|
357
361
|
// 嵌套属性中的最后一个属性是属于这个中间父对象的,所有要通过中间父对象来赋值
|
|
@@ -497,10 +501,10 @@ export default {
|
|
|
497
501
|
return ['00:00:00']
|
|
498
502
|
}
|
|
499
503
|
} else {
|
|
500
|
-
const now = new Date()
|
|
501
|
-
const year = now.getFullYear()
|
|
502
|
-
const month = now.getMonth() + 1
|
|
503
|
-
const day = now.getDate()
|
|
504
|
+
const now = new Date()
|
|
505
|
+
const year = now.getFullYear() // e.g., 2023
|
|
506
|
+
const month = now.getMonth() + 1 // Months are 0-indexed, so add 1
|
|
507
|
+
const day = now.getDate() // Day of the month
|
|
504
508
|
return [`${year}-${month}-${day} 00:00:00`, `${year}-${month}-${day} 23:59:59`]
|
|
505
509
|
}
|
|
506
510
|
},
|
|
@@ -51,7 +51,7 @@ import * as Vue from 'vue'
|
|
|
51
51
|
import {
|
|
52
52
|
isPlateSys,
|
|
53
53
|
getSystemFrontendUrl,
|
|
54
|
-
|
|
54
|
+
getKkFilePreviewUrl,
|
|
55
55
|
} from '../../../src/utils/common-util'
|
|
56
56
|
import {getToken} from '../../../src/utils/auth'
|
|
57
57
|
|
|
@@ -155,7 +155,10 @@ export default {
|
|
|
155
155
|
//要预览文件的访问地址
|
|
156
156
|
const myPreviewUrl = originUrl + '&fullfilename='+myShowName
|
|
157
157
|
// http://127.0.0.1:8012/onlinePreview
|
|
158
|
-
|
|
158
|
+
getKkFilePreviewUrl(myPreviewUrl).then(url=>{
|
|
159
|
+
window.open(url, myShowName)
|
|
160
|
+
})
|
|
161
|
+
// previewUrl = window.$vueApp.config.globalProperties.kkFileViewUrl+'?url='+encodeURIComponent(Base64.encode(myPreviewUrl))
|
|
159
162
|
} else {
|
|
160
163
|
previewUrl =
|
|
161
164
|
this.baseUrl +
|
|
@@ -166,8 +169,8 @@ export default {
|
|
|
166
169
|
encodeURI(myShowName) +
|
|
167
170
|
'&serverPath=' +
|
|
168
171
|
uuid
|
|
172
|
+
window.open(previewUrl, myShowName)
|
|
169
173
|
}
|
|
170
|
-
window.open(previewUrl, myShowName)
|
|
171
174
|
}
|
|
172
175
|
},
|
|
173
176
|
deleteFile() {
|
|
@@ -27,7 +27,7 @@ function packageEnumAndBeanColumnValueSetsWhenPlate(columns, listCode) {
|
|
|
27
27
|
let titleValueSet = null
|
|
28
28
|
const titleValueSetJson = column.titleValueSet
|
|
29
29
|
if (titleValueSetJson) {
|
|
30
|
-
titleValueSet =
|
|
30
|
+
titleValueSet = column.titleValueSet
|
|
31
31
|
}
|
|
32
32
|
if (columnValueSet || titleValueSet) {
|
|
33
33
|
const valueSetMeta = {
|
|
@@ -150,11 +150,7 @@ function getDataSourceConfigList(columns) {
|
|
|
150
150
|
const column = columns[i]
|
|
151
151
|
const prop = column.prop ? column.prop : column.label
|
|
152
152
|
const columnValueSet = getConfigWithValueSet(column, prop, column)
|
|
153
|
-
let titleValueSet =
|
|
154
|
-
const titleValueSetJson = column.titleValueSet
|
|
155
|
-
if (titleValueSetJson) {
|
|
156
|
-
titleValueSet = getConfigWithValueSet(JSON.parse(titleValueSetJson), prop)
|
|
157
|
-
}
|
|
153
|
+
let titleValueSet = getConfigWithTitleValueSet(column.titleValueSetOptions, prop)
|
|
158
154
|
if (columnValueSet || titleValueSet) {
|
|
159
155
|
if (columnValueSet) {
|
|
160
156
|
// 字段的值设置
|
|
@@ -178,14 +174,14 @@ function getConfigWithValueSet(valueSetInfo, prop, column) {
|
|
|
178
174
|
* bean形式值设置前缀
|
|
179
175
|
*/
|
|
180
176
|
const BEAN_NAME_PREFIX = 'beanname:'
|
|
181
|
-
const enumName = valueSetInfo.enumName
|
|
182
|
-
const beanName = valueSetInfo.beanName
|
|
177
|
+
const enumName = valueSetInfo?valueSetInfo.enumName:null
|
|
178
|
+
const beanName = valueSetInfo?valueSetInfo.beanName:null
|
|
183
179
|
let infoObj = {
|
|
184
180
|
uuid: prop
|
|
185
181
|
}
|
|
186
182
|
// 选项组的在解析列表字段配置时就获得了,不需要在此处获得了
|
|
187
183
|
if (enumName && enumName !== '') {
|
|
188
|
-
if (valueSetInfo.remoteEnum === true) {
|
|
184
|
+
if (valueSetInfo && valueSetInfo.remoteEnum === true) {
|
|
189
185
|
// 需要远程获得枚举值
|
|
190
186
|
infoObj.type = 'enumName'
|
|
191
187
|
infoObj.props = {
|
|
@@ -233,3 +229,47 @@ function getConfigWithValueSet(valueSetInfo, prop, column) {
|
|
|
233
229
|
}
|
|
234
230
|
return null
|
|
235
231
|
}
|
|
232
|
+
|
|
233
|
+
// 动态列标题列值设置解析
|
|
234
|
+
function getConfigWithTitleValueSet(valueSetOptions, prop) {
|
|
235
|
+
let valueSetOptionsObj
|
|
236
|
+
if(valueSetOptions){
|
|
237
|
+
valueSetOptionsObj = JSON.parse(valueSetOptions)
|
|
238
|
+
}
|
|
239
|
+
let infoObj = {
|
|
240
|
+
uuid: prop
|
|
241
|
+
}
|
|
242
|
+
if (valueSetOptionsObj) {
|
|
243
|
+
// 动态数据源(select开启value-label自动转换或者)、数据表/视图、服务
|
|
244
|
+
const valueSetOptionsObj = JSON.parse(valueSetOptions)
|
|
245
|
+
if (
|
|
246
|
+
valueSetOptionsObj.type || valueSetOptionsObj.dynamicDataSourceCode
|
|
247
|
+
) {
|
|
248
|
+
// 表示是动态数据源等值设置信息
|
|
249
|
+
// const isShouldInitSearch = (valueSetOptionsObj.filterType === undefined || valueSetOptionsObj.filterType != 'remote')
|
|
250
|
+
if (!valueSetOptionsObj.type || valueSetOptionsObj.type !== 'optionGroup') {
|
|
251
|
+
// 选项组时不需要在此处获得
|
|
252
|
+
Object.assign(infoObj, valueSetOptionsObj)
|
|
253
|
+
// 更新uuid为字段名
|
|
254
|
+
infoObj.uuid = prop
|
|
255
|
+
if (!infoObj.props) {
|
|
256
|
+
infoObj.props = {}
|
|
257
|
+
}
|
|
258
|
+
infoObj.props.prop = prop
|
|
259
|
+
}
|
|
260
|
+
if (valueSetOptionsObj.dynamicDataSourceCode) {
|
|
261
|
+
infoObj.type = 'dynamicData'
|
|
262
|
+
if (!infoObj.props) {
|
|
263
|
+
infoObj.props = {}
|
|
264
|
+
}
|
|
265
|
+
infoObj.props.code = valueSetOptionsObj.dynamicDataSourceCode
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
if (infoObj.type) {
|
|
270
|
+
// 表示是有效的值设置
|
|
271
|
+
return infoObj
|
|
272
|
+
}
|
|
273
|
+
return null
|
|
274
|
+
}
|
|
275
|
+
|
package/src/utils/auth.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import authApi from './auth-api'
|
|
2
2
|
import { removeAllSystemPermissions } from './permissionAuth'
|
|
3
3
|
import { removeGlobalPropCache } from './global-prop'
|
|
4
|
+
import { removeWatermark} from './watermark-cache'
|
|
4
5
|
|
|
5
6
|
export function getToken() {
|
|
6
7
|
return authApi.getToken()
|
|
@@ -168,4 +169,6 @@ export function clearPermission() {
|
|
|
168
169
|
|
|
169
170
|
// 清除系统参数设置的全局属性缓存
|
|
170
171
|
removeGlobalPropCache()
|
|
172
|
+
// 清除水印配置
|
|
173
|
+
removeWatermark()
|
|
171
174
|
}
|
package/src/utils/common-util.js
CHANGED
|
@@ -3,6 +3,8 @@ import { getToken, getLanguage, getAllLanguages, setAllLanguages } from './auth'
|
|
|
3
3
|
import { v4 as uuidv4 } from 'uuid'
|
|
4
4
|
import { getCookieCache } from './auth'
|
|
5
5
|
import i18nUtil from './i18n-util'
|
|
6
|
+
import { Base64 } from 'js-base64'
|
|
7
|
+
import { getWatermarkSetting } from './watermark'
|
|
6
8
|
|
|
7
9
|
/**
|
|
8
10
|
* 获得相对地址
|
|
@@ -818,11 +820,24 @@ export function getURLSearchParamObj(fullPath) {
|
|
|
818
820
|
console.error('error===',error)
|
|
819
821
|
}
|
|
820
822
|
}
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
823
|
+
|
|
824
|
+
// 获得KKFileView预览url,处理水印
|
|
825
|
+
export function getKkFilePreviewUrl(previewUrl) {
|
|
826
|
+
let myPreviewUrl = getKkFileBackendUrl()+'?url='+encodeURIComponent(Base64.encode(previewUrl))
|
|
827
|
+
return new Promise((resolve,reject)=>{
|
|
828
|
+
getWatermarkSetting().then((watermark)=>{
|
|
829
|
+
if(watermark){
|
|
830
|
+
myPreviewUrl = myPreviewUrl + '&watermarkTxt='+watermark.content+'&watermarkXSpace=60&watermarkYSpace=100&watermarkWidth=500&watermarkHeight=100'
|
|
831
|
+
}
|
|
832
|
+
resolve(myPreviewUrl)
|
|
833
|
+
}).catch((error)=>{
|
|
834
|
+
console.error('获得水印失败',error)
|
|
835
|
+
resolve(myPreviewUrl)
|
|
836
|
+
})
|
|
837
|
+
})
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
function getKkFileBackendUrl() {
|
|
826
841
|
let kkFileViewUrl = window.$vueApp.config.globalProperties.kkFileViewUrl
|
|
827
842
|
let kkFileViewUrlResult = kkFileViewUrl
|
|
828
843
|
let baseURL = window.$vueApp.config.globalProperties.baseURL
|
package/src/utils/request.js
CHANGED
|
@@ -80,7 +80,13 @@ service.interceptors.response.use(
|
|
|
80
80
|
}
|
|
81
81
|
} else if (error.response.status === 403) {
|
|
82
82
|
// ForbiddenException(403) 403没权限
|
|
83
|
-
|
|
83
|
+
let message = ''
|
|
84
|
+
if (error.response.data?.message) {
|
|
85
|
+
message = error.response.data.message
|
|
86
|
+
console.error('ForbiddenException(403):', error.response.data)
|
|
87
|
+
} else {
|
|
88
|
+
message = getI18n().t('imatrixUIMessage.forbiddenException')
|
|
89
|
+
}
|
|
84
90
|
const serverConfig = window['$vueApp'].config.globalProperties
|
|
85
91
|
let vnode
|
|
86
92
|
if (serverConfig.forbiddenUser || serverConfig.forbiddenLinkUrl) {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const watermarkSetting = 'AMB_WATERMARK_SETTING'
|
|
2
|
+
|
|
3
|
+
export function getWatermark() {
|
|
4
|
+
return localStorage.getItem(watermarkSetting)
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function cacheWatermark(value) {
|
|
8
|
+
localStorage.setItem(watermarkSetting, value)
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function removeWatermark() {
|
|
12
|
+
localStorage.removeItem(watermarkSetting)
|
|
13
|
+
}
|
package/src/utils/watermark.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
// import ssoService from '../api/sso-service'
|
|
1
|
+
import {getWatermark, cacheWatermark, removeWatermark} from './watermark-cache'
|
|
3
2
|
const watermark = {}
|
|
4
3
|
|
|
5
4
|
const setWatermark = (str, parma, paramId) => {
|
|
@@ -35,12 +34,12 @@ const setWatermark = (str, parma, paramId) => {
|
|
|
35
34
|
const div = document.createElement('div')
|
|
36
35
|
div.id = id
|
|
37
36
|
div.style.pointerEvents = 'none'
|
|
38
|
-
div.style.top = '80px
|
|
39
|
-
div.style.left = '200px
|
|
37
|
+
div.style.top = '10px' // 80px
|
|
38
|
+
div.style.left = '0px' // 200px
|
|
40
39
|
div.style.position = 'fixed'
|
|
41
40
|
div.style.zIndex = '10000'
|
|
42
|
-
div.style.width = '70%
|
|
43
|
-
div.style.height = '80%
|
|
41
|
+
div.style.width = '100%' // 70%
|
|
42
|
+
div.style.height = '100%' // 80%
|
|
44
43
|
div.style.background =
|
|
45
44
|
'url(' + can.toDataURL('image/png') + ') left top repeat'
|
|
46
45
|
|
|
@@ -71,6 +70,48 @@ export function showWatermark(label, parma, user, paramId) {
|
|
|
71
70
|
}
|
|
72
71
|
})
|
|
73
72
|
}
|
|
73
|
+
|
|
74
|
+
// 获得水印维护信息
|
|
75
|
+
export function getWatermarkSetting(){
|
|
76
|
+
return new Promise((resolve,reject)=>{
|
|
77
|
+
let watermark = getWatermark()
|
|
78
|
+
if(!watermark || watermark === 'EMPTY_VALUE'){
|
|
79
|
+
window.$vueApp.config.globalProperties.$http.get(window.$vueApp.config.globalProperties.baseAPI + '/component/watermark').then((data)=>{
|
|
80
|
+
if(data){
|
|
81
|
+
watermark = data
|
|
82
|
+
cacheWatermark(JSON.stringify(watermark))
|
|
83
|
+
// 兼容之前的代码
|
|
84
|
+
watermark.font = watermark.fontStyle
|
|
85
|
+
watermark.color = watermark.fontColor
|
|
86
|
+
resolve(watermark)
|
|
87
|
+
} else {
|
|
88
|
+
cacheWatermark('EMPTY_VALUE')
|
|
89
|
+
resolve()
|
|
90
|
+
}
|
|
91
|
+
})
|
|
92
|
+
} else {
|
|
93
|
+
try{
|
|
94
|
+
watermark = JSON.parse(watermark)
|
|
95
|
+
// 兼容之前的代码
|
|
96
|
+
watermark.font = watermark.fontStyle
|
|
97
|
+
watermark.color = watermark.fontColor
|
|
98
|
+
resolve(watermark)
|
|
99
|
+
}catch(error){
|
|
100
|
+
console.error('watermark content error.',error)
|
|
101
|
+
resolve()
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
})
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// 该方法只允许调用一次
|
|
108
|
+
export function showWatermarkNew() {
|
|
109
|
+
getWatermarkSetting().then((watermark)=>{
|
|
110
|
+
if(watermark){
|
|
111
|
+
setWatermark(watermark.content, watermark)
|
|
112
|
+
}
|
|
113
|
+
})
|
|
114
|
+
}
|
|
74
115
|
// watermark.set = (label, parma) => {
|
|
75
116
|
|
|
76
117
|
// }
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
import { Sidebar, AppMain, Breadcrumb } from './components'
|
|
18
18
|
import ResizeMixin from './mixin/ResizeHandler'
|
|
19
19
|
import { isShowMenuRoute } from '../../../src/utils/common-util'
|
|
20
|
+
import {showWatermarkNew} from '../../utils/watermark'
|
|
20
21
|
|
|
21
22
|
export default {
|
|
22
23
|
name: 'Layout',
|
|
@@ -49,6 +50,9 @@ export default {
|
|
|
49
50
|
}
|
|
50
51
|
},
|
|
51
52
|
},
|
|
53
|
+
mounted(){
|
|
54
|
+
showWatermarkNew()
|
|
55
|
+
},
|
|
52
56
|
methods: {
|
|
53
57
|
handleClickOutside() {
|
|
54
58
|
this.$store.dispatch('closeSidebar', { withoutAnimation: false })
|
|
@@ -9,10 +9,14 @@
|
|
|
9
9
|
|
|
10
10
|
<script>
|
|
11
11
|
import { AppMain } from './components'
|
|
12
|
+
import {showWatermarkNew} from '../../utils/watermark'
|
|
12
13
|
export default {
|
|
13
14
|
name: 'NewLayout',
|
|
14
15
|
components: {
|
|
15
16
|
AppMain,
|
|
16
17
|
},
|
|
18
|
+
mounted(){
|
|
19
|
+
showWatermarkNew()
|
|
20
|
+
}
|
|
17
21
|
}
|
|
18
22
|
</script>
|