vue2-client 1.8.425 → 1.8.426
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/package.json +1 -1
- package/src/base-client/components/common/XFormGroup/demo.vue +40 -40
- package/src/base-client/components/common/XReport/index.js +3 -3
- package/src/base-client/components/common/XTab/XTab.vue +4 -1
- package/src/pages/DynamicStatistics/FavoriteList.vue +51 -51
- package/src/services/api/entity.js +18 -18
- package/src/utils/waterMark.js +31 -31
package/package.json
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import XFormGroup from '@vue2-client/base-client/components/common/XFormGroup/XFormGroup.vue'
|
|
3
|
-
import { getConfigByNameAsync } from '@vue2-client/services/api/common'
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
name: 'Demo',
|
|
7
|
-
components: { XFormGroup },
|
|
8
|
-
created () {
|
|
9
|
-
getConfigByNameAsync('addUserGeneralInfoFrom', 'af-revenue').then(res => {
|
|
10
|
-
this.$refs.xFormGroupDemo.init({
|
|
11
|
-
...res,
|
|
12
|
-
serviceName: 'af-revenue',
|
|
13
|
-
showLeftTab: true,
|
|
14
|
-
})
|
|
15
|
-
})
|
|
16
|
-
},
|
|
17
|
-
methods: {
|
|
18
|
-
submitForm () {
|
|
19
|
-
this.$refs.xFormGroupDemo.onSubmit().then(res => {
|
|
20
|
-
console.log('所有表单的结果', res)
|
|
21
|
-
})
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
</script>
|
|
26
|
-
|
|
27
|
-
<template>
|
|
28
|
-
<a-modal
|
|
29
|
-
:visible="true"
|
|
30
|
-
:bodyStyle="{height:'70vh'}"
|
|
31
|
-
title="测试表单组"
|
|
32
|
-
@ok="submitForm"
|
|
33
|
-
width="85vw">
|
|
34
|
-
<x-form-group ref="xFormGroupDemo"></x-form-group>
|
|
35
|
-
</a-modal>
|
|
36
|
-
</template>
|
|
37
|
-
|
|
38
|
-
<style scoped lang="less">
|
|
39
|
-
|
|
40
|
-
</style>
|
|
1
|
+
<script>
|
|
2
|
+
import XFormGroup from '@vue2-client/base-client/components/common/XFormGroup/XFormGroup.vue'
|
|
3
|
+
import { getConfigByNameAsync } from '@vue2-client/services/api/common'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
name: 'Demo',
|
|
7
|
+
components: { XFormGroup },
|
|
8
|
+
created () {
|
|
9
|
+
getConfigByNameAsync('addUserGeneralInfoFrom', 'af-revenue').then(res => {
|
|
10
|
+
this.$refs.xFormGroupDemo.init({
|
|
11
|
+
...res,
|
|
12
|
+
serviceName: 'af-revenue',
|
|
13
|
+
showLeftTab: true,
|
|
14
|
+
})
|
|
15
|
+
})
|
|
16
|
+
},
|
|
17
|
+
methods: {
|
|
18
|
+
submitForm () {
|
|
19
|
+
this.$refs.xFormGroupDemo.onSubmit().then(res => {
|
|
20
|
+
console.log('所有表单的结果', res)
|
|
21
|
+
})
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<template>
|
|
28
|
+
<a-modal
|
|
29
|
+
:visible="true"
|
|
30
|
+
:bodyStyle="{height:'70vh'}"
|
|
31
|
+
title="测试表单组"
|
|
32
|
+
@ok="submitForm"
|
|
33
|
+
width="85vw">
|
|
34
|
+
<x-form-group ref="xFormGroupDemo"></x-form-group>
|
|
35
|
+
</a-modal>
|
|
36
|
+
</template>
|
|
37
|
+
|
|
38
|
+
<style scoped lang="less">
|
|
39
|
+
|
|
40
|
+
</style>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import XReport from './XReport'
|
|
2
|
-
|
|
3
|
-
export default XReport
|
|
1
|
+
import XReport from './XReport'
|
|
2
|
+
|
|
3
|
+
export default XReport
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
</template>
|
|
24
24
|
|
|
25
25
|
<script>
|
|
26
|
-
import { getConfigByName, runLogic } from '@vue2-client/services/api/common'
|
|
26
|
+
import { getConfigByName, getConfigByNameAsync, runLogic } from '@vue2-client/services/api/common'
|
|
27
27
|
import { executeStrFunctionByContext } from '@vue2-client/utils/runEvalFunction'
|
|
28
28
|
|
|
29
29
|
export default {
|
|
@@ -55,6 +55,9 @@ export default {
|
|
|
55
55
|
this.config = res.data
|
|
56
56
|
})
|
|
57
57
|
},
|
|
58
|
+
runLogic,
|
|
59
|
+
getConfigByNameAsync,
|
|
60
|
+
getConfigByName,
|
|
58
61
|
getEventHandlers (tab) {
|
|
59
62
|
const handlers = {}
|
|
60
63
|
if (!tab?.events || tab?.events?.length === 0) {
|
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<a-list v-show="!loading" size="small" :data-source="data">
|
|
4
|
-
<a-list-item slot="renderItem" slot-scope="item">
|
|
5
|
-
<div>
|
|
6
|
-
<p><a @click="$emit('openFavorites', item.uuid)">{{ item.question }} </a></p>
|
|
7
|
-
<p>{{ item.date }}</p>
|
|
8
|
-
</div>
|
|
9
|
-
<a class="delete_item">
|
|
10
|
-
<a-icon type="close" @click="$emit('saveToFavorites', item.uuid)"/>
|
|
11
|
-
</a>
|
|
12
|
-
</a-list-item>
|
|
13
|
-
</a-list>
|
|
14
|
-
</div>
|
|
15
|
-
</template>
|
|
16
|
-
|
|
17
|
-
<script>
|
|
18
|
-
import { indexedDB } from '@vue2-client/utils/indexedDB'
|
|
19
|
-
|
|
20
|
-
export default {
|
|
21
|
-
name: 'FavoriteList',
|
|
22
|
-
data () {
|
|
23
|
-
return {
|
|
24
|
-
data: [],
|
|
25
|
-
loading: false
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
mounted () {
|
|
29
|
-
this.loadData()
|
|
30
|
-
},
|
|
31
|
-
methods: {
|
|
32
|
-
loadData () {
|
|
33
|
-
console.warn(123)
|
|
34
|
-
indexedDB.getAll((data) => {
|
|
35
|
-
const realData = data.filter(item => item.data && item.data.uuid)
|
|
36
|
-
.map(item => item.data)
|
|
37
|
-
this.data = realData
|
|
38
|
-
})
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
</script>
|
|
43
|
-
<style lang="less" scoped>
|
|
44
|
-
.delete_item {
|
|
45
|
-
margin-left: 8px;
|
|
46
|
-
color: #333;
|
|
47
|
-
}
|
|
48
|
-
p {
|
|
49
|
-
margin: 0
|
|
50
|
-
}
|
|
51
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<a-list v-show="!loading" size="small" :data-source="data">
|
|
4
|
+
<a-list-item slot="renderItem" slot-scope="item">
|
|
5
|
+
<div>
|
|
6
|
+
<p><a @click="$emit('openFavorites', item.uuid)">{{ item.question }} </a></p>
|
|
7
|
+
<p>{{ item.date }}</p>
|
|
8
|
+
</div>
|
|
9
|
+
<a class="delete_item">
|
|
10
|
+
<a-icon type="close" @click="$emit('saveToFavorites', item.uuid)"/>
|
|
11
|
+
</a>
|
|
12
|
+
</a-list-item>
|
|
13
|
+
</a-list>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script>
|
|
18
|
+
import { indexedDB } from '@vue2-client/utils/indexedDB'
|
|
19
|
+
|
|
20
|
+
export default {
|
|
21
|
+
name: 'FavoriteList',
|
|
22
|
+
data () {
|
|
23
|
+
return {
|
|
24
|
+
data: [],
|
|
25
|
+
loading: false
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
mounted () {
|
|
29
|
+
this.loadData()
|
|
30
|
+
},
|
|
31
|
+
methods: {
|
|
32
|
+
loadData () {
|
|
33
|
+
console.warn(123)
|
|
34
|
+
indexedDB.getAll((data) => {
|
|
35
|
+
const realData = data.filter(item => item.data && item.data.uuid)
|
|
36
|
+
.map(item => item.data)
|
|
37
|
+
this.data = realData
|
|
38
|
+
})
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
</script>
|
|
43
|
+
<style lang="less" scoped>
|
|
44
|
+
.delete_item {
|
|
45
|
+
margin-left: 8px;
|
|
46
|
+
color: #333;
|
|
47
|
+
}
|
|
48
|
+
p {
|
|
49
|
+
margin: 0
|
|
50
|
+
}
|
|
51
|
+
</style>
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { post } from '@vue2-client/services/api/restTools'
|
|
2
|
-
|
|
3
|
-
const entityApi = {
|
|
4
|
-
// 根据ID查询数据
|
|
5
|
-
getById: (entityName, id, data = {}, serviceName = process.env.VUE_APP_SYSTEM_NAME) => {
|
|
6
|
-
return post(`/api/${serviceName}/entity/query/${entityName}/${id}`, data)
|
|
7
|
-
},
|
|
8
|
-
// 根据ID集合查询所有数据
|
|
9
|
-
findAllByIds: (entityName, data, serviceName = process.env.VUE_APP_SYSTEM_NAME) => {
|
|
10
|
-
return post(`/api/${serviceName}/entity/query/${entityName}`, data)
|
|
11
|
-
},
|
|
12
|
-
// 查询实体的总数量
|
|
13
|
-
getCount: (entityName, serviceName = process.env.VUE_APP_SYSTEM_NAME) => {
|
|
14
|
-
return post(`/api/${serviceName}/entity/queryCount/${entityName}`, {})
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export { entityApi }
|
|
1
|
+
import { post } from '@vue2-client/services/api/restTools'
|
|
2
|
+
|
|
3
|
+
const entityApi = {
|
|
4
|
+
// 根据ID查询数据
|
|
5
|
+
getById: (entityName, id, data = {}, serviceName = process.env.VUE_APP_SYSTEM_NAME) => {
|
|
6
|
+
return post(`/api/${serviceName}/entity/query/${entityName}/${id}`, data)
|
|
7
|
+
},
|
|
8
|
+
// 根据ID集合查询所有数据
|
|
9
|
+
findAllByIds: (entityName, data, serviceName = process.env.VUE_APP_SYSTEM_NAME) => {
|
|
10
|
+
return post(`/api/${serviceName}/entity/query/${entityName}`, data)
|
|
11
|
+
},
|
|
12
|
+
// 查询实体的总数量
|
|
13
|
+
getCount: (entityName, serviceName = process.env.VUE_APP_SYSTEM_NAME) => {
|
|
14
|
+
return post(`/api/${serviceName}/entity/queryCount/${entityName}`, {})
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { entityApi }
|
package/src/utils/waterMark.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description: createWaterMark.js 加水印功能
|
|
3
|
-
*/
|
|
4
|
-
let waterMarkDOM
|
|
5
|
-
|
|
6
|
-
const clearWaterMark = () => {
|
|
7
|
-
if (waterMarkDOM) waterMarkDOM.remove()
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* @description: 创建水印
|
|
11
|
-
* @param waterMarkName 水印内容
|
|
12
|
-
*/
|
|
13
|
-
export default function createWaterMark (waterMarkName) {
|
|
14
|
-
clearWaterMark()
|
|
15
|
-
if (!waterMarkName) {
|
|
16
|
-
return
|
|
17
|
-
}
|
|
18
|
-
const width = window.parseInt(document.body.clientWidth)
|
|
19
|
-
const canvasWidth = width / window.parseInt(width / 320)
|
|
20
|
-
const fontFamily = window.getComputedStyle(document.body)['font-family']
|
|
21
|
-
const fragment = document.createDocumentFragment()
|
|
22
|
-
waterMarkDOM = document.createElement('div')
|
|
23
|
-
waterMarkDOM.className = 'water-mark-wrap'
|
|
24
|
-
let spanStr = ''
|
|
25
|
-
for (let i = 0; i < 100; i++) {
|
|
26
|
-
spanStr += `<span class="water-word" style=width:${canvasWidth}px;height:200px;font: ${fontFamily}>${waterMarkName}</span>`
|
|
27
|
-
}
|
|
28
|
-
waterMarkDOM.innerHTML = spanStr
|
|
29
|
-
fragment.appendChild(waterMarkDOM)
|
|
30
|
-
document.body.appendChild(fragment)
|
|
31
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @description: createWaterMark.js 加水印功能
|
|
3
|
+
*/
|
|
4
|
+
let waterMarkDOM
|
|
5
|
+
|
|
6
|
+
const clearWaterMark = () => {
|
|
7
|
+
if (waterMarkDOM) waterMarkDOM.remove()
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* @description: 创建水印
|
|
11
|
+
* @param waterMarkName 水印内容
|
|
12
|
+
*/
|
|
13
|
+
export default function createWaterMark (waterMarkName) {
|
|
14
|
+
clearWaterMark()
|
|
15
|
+
if (!waterMarkName) {
|
|
16
|
+
return
|
|
17
|
+
}
|
|
18
|
+
const width = window.parseInt(document.body.clientWidth)
|
|
19
|
+
const canvasWidth = width / window.parseInt(width / 320)
|
|
20
|
+
const fontFamily = window.getComputedStyle(document.body)['font-family']
|
|
21
|
+
const fragment = document.createDocumentFragment()
|
|
22
|
+
waterMarkDOM = document.createElement('div')
|
|
23
|
+
waterMarkDOM.className = 'water-mark-wrap'
|
|
24
|
+
let spanStr = ''
|
|
25
|
+
for (let i = 0; i < 100; i++) {
|
|
26
|
+
spanStr += `<span class="water-word" style=width:${canvasWidth}px;height:200px;font: ${fontFamily}>${waterMarkName}</span>`
|
|
27
|
+
}
|
|
28
|
+
waterMarkDOM.innerHTML = spanStr
|
|
29
|
+
fragment.appendChild(waterMarkDOM)
|
|
30
|
+
document.body.appendChild(fragment)
|
|
31
|
+
}
|