vue2-client 1.4.54 → 1.4.55

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
@@ -4,6 +4,9 @@
4
4
  **1.4.54 -2022-11-21 @陈栋杨**
5
5
  - 现在登录时会清除indexedDB缓存了
6
6
 
7
+ **1.4.54 - 1.4.55 -2022-11-25 @江超**
8
+ - 增加查询系统访问记录的接口
9
+
7
10
  **1.4.53 -2022-11-21 @陈栋杨**
8
11
  - 优化单页面组件传值方式
9
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.4.54",
3
+ "version": "1.4.55",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -1,106 +1,107 @@
1
- <template>
2
- <page-toggle-transition :disabled="animate.disabled" :animate="animate.name" :direction="animate.direction">
3
- <template v-if="login">
4
- <div style="padding-top: 1px; background-color: #fff;">
5
- <iframe
6
- ref="singlepage"
7
- :src="url"
8
- :name="this.fullPath"
9
- class="single-page-iframe"
10
- @load="load">
11
- </iframe>
12
- </div>
13
- </template>
14
- </page-toggle-transition>
15
- </template>
16
-
17
- <script>
18
- import PageToggleTransition from '@vue2-client/components/transition/PageToggleTransition'
19
- import { ACCESS_TOKEN } from '@vue2-client/store/mutation-types'
20
- import { mapState, mapMutations } from 'vuex'
21
- import { CASLogin, doOtherValidate } from '@vue2-client/services/api/cas'
22
-
23
- export default {
24
- name: 'SinglePageView',
25
- components: { PageToggleTransition },
26
- props: {
27
- singlePageUrl: {
28
- type: String,
29
- default: ''
30
- },
31
- fullPath: {
32
- type: String,
33
- default: ''
34
- }
35
- },
36
- data () {
37
- return {
38
- iframe: null,
39
- url: ''
40
- }
41
- },
42
- computed: {
43
- ...mapState('setting', ['animate', 'iframeSrc']),
44
- ...mapState('account', ['login'])
45
- },
46
- created () {
47
- if (this.singlePageUrl.indexOf('sso:') !== -1) {
48
- const serviceKey = this.singlePageUrl.substring(4)
49
- CASLogin(serviceKey, true).then(res => {
50
- const redirectUrl = res.redirectUrl
51
- if (redirectUrl.indexOf('logic@') !== -1) {
52
- const logicName = redirectUrl.substring(6)
53
- doOtherValidate(logicName, res.st, serviceKey).then(validateRes => {
54
- this.url = validateRes.redirectUrl
55
- })
56
- } else {
57
- const join = redirectUrl.split('?')[1] ? '&' : '?'
58
- this.url = redirectUrl + join + 'ticket=' + res.st
59
- }
60
- }).catch(msg => {
61
- console.warn(msg)
62
- this.$message.error(msg)
63
- })
64
- } else {
65
- this.url = this.iframeSrc
66
- }
67
- },
68
- mounted () {
69
- if (!this.login) {
70
- this.setLogin(JSON.parse(sessionStorage.getItem(process.env.VUE_APP_LOGIN_KEY)))
71
- }
72
- this.iframe = this.$refs.singlepage.contentWindow
73
- this.path = this.$route.path
74
- },
75
- methods: {
76
- ...mapMutations('account', ['setLogin']),
77
- load () {
78
- if (this.singlePageUrl.indexOf('sso:') === -1) {
79
- const appdata = {
80
- singleValues: this.$appdata.getSingleValues(),
81
- params: this.$appdata.getParams()
82
- }
83
- const data = {
84
- token: localStorage.getItem(ACCESS_TOKEN),
85
- login: this.login,
86
- appdata: appdata,
87
- page: this.singlePageUrl
88
- }
89
- console.log('发送参数', data)
90
- if (this.iframe) {
91
- this.iframe.postMessage(data, '*')
92
- }
93
- }
94
- this.$emit('load', this.fullPath)
95
- }
96
- }
97
- }
98
- </script>
99
-
100
- <style lang="less">
101
- .single-page-iframe {
102
- width: 100%;
103
- height: calc(100vh - 117px);
104
- border: none;
105
- }
106
- </style>
1
+ <template>
2
+ <page-toggle-transition :disabled="animate.disabled" :animate="animate.name" :direction="animate.direction">
3
+ <template v-if="login">
4
+ <div style="padding-top: 1px; background-color: #fff;">
5
+ <iframe
6
+ ref="singlepage"
7
+ :src="url"
8
+ :name="this.fullPath"
9
+ class="single-page-iframe"
10
+ sandbox="allow-forms allow-scripts allow-same-origin allow-top-navigation"
11
+ @load="load">
12
+ </iframe>
13
+ </div>
14
+ </template>
15
+ </page-toggle-transition>
16
+ </template>
17
+
18
+ <script>
19
+ import PageToggleTransition from '@vue2-client/components/transition/PageToggleTransition'
20
+ import { ACCESS_TOKEN } from '@vue2-client/store/mutation-types'
21
+ import { mapState, mapMutations } from 'vuex'
22
+ import { CASLogin, doOtherValidate } from '@vue2-client/services/api/cas'
23
+
24
+ export default {
25
+ name: 'SinglePageView',
26
+ components: { PageToggleTransition },
27
+ props: {
28
+ singlePageUrl: {
29
+ type: String,
30
+ default: ''
31
+ },
32
+ fullPath: {
33
+ type: String,
34
+ default: ''
35
+ }
36
+ },
37
+ data () {
38
+ return {
39
+ iframe: null,
40
+ url: ''
41
+ }
42
+ },
43
+ computed: {
44
+ ...mapState('setting', ['animate', 'iframeSrc']),
45
+ ...mapState('account', ['login'])
46
+ },
47
+ created () {
48
+ if (this.singlePageUrl.indexOf('sso:') !== -1) {
49
+ const serviceKey = this.singlePageUrl.substring(4)
50
+ CASLogin(serviceKey, true).then(res => {
51
+ const redirectUrl = res.redirectUrl
52
+ if (redirectUrl.indexOf('logic@') !== -1) {
53
+ const logicName = redirectUrl.substring(6)
54
+ doOtherValidate(logicName, res.st, serviceKey).then(validateRes => {
55
+ this.url = validateRes.redirectUrl
56
+ })
57
+ } else {
58
+ const join = redirectUrl.split('?')[1] ? '&' : '?'
59
+ this.url = redirectUrl + join + 'ticket=' + res.st
60
+ }
61
+ }).catch(msg => {
62
+ console.warn(msg)
63
+ this.$message.error(msg)
64
+ })
65
+ } else {
66
+ this.url = this.iframeSrc
67
+ }
68
+ },
69
+ mounted () {
70
+ if (!this.login) {
71
+ this.setLogin(JSON.parse(sessionStorage.getItem(process.env.VUE_APP_LOGIN_KEY)))
72
+ }
73
+ this.iframe = this.$refs.singlepage.contentWindow
74
+ this.path = this.$route.path
75
+ },
76
+ methods: {
77
+ ...mapMutations('account', ['setLogin']),
78
+ load () {
79
+ if (this.singlePageUrl.indexOf('sso:') === -1) {
80
+ const appdata = {
81
+ singleValues: this.$appdata.getSingleValues(),
82
+ params: this.$appdata.getParams()
83
+ }
84
+ const data = {
85
+ token: localStorage.getItem(ACCESS_TOKEN),
86
+ login: this.login,
87
+ appdata: appdata,
88
+ page: this.singlePageUrl
89
+ }
90
+ console.log('发送参数', data)
91
+ if (this.iframe) {
92
+ this.iframe.postMessage(data, '*')
93
+ }
94
+ }
95
+ this.$emit('load', this.fullPath)
96
+ }
97
+ }
98
+ }
99
+ </script>
100
+
101
+ <style lang="less">
102
+ .single-page-iframe {
103
+ width: 100%;
104
+ height: calc(100vh - 117px);
105
+ border: none;
106
+ }
107
+ </style>
@@ -1,65 +1,84 @@
1
- <template>
2
- <div>
3
- <create-query
4
- :visible.sync="visible"
5
- @saveQueryParams="saveQueryParams"
6
- />
7
- <create-simple-form-query
8
- :visible.sync="createSimpleFormVisible"
9
- @saveSimpleFormQueryParams="saveSimpleFormQueryParams"
10
- />
11
- <a-button style="margin-top: 10px;margin-left: 10px;" type="primary" @click="showDrawer">打开完整查询配置生成工具</a-button>
12
- <a-button style="margin-top: 10px;margin-left: 10px;" type="primary" @click="showSimpleFormQueryParamsDrawer">打开基础表单配置生成工具</a-button>
13
- <!-- <webmeter-analysis-view/>-->
14
- </div>
15
- </template>
16
-
17
- <script>
18
- import { post } from '@vue2-client/services/api/restTools'
19
- import CreateQuery from '@vue2-client/base-client/components/common/CreateQuery'
20
- import CreateSimpleFormQuery from '@vue2-client/base-client/components/common/CreateSimpleFormQuery'
21
-
22
- export default {
23
- name: 'CreateQueryPage',
24
- components: {
25
- CreateQuery,
26
- CreateSimpleFormQuery
27
- },
28
- data () {
29
- return {
30
- visible: false,
31
- createSimpleFormVisible: false
32
- }
33
- },
34
- methods: {
35
- showDrawer () {
36
- this.visible = true
37
- },
38
- showSimpleFormQueryParamsDrawer () {
39
- this.createSimpleFormVisible = true
40
- },
41
- // 存储查询配置信息
42
- saveQueryParams (source) {
43
- return post('/api/af-system/logic/addOrEditQueryParams', {
44
- source: source
45
- }).then(res => {
46
- this.$message.success('保存查询配置成功')
47
- }, err => {
48
- console.error(err)
49
- })
50
- },
51
- // 存储基础表单配置信息
52
- saveSimpleFormQueryParams (source) {
53
- return post('/api/af-system/logic/addOrEditSimpleFormQueryParams', {
54
- source: source
55
- }).then(res => {
56
- this.$message.success('保存基础表单配置成功')
57
- }, err => {
58
- console.error(err)
59
- })
60
- }
61
- }
62
- }
63
- </script>
64
- <style lang="less" scoped>
65
- </style>
1
+ <template>
2
+ <div>
3
+ <create-query
4
+ :visible.sync="visible"
5
+ @saveQueryParams="saveQueryParams"
6
+ />
7
+ <create-simple-form-query
8
+ :visible.sync="createSimpleFormVisible"
9
+ @saveSimpleFormQueryParams="saveSimpleFormQueryParams"
10
+ />
11
+ <a-button style="margin-top: 10px;margin-left: 10px;" type="primary" @click="showDrawer">打开完整查询配置生成工具
12
+ </a-button>
13
+ <a-button style="margin-top: 10px;margin-left: 10px;" type="primary" @click="showSimpleFormQueryParamsDrawer">
14
+ 打开基础表单配置生成工具
15
+ </a-button>
16
+ <a-button style="margin-top: 10px;margin-left: 10px;" type="primary" @click="searchReport">请求数据</a-button>
17
+ <!-- <webmeter-analysis-view/>-->
18
+ </div>
19
+ </template>
20
+
21
+ <script>
22
+ import { post } from '@vue2-client/services/api/restTools'
23
+ import CreateQuery from '@vue2-client/base-client/components/common/CreateQuery'
24
+ import CreateSimpleFormQuery from '@vue2-client/base-client/components/common/CreateSimpleFormQuery'
25
+
26
+ export default {
27
+ name: 'CreateQueryPage',
28
+ components: {
29
+ CreateQuery,
30
+ CreateSimpleFormQuery
31
+ },
32
+ data () {
33
+ return {
34
+ visible: false,
35
+ createSimpleFormVisible: false
36
+ }
37
+ },
38
+ methods: {
39
+ showDrawer () {
40
+ this.visible = true
41
+ },
42
+ showSimpleFormQueryParamsDrawer () {
43
+ this.createSimpleFormVisible = true
44
+ },
45
+ // 查询report
46
+ searchReport (source) {
47
+ return post('/rs/report/saleMonthReport', {
48
+ 'data': {
49
+ 'condition': ' 1=1 ',
50
+ 'startDate': '2022-11-21 00:00:00',
51
+ 'endDate': '2022-11-21 23:59:59',
52
+ 'f_orgid': 'f_orgid in (21142)'
53
+ }
54
+ }).then(res => {
55
+ this.$message.success(res)
56
+ }, err => {
57
+ console.error(err)
58
+ })
59
+ },
60
+ // 存储查询配置信息
61
+ saveQueryParams (source) {
62
+ return post('/api/af-system/logic/addOrEditQueryParams', {
63
+ source: source
64
+ }).then(res => {
65
+ this.$message.success('保存查询配置成功')
66
+ }, err => {
67
+ console.error(err)
68
+ })
69
+ },
70
+ // 存储基础表单配置信息
71
+ saveSimpleFormQueryParams (source) {
72
+ return post('/api/af-system/logic/addOrEditSimpleFormQueryParams', {
73
+ source: source
74
+ }).then(res => {
75
+ this.$message.success('保存基础表单配置成功')
76
+ }, err => {
77
+ console.error(err)
78
+ })
79
+ }
80
+ }
81
+ }
82
+ </script>
83
+ <style lang="less" scoped>
84
+ </style>
@@ -0,0 +1,50 @@
1
+ <template>
2
+ <div>
3
+ <div id="reportContent">
4
+ <table style="margin: 0px auto" v-html="model"> </table>
5
+ </div>
6
+ </div>
7
+ </template>
8
+
9
+ <script>
10
+ import { post } from '@vue2-client/services/api/restTools'
11
+
12
+ export default {
13
+ name: 'ReportView',
14
+ data () {
15
+ return {
16
+ model: ''
17
+ }
18
+ },
19
+ props: ['data'],
20
+ methods: {
21
+ // 查询report
22
+ searchReport (source) {
23
+ return post('/rs/report/saleMonthReport', {
24
+ // data: this.data.data
25
+ data: this.data['data']
26
+ }).then(res => {
27
+ this.model = res
28
+ }).catch(err => {
29
+ console.error(err)
30
+ })
31
+ }
32
+ }
33
+ }
34
+ </script>
35
+ <style lang="less" scoped>
36
+ #reportContent {
37
+ margin-top: 5px;
38
+ }
39
+ </style>
40
+ <style>
41
+ #reportContent .report-primary{
42
+ background-color: #dfedfb;
43
+ border: 1px solid #d8d7d7;
44
+ border-collapse: collapse;
45
+ }
46
+ #reportContent .report-success{
47
+ border: 1px solid #d8d7d7;
48
+ border-collapse: collapse;
49
+ }
50
+ </style>
@@ -1,65 +1,67 @@
1
- // 视图组件
2
- const view = {
3
- tabs: () => import('@vue2-client/layouts/tabs'),
4
- blank: () => import('@vue2-client/layouts/BlankView'),
5
- page: () => import('@vue2-client/layouts/PageView')
6
- }
7
- // 动态路由对象定义
8
- const routerResource = {}
9
- // --------------------------------------基本视图组件--------------------------------------
10
- // 空白视图
11
- routerResource.blank = view.blank
12
- // 单页面视图
13
- routerResource.singlePage = view.blank
14
-
15
- // --------------------------------------仪表盘--------------------------------------
16
- routerResource.dashboard = view.blank
17
- // 工作台
18
- routerResource.workplace = () => import('@vue2-client/pages/dashboard/workplace')
19
- // --------------------------------------系统配置--------------------------------------
20
- routerResource.system = view.blank
21
- // 字典管理
22
- routerResource.dictionaryManage = () => import(/* webpackChunkName: "dictionary" */ '@vue2-client/pages/system/dictionary')
23
- // 查询配置管理
24
- routerResource.queryParamsManage = () => import(/* webpackChunkName: "queryParams" */ '@vue2-client/pages/system/queryParams')
25
- // 文件管理
26
- routerResource.fileManager = () => import('@vue2-client/pages/system/file')
27
- // 登录日志
28
- routerResource.loginInfor = () => import('@vue2-client/pages/system/monitor/loginInfor')
29
- // 操作日志
30
- routerResource.operLog = () => import('@vue2-client/pages/system/monitor/operLog')
31
- // 系统问题反馈工单
32
- routerResource.submitTicket = () => import(/* webpackChunkName: "submitTicket" */ '@vue2-client/pages/system/ticket')
33
-
34
- // 基础路由组件注册
35
- const routerMap = {
36
- login: {
37
- authority: '*',
38
- path: '/login',
39
- component: () => import('@vue2-client/pages/login')
40
- },
41
- root: {
42
- path: '/',
43
- name: '首页',
44
- redirect: '/login',
45
- component: view.tabs
46
- },
47
- exp403: {
48
- authority: '*',
49
- name: 'exp403',
50
- path: '403',
51
- component: () => import('@vue2-client/pages/exception/403')
52
- },
53
- exp404: {
54
- name: 'exp404',
55
- path: '404',
56
- component: () => import('@vue2-client/pages/exception/404')
57
- },
58
- exp500: {
59
- name: 'exp500',
60
- path: '500',
61
- component: () => import('@vue2-client/pages/exception/500')
62
- }
63
- }
64
- Object.assign(routerMap, routerResource)
65
- export default routerMap
1
+ // 视图组件
2
+ const view = {
3
+ tabs: () => import('@vue2-client/layouts/tabs'),
4
+ blank: () => import('@vue2-client/layouts/BlankView'),
5
+ page: () => import('@vue2-client/layouts/PageView')
6
+ }
7
+ // 动态路由对象定义
8
+ const routerResource = {}
9
+ // --------------------------------------基本视图组件--------------------------------------
10
+ // 空白视图
11
+ routerResource.blank = view.blank
12
+ // 单页面视图
13
+ routerResource.singlePage = view.blank
14
+
15
+ // --------------------------------------仪表盘--------------------------------------
16
+ routerResource.dashboard = view.blank
17
+ // 工作台
18
+ routerResource.workplace = () => import('@vue2-client/pages/dashboard/workplace')
19
+ // --------------------------------------系统配置--------------------------------------
20
+ routerResource.system = view.blank
21
+ // 报表测试用页面
22
+ routerResource.testPage = () => import('@vue2-client/pages/ReportView.vue')
23
+ // 字典管理
24
+ routerResource.dictionaryManage = () => import(/* webpackChunkName: "dictionary" */ '@vue2-client/pages/system/dictionary')
25
+ // 查询配置管理
26
+ routerResource.queryParamsManage = () => import(/* webpackChunkName: "queryParams" */ '@vue2-client/pages/system/queryParams')
27
+ // 文件管理
28
+ routerResource.fileManager = () => import('@vue2-client/pages/system/file')
29
+ // 登录日志
30
+ routerResource.loginInfor = () => import('@vue2-client/pages/system/monitor/loginInfor')
31
+ // 操作日志
32
+ routerResource.operLog = () => import('@vue2-client/pages/system/monitor/operLog')
33
+ // 系统问题反馈工单
34
+ routerResource.submitTicket = () => import(/* webpackChunkName: "submitTicket" */ '@vue2-client/pages/system/ticket')
35
+
36
+ // 基础路由组件注册
37
+ const routerMap = {
38
+ login: {
39
+ authority: '*',
40
+ path: '/login',
41
+ component: () => import('@vue2-client/pages/login')
42
+ },
43
+ root: {
44
+ path: '/',
45
+ name: '首页',
46
+ redirect: '/login',
47
+ component: view.tabs
48
+ },
49
+ exp403: {
50
+ authority: '*',
51
+ name: 'exp403',
52
+ path: '403',
53
+ component: () => import('@vue2-client/pages/exception/403')
54
+ },
55
+ exp404: {
56
+ name: 'exp404',
57
+ path: '404',
58
+ component: () => import('@vue2-client/pages/exception/404')
59
+ },
60
+ exp500: {
61
+ name: 'exp500',
62
+ path: '500',
63
+ component: () => import('@vue2-client/pages/exception/500')
64
+ }
65
+ }
66
+ Object.assign(routerMap, routerResource)
67
+ export default routerMap
@@ -0,0 +1,6 @@
1
+ const loginforApi = {
2
+ // 查询:获取系统访问记录
3
+ query: '/api/af-system/logic/getLogininfor'
4
+ }
5
+
6
+ export { loginforApi }
package/vue.config.js CHANGED
@@ -8,7 +8,7 @@ const CompressionWebpackPlugin = require('compression-webpack-plugin')
8
8
  const productionGzipExtensions = ['js', 'css']
9
9
  const isProd = process.env.NODE_ENV === 'production'
10
10
 
11
- const server = 'http://121.36.106.17:8400'
11
+ const server = 'http://123.60.214.109:8406'
12
12
  // const local = 'http://localhost:8445/webmeter'
13
13
  const local = 'http://123.60.214.109:8406'
14
14
  // const local = 'http://localhost:8080'
@@ -19,6 +19,11 @@ module.exports = {
19
19
  port: 8001,
20
20
  // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
21
21
  proxy: {
22
+ '/rs/report': {
23
+ target: 'http://192.168.50.4:8400',
24
+ ws: false,
25
+ changeOrigin: true
26
+ },
22
27
  '/rs': {
23
28
  target: server,
24
29
  ws: false,
@@ -30,7 +35,7 @@ module.exports = {
30
35
  changeOrigin: true
31
36
  },
32
37
  '/api': {
33
- pathRewrite: { '^/api/af-system/': '/rs/' },
38
+ // pathRewrite: { '^/api/af-system/': '/rs/' },
34
39
  // pathRewrite: { '^/api': '/' },
35
40
  target: local,
36
41
  changeOrigin: true