vue2-client 1.4.57 → 1.4.59

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
@@ -1,6 +1,9 @@
1
1
  # Change Log
2
2
  > 所有关于本项目的变化都在该文档里。
3
3
 
4
+ **1.4.58 - 1.4.59 -2022-11-29 @江超**
5
+ - 修复一些小问题
6
+
4
7
  **1.4.57 -2022-11-27 @江超**
5
8
  - 优化登录态和未登录态的页面跳转方式
6
9
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.4.57",
3
+ "version": "1.4.59",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -523,6 +523,7 @@ export default {
523
523
  pathKey: undefined,
524
524
  accept: undefined,
525
525
  selectType: undefined,
526
+ groupIndex: undefined,
526
527
  groupIndexView: undefined,
527
528
  addOrEdit: 'all',
528
529
  selectKeyName: undefined,
@@ -555,7 +556,7 @@ export default {
555
556
  this.lowerPath = this.stockList.filter(item => item.id === _item.resUploadStock)[0]?.f_lower_path_json ?? []
556
557
  }
557
558
  }
558
- if (_item.selectKey && _item.selectType === 'logic' && _item.selectKey.substring(0, 6) === 'logic@') {
559
+ if (_item.selectKey && _item.selectKey.length >= 6 && _item.selectType === 'logic' && _item.selectKey.substring(0, 6) === 'logic@') {
559
560
  _item.selectKey = _item.selectKey.substring(6)
560
561
  }
561
562
  if (_item.formType === 'selects') {
@@ -1,149 +1,151 @@
1
- <template>
2
- <a-drawer
3
- title="选择参数组"
4
- placement="right"
5
- :width="isMobile ? screenWidth : screenWidth * 0.85"
6
- :visible="visible"
7
- @close="onClose"
8
- >
9
- <x-add-form
10
- business-title="参数设置"
11
- business-type="编辑"
12
- :visible.sync="editQueryVisible"
13
- :json-data="formObj.formJson"
14
- :modify-model-data="this.modifyModelData[this.formObj.groupName]"
15
- :loading="loading"
16
- @onSubmit="submit"/>
17
- <a-list
18
- :grid="{gutter: 24, lg: 4, md: 3, sm: 1, xs: 1}"
19
- :dataSource="columnJson.groups"
20
- >
21
- <a-list-item slot="renderItem" slot-scope="item">
22
- <a-card :hoverable="true" @click="toEdit(item)">
23
- <a-card-meta >
24
- <div style="margin-bottom: 3px" slot="title">{{ item.group }}</div>
25
- <a-icon type="tags" slot="avatar" :style="{ fontSize:'2em' }"/>
26
- <div class="meta-content" slot="description">{{ item.describe }}</div>
27
- </a-card-meta>
28
- </a-card>
29
- </a-list-item>
30
- </a-list>
31
- </a-drawer>
32
- </template>
33
-
34
- <script>
35
- import { mapState } from 'vuex'
36
- import XAddForm from '@vue2-client/base-client/components/common/XAddForm/XAddForm'
37
- import { commonApi, post } from '@vue2-client/services/api'
38
-
39
- export default {
40
- name: 'FormGroupEdit',
41
- components: {
42
- XAddForm
43
- },
44
- data () {
45
- return {
46
- // 页面宽度
47
- screenWidth: document.documentElement.clientWidth,
48
- // 是否显示参数下发抽屉
49
- editQueryVisible: false,
50
- targetIndex: 0,
51
- columnJson: {},
52
- editIndex: -1,
53
- formObj: {
54
- groupName: '',
55
- formJson: []
56
- },
57
- // 参数设置业务执行状态
58
- loading: false
59
- }
60
- },
61
- mounted () {
62
- this.initView()
63
- },
64
- computed: {
65
- ...mapState('setting', ['isMobile'])
66
- },
67
- props: {
68
- visible: {
69
- type: Boolean,
70
- default: false
71
- },
72
- modifyModelData: {
73
- type: Object,
74
- default: () => {
75
- return {}
76
- }
77
- }
78
- },
79
- watch: {
80
- visible (rel) {
81
- if (rel) {
82
- this.initView()
83
- }
84
- }
85
- },
86
- methods: {
87
- // 初始化组件
88
- initView () {
89
- this.$emit('getColumnJson', val => {
90
- this.columnJson = val
91
- })
92
- },
93
- toEdit (item) {
94
- post(commonApi.getColumnsJson, { queryObject: item }).then(res => {
95
- this.formObj = res
96
- this.editQueryVisible = true
97
- })
98
- },
99
- onClose () {
100
- this.$emit('update:visible', false)
101
- },
102
- submit (res) {
103
- if (res.valid) {
104
- this.loading = true
105
- const requestParameters = {
106
- paramsJson: {}
107
- }
108
- requestParameters.paramsJson[this.formObj.groupName] = {}
109
- for (const key of Object.keys(res.form)) {
110
- const realKey = key.substring(key.indexOf('_') + 1)
111
- requestParameters.paramsJson[this.formObj.groupName][realKey] = res.form[key]
112
- }
113
- this.$emit('onSubmit', requestParameters, result => {
114
- if (result) {
115
- this.$message.success('参数设置成功!')
116
- } else {
117
- this.$message.error('参数设置失败!')
118
- }
119
- this.loading = false
120
- this.editQueryVisible = false
121
- })
122
- } else {
123
- return false
124
- }
125
- }
126
- }
127
- }
128
- </script>
129
- <style lang="less" scoped>
130
- .card-avatar {
131
- width: 48px;
132
- height: 48px;
133
- border-radius: 48px;
134
- }
135
- .new-btn{
136
- border-radius: 2px;
137
- width: 100%;
138
- height: 187px;
139
- }
140
- .meta-content{
141
- position: relative;
142
- overflow: hidden;
143
- text-overflow: ellipsis;
144
- display: -webkit-box;
145
- height: 64px;
146
- -webkit-line-clamp: 3;
147
- -webkit-box-orient: vertical;
148
- }
149
- </style>
1
+ <template>
2
+ <a-drawer
3
+ title="选择参数组"
4
+ placement="right"
5
+ :width="isMobile ? screenWidth : screenWidth * 0.85"
6
+ :visible="visible"
7
+ @close="onClose"
8
+ >
9
+ <x-add-form
10
+ business-title="参数设置"
11
+ business-type="编辑"
12
+ :visible.sync="editQueryVisible"
13
+ :json-data="formObj.formJson"
14
+ :modify-model-data="modifyModelDataItem"
15
+ :loading="loading"
16
+ @onSubmit="submit"/>
17
+ <a-list
18
+ :grid="{gutter: 24, lg: 4, md: 3, sm: 1, xs: 1}"
19
+ :dataSource="columnJson.groups"
20
+ >
21
+ <a-list-item slot="renderItem" slot-scope="item">
22
+ <a-card :hoverable="true" @click="toEdit(item)">
23
+ <a-card-meta >
24
+ <div style="margin-bottom: 3px" slot="title">{{ item.group }}</div>
25
+ <a-icon type="tags" slot="avatar" :style="{ fontSize:'2em' }"/>
26
+ <div class="meta-content" slot="description">{{ item.describe }}</div>
27
+ </a-card-meta>
28
+ </a-card>
29
+ </a-list-item>
30
+ </a-list>
31
+ </a-drawer>
32
+ </template>
33
+
34
+ <script>
35
+ import { mapState } from 'vuex'
36
+ import XAddForm from '@vue2-client/base-client/components/common/XAddForm/XAddForm'
37
+ import { commonApi, post } from '@vue2-client/services/api'
38
+
39
+ export default {
40
+ name: 'FormGroupEdit',
41
+ components: {
42
+ XAddForm
43
+ },
44
+ data () {
45
+ return {
46
+ // 页面宽度
47
+ screenWidth: document.documentElement.clientWidth,
48
+ // 是否显示参数下发抽屉
49
+ editQueryVisible: false,
50
+ targetIndex: 0,
51
+ columnJson: {},
52
+ editIndex: -1,
53
+ formObj: {
54
+ groupName: '',
55
+ formJson: []
56
+ },
57
+ modifyModelDataItem: {},
58
+ // 参数设置业务执行状态
59
+ loading: false
60
+ }
61
+ },
62
+ mounted () {
63
+ this.initView()
64
+ },
65
+ computed: {
66
+ ...mapState('setting', ['isMobile'])
67
+ },
68
+ props: {
69
+ visible: {
70
+ type: Boolean,
71
+ default: false
72
+ },
73
+ modifyModelData: {
74
+ type: Object,
75
+ default: () => {
76
+ return {}
77
+ }
78
+ }
79
+ },
80
+ watch: {
81
+ visible (rel) {
82
+ if (rel) {
83
+ this.initView()
84
+ }
85
+ }
86
+ },
87
+ methods: {
88
+ // 初始化组件
89
+ initView () {
90
+ this.$emit('getColumnJson', val => {
91
+ this.columnJson = val
92
+ })
93
+ },
94
+ toEdit (item) {
95
+ post(commonApi.getColumnsJson, { queryObject: item }).then(res => {
96
+ this.formObj = res
97
+ this.modifyModelDataItem = { data: this.modifyModelData[this.formObj.groupName] }
98
+ this.editQueryVisible = true
99
+ })
100
+ },
101
+ onClose () {
102
+ this.$emit('update:visible', false)
103
+ },
104
+ submit (res) {
105
+ if (res.valid) {
106
+ this.loading = true
107
+ const requestParameters = {
108
+ paramsJson: {}
109
+ }
110
+ requestParameters.paramsJson[this.formObj.groupName] = {}
111
+ for (const key of Object.keys(res.form)) {
112
+ const realKey = key.substring(key.indexOf('_') + 1)
113
+ requestParameters.paramsJson[this.formObj.groupName][realKey] = res.form[key]
114
+ }
115
+ this.$emit('onSubmit', requestParameters, result => {
116
+ if (result) {
117
+ this.$message.success('参数设置成功!')
118
+ } else {
119
+ this.$message.error('参数设置失败!')
120
+ }
121
+ this.loading = false
122
+ this.editQueryVisible = false
123
+ })
124
+ } else {
125
+ return false
126
+ }
127
+ }
128
+ }
129
+ }
130
+ </script>
131
+ <style lang="less" scoped>
132
+ .card-avatar {
133
+ width: 48px;
134
+ height: 48px;
135
+ border-radius: 48px;
136
+ }
137
+ .new-btn{
138
+ border-radius: 2px;
139
+ width: 100%;
140
+ height: 187px;
141
+ }
142
+ .meta-content{
143
+ position: relative;
144
+ overflow: hidden;
145
+ text-overflow: ellipsis;
146
+ display: -webkit-box;
147
+ height: 64px;
148
+ -webkit-line-clamp: 3;
149
+ -webkit-box-orient: vertical;
150
+ }
151
+ </style>
@@ -220,6 +220,11 @@ export default {
220
220
  },
221
221
  fixedQueryForm: {
222
222
  handler () {
223
+ if (this.queryParamsName) {
224
+ this.getColumnsJson()
225
+ } else if (this.queryParamsJson) {
226
+ this.getColumnsJsonBySource()
227
+ }
223
228
  this.form = {}
224
229
  },
225
230
  deep: true
@@ -229,6 +234,11 @@ export default {
229
234
  this.getColumnsJsonBySource()
230
235
  },
231
236
  deep: true
237
+ },
238
+ queryParamsName: {
239
+ handler () {
240
+ this.getColumnsJson()
241
+ }
232
242
  }
233
243
  },
234
244
  created () {
@@ -1,105 +1,109 @@
1
- <template>
2
- <div id="XTreeOne">
3
- <component-layout-one :siderProps="{width: leftWidth,collapsible: collapsible,collapsedWidth: collapsedWidth,theme: 'light'}">
4
- <template slot="left">
5
- <div class="bg-white pd-20" :style="{height: treeHeight}">
6
- <a-input-search style="margin-bottom: 8px" placeholder="Search" allow-clear @change="onChange" />
7
- <a-tree
8
- :tree-data="searchData"
9
- @select="onSelect">
10
- <template #title="{ title }">
11
- <span v-if="title.indexOf(searchValue) > -1">
12
- {{ title.substr(0, title.indexOf(searchValue)) }}
13
- <span style="color: #f50">{{ searchValue }}</span>
14
- {{ title.substr(title.indexOf(searchValue) + searchValue.length) }}
15
- </span>
16
- <span v-else>{{ title }}</span>
17
- </template>
18
- </a-tree>
19
- </div>
20
- </template>
21
- <slot></slot>
22
- </component-layout-one>
23
- </div>
24
- </template>
25
-
26
- <script>
27
- import ComponentLayoutOne from '@vue2-client/layouts/ComponentLayoutOne'
28
- export default {
29
- name: 'XTreeOne',
30
- components: { ComponentLayoutOne },
31
- props: {
32
- // 左侧宽度
33
- leftWidth: {
34
- type: [Number, String],
35
- default: () => {
36
- return 200
37
- }
38
- },
39
- // 左侧是否可收起
40
- collapsible: {
41
- type: Boolean,
42
- default: true
43
- },
44
- // 左侧收起后宽度
45
- collapsedWidth: {
46
- type: Number,
47
- default: 0
48
- },
49
- // Tree 树形控件数据
50
- // array<{key, title, children, [disabled, selectable]}>
51
- treeData: {
52
- type: Array,
53
- required: true
54
- },
55
- treeHeight: {
56
- type: String,
57
- default: '85vh'
58
- }
59
- },
60
- data () {
61
- return {
62
- // 用于展示筛选出的数据
63
- searchData: [],
64
- // 查询值
65
- searchValue: ''
66
- }
67
- },
68
- created () {
69
- },
70
- mounted () {
71
- },
72
- watch: {
73
- 'treeData' () {
74
- // 添加title插槽
75
- for (const index of this.treeData.keys()) {
76
- this.treeData[index].scopedSlots = { title: 'title' }
77
- }
78
- this.searchData = Object.assign([], this.treeData)
79
- }
80
- },
81
- methods: {
82
- onChange (e) {
83
- const name = e.target.value
84
- this.searchValue = name
85
- this.searchData = []
86
- for (const row of this.treeData) {
87
- if (row.title.indexOf(name) > -1) {
88
- this.searchData.push(row)
89
- }
90
- }
91
- },
92
- onSelect (selectedKeys, e) {
93
- this.$emit('onSelect', selectedKeys, e)
94
- }
95
- }
96
- }
97
- </script>
98
-
99
- <style lang="less">
100
- #XTreeOne {
101
- .pd-20 {
102
- padding: 20px;
103
- }
104
- }
105
- </style>
1
+ <template>
2
+ <div id="XTreeOne">
3
+ <component-layout-one :siderProps="{width: leftWidth,collapsible: collapsible,collapsedWidth: collapsedWidth,theme: 'light'}">
4
+ <template slot="left">
5
+ <div class="bg-white pd-20" :style="{height: treeHeight}">
6
+ <a-input-search style="margin-bottom: 8px" placeholder="Search" allow-clear @change="onChange" />
7
+ <a-tree
8
+ :tree-data="searchData"
9
+ @select="onSelect">
10
+ <template #title="{ title }">
11
+ <span v-if="title.indexOf(searchValue) > -1">
12
+ {{ title.substr(0, title.indexOf(searchValue)) }}
13
+ <span style="color: #f50">{{ searchValue }}</span>
14
+ {{ title.substr(title.indexOf(searchValue) + searchValue.length) }}
15
+ </span>
16
+ <span v-else>{{ title }}</span>
17
+ </template>
18
+ </a-tree>
19
+ </div>
20
+ </template>
21
+ <slot></slot>
22
+ </component-layout-one>
23
+ </div>
24
+ </template>
25
+
26
+ <script>
27
+ import ComponentLayoutOne from '@vue2-client/layouts/ComponentLayoutOne'
28
+ export default {
29
+ name: 'XTreeOne',
30
+ components: { ComponentLayoutOne },
31
+ props: {
32
+ // 左侧宽度
33
+ leftWidth: {
34
+ type: [Number, String],
35
+ default: () => {
36
+ return 200
37
+ }
38
+ },
39
+ // 左侧是否可收起
40
+ collapsible: {
41
+ type: Boolean,
42
+ default: true
43
+ },
44
+ // 左侧收起后宽度
45
+ collapsedWidth: {
46
+ type: Number,
47
+ default: 0
48
+ },
49
+ // Tree 树形控件数据
50
+ // array<{key, title, children, [disabled, selectable]}>
51
+ treeData: {
52
+ type: Array,
53
+ required: true
54
+ },
55
+ treeHeight: {
56
+ type: String,
57
+ default: '85vh'
58
+ }
59
+ },
60
+ data () {
61
+ return {
62
+ // 用于展示筛选出的数据
63
+ searchData: [],
64
+ // 查询值
65
+ searchValue: ''
66
+ }
67
+ },
68
+ created () {
69
+ this.init()
70
+ },
71
+ mounted () {
72
+ },
73
+ watch: {
74
+ 'treeData' () {
75
+ this.init()
76
+ }
77
+ },
78
+ methods: {
79
+ init () {
80
+ // 添加title插槽
81
+ for (const index of this.treeData.keys()) {
82
+ this.treeData[index].scopedSlots = { title: 'title' }
83
+ }
84
+ this.searchData = Object.assign([], this.treeData)
85
+ },
86
+ onChange (e) {
87
+ const name = e.target.value
88
+ this.searchValue = name
89
+ this.searchData = []
90
+ for (const row of this.treeData) {
91
+ if (row.title.indexOf(name) > -1) {
92
+ this.searchData.push(row)
93
+ }
94
+ }
95
+ },
96
+ onSelect (selectedKeys, e) {
97
+ this.$emit('onSelect', selectedKeys, e)
98
+ }
99
+ }
100
+ }
101
+ </script>
102
+
103
+ <style lang="less">
104
+ #XTreeOne {
105
+ .pd-20 {
106
+ padding: 20px;
107
+ }
108
+ }
109
+ </style>
@@ -1,46 +1,47 @@
1
- <template>
2
- <div id="ComponentLayoutOne">
3
- <a-layout>
4
- <a-layout-sider v-bind="siderProps">
5
- <slot name="left"></slot>
6
- </a-layout-sider>
7
- <a-layout>
8
- <slot></slot>
9
- </a-layout>
10
- </a-layout>
11
- </div>
12
- </template>
13
-
14
- <script>
15
- export default {
16
- name: 'ComponentLayoutOne',
17
- props: {
18
- // Layout.Sider props对象
19
- siderProps: {
20
- type: Object,
21
- default: () => {
22
- return {}
23
- }
24
- }
25
- },
26
- data () {
27
- return {}
28
- },
29
- created () {
30
- },
31
- mounted () {
32
- },
33
- methods: {}
34
- }
35
- </script>
36
-
37
- <style lang="less">
38
- #ComponentLayoutOne {
39
- .ant-layout-sider {
40
- .ant-layout-sider-zero-width-trigger {
41
- top: 50%;
42
- background-color: @shadow-color;
43
- }
44
- }
45
- }
46
- </style>
1
+ <template>
2
+ <div id="ComponentLayoutOne">
3
+ <a-layout>
4
+ <a-layout-sider v-bind="siderProps">
5
+ <slot name="left"></slot>
6
+ </a-layout-sider>
7
+ <a-layout>
8
+ <slot></slot>
9
+ </a-layout>
10
+ </a-layout>
11
+ </div>
12
+ </template>
13
+
14
+ <script>
15
+ export default {
16
+ name: 'ComponentLayoutOne',
17
+ props: {
18
+ // Layout.Sider props对象
19
+ siderProps: {
20
+ type: Object,
21
+ default: () => {
22
+ return {}
23
+ }
24
+ }
25
+ },
26
+ data () {
27
+ return {}
28
+ },
29
+ created () {
30
+ },
31
+ mounted () {
32
+ },
33
+ methods: {}
34
+ }
35
+ </script>
36
+
37
+ <style lang="less">
38
+ #ComponentLayoutOne {
39
+ .ant-layout-sider {
40
+ .ant-layout-sider-zero-width-trigger {
41
+ top: 50%;
42
+ background-color: @shadow-color;
43
+ z-index: 2;
44
+ }
45
+ }
46
+ }
47
+ </style>