vue2-client 1.2.33 → 1.2.36

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.
Files changed (27) hide show
  1. package/.eslintrc.js +82 -81
  2. package/CHANGELOG.md +21 -0
  3. package/package.json +1 -1
  4. package/src/base-client/all.js +59 -57
  5. package/src/base-client/components/common/CreateQuery/CreateQuery.vue +1342 -1308
  6. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +752 -752
  7. package/src/base-client/components/common/Upload/Upload.vue +124 -0
  8. package/src/base-client/components/common/Upload/index.js +3 -0
  9. package/src/base-client/components/common/XAddForm/XAddForm.vue +338 -337
  10. package/src/base-client/components/common/XAddNativeForm/index.js +3 -3
  11. package/src/base-client/components/common/XAddNativeForm/index.md +56 -56
  12. package/src/base-client/components/common/XForm/XFormItem.vue +280 -307
  13. package/src/base-client/components/common/XFormTable/XFormTable.vue +4 -4
  14. package/src/base-client/components/common/XFormTable/index.md +94 -94
  15. package/src/base-client/components/common/XTable/index.md +255 -255
  16. package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +5 -1
  17. package/src/config/config.js +2 -0
  18. package/src/layouts/AdminLayout.vue +2 -2
  19. package/src/layouts/tabs/TabsView.vue +6 -0
  20. package/src/pages/resourceManage/resourceManageMain.vue +0 -1
  21. package/src/pages/system/ticket/index.vue +29 -26
  22. package/src/router/index.js +1 -1
  23. package/src/services/api/EmployeeDetailsViewApi.js +16 -16
  24. package/src/services/api/applyInstallApi.js +14 -14
  25. package/src/services/api/restTools.js +24 -23
  26. package/src/utils/request.js +1 -0
  27. package/vue.config.js +143 -143
@@ -1,307 +1,280 @@
1
- <template>
2
- <!-- 综合筛选 -->
3
- <x-form-col
4
- :xl="xl"
5
- :xxl="xxl"
6
- v-if="attr.type === 'select' && attr.model === 'rowIdValue'">
7
- <a-form-model-item
8
- :ref="attr.model"
9
- :label="attr.name"
10
- :prop="attr.model">
11
- <a-input :disabled="disabled" v-model="form[attr.model]">
12
- <a-select
13
- slot="addonBefore"
14
- v-model="form['rowIdName']"
15
- style="width: 100px">
16
- <a-select-option
17
- v-for="(item,index) in attr.keys"
18
- :key="index"
19
- :value="Object.keys(item)[0]">{{ item[Object.keys(item)[0]] }}
20
- </a-select-option>
21
- </a-select>
22
- </a-input>
23
- </a-form-model-item>
24
- </x-form-col>
25
- <!-- 输入框 -->
26
- <x-form-col
27
- :xl="xl"
28
- :xxl="xxl"
29
- v-else-if="attr.type === 'input'">
30
- <a-form-model-item
31
- :ref="attr.model"
32
- :label="attr.name"
33
- :prop="attr.model">
34
- <a-input :disabled="disabled" v-model="form[attr.model]" :placeholder="attr.placeholder ? attr.placeholder : '请输入'+attr.name.replace(/\s*/g, '')"/>
35
- </a-form-model-item>
36
- </x-form-col>
37
- <!-- 下拉框 -->
38
- <x-form-col
39
- :xl="xl"
40
- :xxl="xxl"
41
- v-else-if="attr.type === 'select'">
42
- <a-form-model-item
43
- :ref="attr.model"
44
- :label="attr.name"
45
- :prop="attr.model">
46
- <a-select
47
- v-if="!attr.lazyLoad || attr.lazyLoad === 'false'"
48
- v-model="form[attr.model]"
49
- :disabled="disabled"
50
- show-search
51
- :placeholder="attr.placeholder ? attr.placeholder : '请选择'"
52
- :filter-option="filterOption"
53
- >
54
- <a-select-option
55
- v-if="mode === '查询'"
56
- key="999999"
57
- value="全部">全部
58
- </a-select-option>
59
- <template v-if="attr.keys">
60
- <a-select-option
61
- v-for="(item,index) in attr.keys"
62
- :key="index"
63
- :value="Object.keys(item)[0]">
64
- {{ item[Object.keys(item)[0]] }}
65
- </a-select-option>
66
- </template>
67
- <template v-else>
68
- <template v-if="attr.keyName.indexOf('logic@') !== -1">
69
- <a-select-option
70
- v-for="(item,index) in option"
71
- :key="index"
72
- :value="Object.keys(item)[0]">{{ item[Object.keys(item)[0]] }}
73
- </a-select-option>
74
- </template>
75
- <template v-else>
76
- <a-select-option
77
- v-for="item in $appdata.getDictionaryList(attr.keyName)"
78
- :key="item.value"
79
- :value="item.value">
80
- <!-- 徽标(badge) -->
81
- <x-badge :badge-key="attr.keyName" :value="item.value" :replaceText="item.text"/>
82
- </a-select-option>
83
- </template>
84
- </template>
85
- </a-select>
86
- <a-select
87
- v-else
88
- show-search
89
- v-model="form[attr.model]"
90
- :disabled="disabled"
91
- @search="fetchFunction"
92
- :placeholder="attr.placeholder ? attr.placeholder : '搜索' + attr.name"
93
- :filter-option="filterOption"
94
- >
95
- <a-spin v-if="searching" slot="notFoundContent" size="small" />
96
- <a-select-option
97
- v-for="(item,index) in option"
98
- :key="index"
99
- :value="Object.keys(item)[0]">{{ item[Object.keys(item)[0]] }}
100
- </a-select-option>
101
- </a-select>
102
- </a-form-model-item>
103
- </x-form-col>
104
- <!-- TODO 多选框 -->
105
- <!-- TODO 单选框 -->
106
- <!-- 日期范围选择器 -->
107
- <x-form-col
108
- :xl="xl"
109
- :xxl="xxl"
110
- v-else-if="attr.type === 'rangePicker'">
111
- <a-form-model-item :ref="attr.model" :label="attr.name" :prop="attr.model">
112
- <a-range-picker :disabled="disabled" :show-time="true" v-model="form[attr.model]" valueFormat="YYYY-MM-DD HH:mm:ss"/>
113
- </a-form-model-item>
114
- </x-form-col>
115
- <!-- 月份选择器 -->
116
- <x-form-col
117
- :xl="xl"
118
- :xxl="xxl"
119
- v-else-if="attr.type === 'monthPicker'">
120
- <a-form-model-item :ref="attr.model" :label="attr.name" :prop="attr.model">
121
- <a-month-picker :disabled="disabled" :show-time="true" v-model="form[attr.model]" valueFormat="YYYY-MM"/>
122
- </a-form-model-item>
123
- </x-form-col>
124
- <!-- 日期选择器 -->
125
- <x-form-col
126
- :xl="xl"
127
- :xxl="xxl"
128
- v-else-if="attr.type === 'datePicker'">
129
- <a-form-model-item :ref="attr.model" :label="attr.name" :prop="attr.model">
130
- <a-date-picker :disabled="disabled" :show-time="true" v-model="form[attr.model]" valueFormat="YYYY-MM-DD"/>
131
- </a-form-model-item>
132
- </x-form-col>
133
- <!-- 级联选择器 -->
134
- <x-form-col
135
- :xl="xl"
136
- :xxl="xxl"
137
- v-else-if="attr.type === 'cascader'">
138
- <a-form-model-item :ref="attr.model" :label="attr.name" :prop="attr.model">
139
- <template v-if="attr.keys">
140
- <a-dcascader :disabled="disabled" :option="attr.keys" :value="form[attr.model]"/>
141
- </template>
142
- <template v-else>
143
- <a-dcascader :disabled="disabled" :option="option" :value="form[attr.model]"/>
144
- </template>
145
- </a-form-model-item>
146
- </x-form-col>
147
- <!-- 文本域 -->
148
- <x-form-col
149
- :xl="24"
150
- :xxl="24"
151
- :xs="24"
152
- :sm="24"
153
- :md="24"
154
- :lg="24"
155
- v-else-if="attr.type === 'textarea'">
156
- <a-form-model-item
157
- :ref="attr.model"
158
- :label="attr.name"
159
- :prop="attr.model">
160
- <a-textarea :rows="4" :disabled="disabled" v-model="form[attr.model]" :placeholder="attr.placeholder ? attr.placeholder : '请输入'+attr.name.replace(/\s*/g, '')"/>
161
- </a-form-model-item>
162
- </x-form-col>
163
- <!-- TODO 文件上传 -->
164
- <x-form-col
165
- :xl="24"
166
- :xxl="24"
167
- :xs="24"
168
- :sm="24"
169
- :md="24"
170
- :lg="24"
171
- v-else-if="attr.type === 'file'">
172
- <a-form-model-item :ref="attr.model" :label="attr.name" :prop="attr.model">
173
- <a-upload-dragger
174
- name="file"
175
- :multiple="true"
176
- :action="'/webmeteruploadapi/upload/'+attr.resUploadMode">
177
- <p class="ant-upload-drag-icon">
178
- <a-icon type="inbox"/>
179
- </p>
180
- <p class="ant-upload-text">
181
- 点击或拖动文件到该区域上传
182
- </p>
183
- <p class="ant-upload-hint">
184
- 支持单个或多个文件
185
- </p>
186
- </a-upload-dragger>
187
- </a-form-model-item>
188
- </x-form-col>
189
- <!-- TODO 图片上传 -->
190
- <x-form-col
191
- :xl="24"
192
- :xxl="24"
193
- :xs="24"
194
- :sm="24"
195
- :md="24"
196
- :lg="24"
197
- v-else-if="attr.type === 'image'">
198
- <a-form-model-item :ref="attr.model" :label="attr.name" :prop="attr.model">
199
- <a-upload list-type="picture-card" :file-list="[]">
200
- <a-icon type="plus"/>
201
- <div class="ant-upload-text">
202
- Upload
203
- </div>
204
- </a-upload>
205
- </a-form-model-item>
206
- </x-form-col>
207
- </template>
208
- <script>
209
-
210
- import { post } from '@vue2-client/services/api'
211
- import { debounce } from 'ant-design-vue/lib/vc-table/src/utils'
212
-
213
- export default {
214
- name: 'XFormItem',
215
- data () {
216
- // 检索去抖
217
- this.fetchFunction = debounce(this.fetchFunction, 800)
218
- return {
219
- option: [],
220
- // 最后检索版本
221
- lastFetchId: 0,
222
- // 检索中
223
- searching: false
224
- }
225
- },
226
- props: {
227
- attr: {
228
- type: Object,
229
- default: () => {
230
- return {}
231
- }
232
- },
233
- form: {
234
- type: Object,
235
- default: () => {
236
- return {}
237
- }
238
- },
239
- disabled: {
240
- type: Boolean,
241
- default: () => {
242
- return false
243
- }
244
- },
245
- mode: {
246
- type: String,
247
- default: () => {
248
- return '查询'
249
- }
250
- },
251
- xl: {
252
- type: Number,
253
- default: undefined
254
- },
255
- xxl: {
256
- type: Number,
257
- default: undefined
258
- }
259
- },
260
- created () {
261
- if ((!this.attr.lazyLoad || this.attr.lazyLoad === 'false') && this.attr.keyName && this.attr.keyName.indexOf('logic@') !== -1) {
262
- this.getData({}, res => {
263
- this.option = res
264
- })
265
- }
266
- },
267
- methods: {
268
- // 懒加载检索方法
269
- fetchFunction (value) {
270
- this.lastFetchId += 1
271
- const fetchId = this.lastFetchId
272
- this.option = []
273
- this.searching = true
274
- this.getData({
275
- word: value
276
- }, res => {
277
- if (fetchId !== this.lastFetchId) {
278
- return
279
- }
280
- this.option = res
281
- this.searching = false
282
- })
283
- },
284
- // 获取数据
285
- getData (value, callback) {
286
- if (value !== '') {
287
- const logicName = this.attr.keyName
288
- const logic = logicName.substring(6)
289
- post('/webmeterapi/' + logic, value).then(res => {
290
- callback(res)
291
- })
292
- }
293
- },
294
- filterOption (input, option) {
295
- if (option.componentOptions.children[0].text) {
296
- return (
297
- option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
298
- )
299
- } else {
300
- return (
301
- option.componentOptions.children[0].child.value.toLowerCase().indexOf(input.toLowerCase()) >= 0
302
- )
303
- }
304
- }
305
- }
306
- }
307
- </script>
1
+ <template>
2
+ <!-- 综合筛选 -->
3
+ <x-form-col
4
+ :xl="xl"
5
+ :xxl="xxl"
6
+ v-if="attr.type === 'select' && attr.model === 'rowIdValue'">
7
+ <a-form-model-item
8
+ :ref="attr.model"
9
+ :label="attr.name"
10
+ :prop="attr.model">
11
+ <a-input :disabled="disabled" v-model="form[attr.model]">
12
+ <a-select
13
+ slot="addonBefore"
14
+ v-model="form['rowIdName']"
15
+ style="width: 100px">
16
+ <a-select-option
17
+ v-for="(item,index) in attr.keys"
18
+ :key="index"
19
+ :value="Object.keys(item)[0]">{{ item[Object.keys(item)[0]] }}
20
+ </a-select-option>
21
+ </a-select>
22
+ </a-input>
23
+ </a-form-model-item>
24
+ </x-form-col>
25
+ <!-- 输入框 -->
26
+ <x-form-col
27
+ :xl="xl"
28
+ :xxl="xxl"
29
+ v-else-if="attr.type === 'input'">
30
+ <a-form-model-item
31
+ :ref="attr.model"
32
+ :label="attr.name"
33
+ :prop="attr.model">
34
+ <a-input :disabled="disabled" v-model="form[attr.model]" :placeholder="attr.placeholder ? attr.placeholder : '请输入'+attr.name.replace(/\s*/g, '')"/>
35
+ </a-form-model-item>
36
+ </x-form-col>
37
+ <!-- 下拉框 -->
38
+ <x-form-col
39
+ :xl="xl"
40
+ :xxl="xxl"
41
+ v-else-if="attr.type === 'select'">
42
+ <a-form-model-item
43
+ :ref="attr.model"
44
+ :label="attr.name"
45
+ :prop="attr.model">
46
+ <a-select
47
+ v-if="!attr.lazyLoad || attr.lazyLoad === 'false'"
48
+ v-model="form[attr.model]"
49
+ :disabled="disabled"
50
+ show-search
51
+ :placeholder="attr.placeholder ? attr.placeholder : '请选择'"
52
+ :filter-option="filterOption"
53
+ >
54
+ <a-select-option
55
+ v-if="mode === '查询'"
56
+ key="999999"
57
+ value="全部">全部
58
+ </a-select-option>
59
+ <template v-if="attr.keys">
60
+ <a-select-option
61
+ v-for="(item,index) in attr.keys"
62
+ :key="index"
63
+ :value="Object.keys(item)[0]">
64
+ {{ item[Object.keys(item)[0]] }}
65
+ </a-select-option>
66
+ </template>
67
+ <template v-else>
68
+ <template v-if="attr.keyName.indexOf('logic@') !== -1">
69
+ <a-select-option
70
+ v-for="(item,index) in option"
71
+ :key="index"
72
+ :value="Object.keys(item)[0]">{{ item[Object.keys(item)[0]] }}
73
+ </a-select-option>
74
+ </template>
75
+ <template v-else>
76
+ <a-select-option
77
+ v-for="item in $appdata.getDictionaryList(attr.keyName)"
78
+ :key="item.value"
79
+ :value="item.value">
80
+ <!-- 徽标(badge) -->
81
+ <x-badge :badge-key="attr.keyName" :value="item.value" :replaceText="item.text"/>
82
+ </a-select-option>
83
+ </template>
84
+ </template>
85
+ </a-select>
86
+ <a-select
87
+ v-else
88
+ show-search
89
+ v-model="form[attr.model]"
90
+ :disabled="disabled"
91
+ @search="fetchFunction"
92
+ :placeholder="attr.placeholder ? attr.placeholder : '搜索' + attr.name"
93
+ :filter-option="filterOption"
94
+ >
95
+ <a-spin v-if="searching" slot="notFoundContent" size="small" />
96
+ <a-select-option
97
+ v-for="(item,index) in option"
98
+ :key="index"
99
+ :value="Object.keys(item)[0]">{{ item[Object.keys(item)[0]] }}
100
+ </a-select-option>
101
+ </a-select>
102
+ </a-form-model-item>
103
+ </x-form-col>
104
+ <!-- TODO 多选框 -->
105
+ <!-- TODO 单选框 -->
106
+ <!-- 日期范围选择器 -->
107
+ <x-form-col
108
+ :xl="xl"
109
+ :xxl="xxl"
110
+ v-else-if="attr.type === 'rangePicker'">
111
+ <a-form-model-item :ref="attr.model" :label="attr.name" :prop="attr.model">
112
+ <a-range-picker :disabled="disabled" :show-time="true" v-model="form[attr.model]" valueFormat="YYYY-MM-DD HH:mm:ss"/>
113
+ </a-form-model-item>
114
+ </x-form-col>
115
+ <!-- 月份选择器 -->
116
+ <x-form-col
117
+ :xl="xl"
118
+ :xxl="xxl"
119
+ v-else-if="attr.type === 'monthPicker'">
120
+ <a-form-model-item :ref="attr.model" :label="attr.name" :prop="attr.model">
121
+ <a-month-picker :disabled="disabled" :show-time="true" v-model="form[attr.model]" valueFormat="YYYY-MM"/>
122
+ </a-form-model-item>
123
+ </x-form-col>
124
+ <!-- 日期选择器 -->
125
+ <x-form-col
126
+ :xl="xl"
127
+ :xxl="xxl"
128
+ v-else-if="attr.type === 'datePicker'">
129
+ <a-form-model-item :ref="attr.model" :label="attr.name" :prop="attr.model">
130
+ <a-date-picker :disabled="disabled" :show-time="true" v-model="form[attr.model]" valueFormat="YYYY-MM-DD"/>
131
+ </a-form-model-item>
132
+ </x-form-col>
133
+ <!-- 级联选择器 -->
134
+ <x-form-col
135
+ :xl="xl"
136
+ :xxl="xxl"
137
+ v-else-if="attr.type === 'cascader'">
138
+ <a-form-model-item :ref="attr.model" :label="attr.name" :prop="attr.model">
139
+ <template v-if="attr.keys">
140
+ <a-dcascader :disabled="disabled" :option="attr.keys" :value="form[attr.model]"/>
141
+ </template>
142
+ <template v-else>
143
+ <a-dcascader :disabled="disabled" :option="option" :value="form[attr.model]"/>
144
+ </template>
145
+ </a-form-model-item>
146
+ </x-form-col>
147
+ <!-- 文本域 -->
148
+ <x-form-col
149
+ :xl="24"
150
+ :xxl="24"
151
+ :xs="24"
152
+ :sm="24"
153
+ :md="24"
154
+ :lg="24"
155
+ v-else-if="attr.type === 'textarea'">
156
+ <a-form-model-item
157
+ :ref="attr.model"
158
+ :label="attr.name"
159
+ :prop="attr.model">
160
+ <a-textarea :rows="4" :disabled="disabled" v-model="form[attr.model]" :placeholder="attr.placeholder ? attr.placeholder : '请输入'+attr.name.replace(/\s*/g, '')"/>
161
+ </a-form-model-item>
162
+ </x-form-col>
163
+ <!-- TODO 文件上传 -->
164
+ <x-form-col
165
+ :xl="24"
166
+ :xxl="24"
167
+ :xs="24"
168
+ :sm="24"
169
+ :md="24"
170
+ :lg="24"
171
+ v-else-if="attr.type === 'file' || attr.type === 'image'">
172
+ <a-form-model-item :ref="attr.model" :label="attr.name" :prop="attr.model">
173
+ <upload :model="attr" @setFiles="setFiles"></upload>
174
+ </a-form-model-item>
175
+ </x-form-col>
176
+ </template>
177
+ <script>
178
+
179
+ import { post } from '@vue2-client/services/api'
180
+ import { debounce } from 'ant-design-vue/lib/vc-table/src/utils'
181
+
182
+ export default {
183
+ name: 'XFormItem',
184
+ data () {
185
+ // 检索去抖
186
+ this.fetchFunction = debounce(this.fetchFunction, 800)
187
+ return {
188
+ option: [],
189
+ // 最后检索版本
190
+ lastFetchId: 0,
191
+ // 检索中
192
+ searching: false
193
+ }
194
+ },
195
+ props: {
196
+ attr: {
197
+ type: Object,
198
+ default: () => {
199
+ return {}
200
+ }
201
+ },
202
+ form: {
203
+ type: Object,
204
+ default: () => {
205
+ return {}
206
+ }
207
+ },
208
+ disabled: {
209
+ type: Boolean,
210
+ default: () => {
211
+ return false
212
+ }
213
+ },
214
+ mode: {
215
+ type: String,
216
+ default: () => {
217
+ return '查询'
218
+ }
219
+ },
220
+ xl: {
221
+ type: Number,
222
+ default: undefined
223
+ },
224
+ xxl: {
225
+ type: Number,
226
+ default: undefined
227
+ }
228
+ },
229
+ created () {
230
+ if ((!this.attr.lazyLoad || this.attr.lazyLoad === 'false') && this.attr.keyName && this.attr.keyName.indexOf('logic@') !== -1) {
231
+ this.getData({}, res => {
232
+ this.option = res
233
+ })
234
+ }
235
+ },
236
+ methods: {
237
+ // 文件框时设置上传组件的值
238
+ setFiles (fileIds) {
239
+ this.form[this.attr.model] = fileIds
240
+ },
241
+ // 懒加载检索方法
242
+ fetchFunction (value) {
243
+ this.lastFetchId += 1
244
+ const fetchId = this.lastFetchId
245
+ this.option = []
246
+ this.searching = true
247
+ this.getData({
248
+ word: value
249
+ }, res => {
250
+ if (fetchId !== this.lastFetchId) {
251
+ return
252
+ }
253
+ this.option = res
254
+ this.searching = false
255
+ })
256
+ },
257
+ // 获取数据
258
+ getData (value, callback) {
259
+ if (value !== '') {
260
+ const logicName = this.attr.keyName
261
+ const logic = logicName.substring(6)
262
+ post('/webmeterapi/' + logic, value).then(res => {
263
+ callback(res)
264
+ })
265
+ }
266
+ },
267
+ filterOption (input, option) {
268
+ if (option.componentOptions.children[0].text) {
269
+ return (
270
+ option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
271
+ )
272
+ } else {
273
+ return (
274
+ option.componentOptions.children[0].child.value.toLowerCase().indexOf(input.toLowerCase()) >= 0
275
+ )
276
+ }
277
+ }
278
+ }
279
+ }
280
+ </script>
@@ -259,7 +259,7 @@ export default {
259
259
  }
260
260
  // 如果是临时表
261
261
  if (this.isTableTemp) {
262
- this.$emit('tempTableModify',res)
262
+ this.$emit('tempTableModify', res)
263
263
  return
264
264
  }
265
265
  if (res.valid) {
@@ -331,7 +331,7 @@ export default {
331
331
  }
332
332
  requestParameters.conditionParams[this.tableColumns[0].dataIndex] = this.selectedRowKeys[0]
333
333
  if (this.isTableTemp) {
334
- this.$emit('tempTableEdit',requestParameters)
334
+ this.$emit('tempTableEdit', requestParameters)
335
335
  return
336
336
  }
337
337
  this.editDataLoading = true
@@ -407,12 +407,12 @@ export default {
407
407
  // 插入临时表数据sql生成
408
408
  insertTempTableData (defineJson) {
409
409
  const tableName = defineJson.tableName
410
- let params = {}
410
+ const params = {}
411
411
  params.define = defineJson.column
412
412
  params.applyId = defineJson.applyId
413
413
  params.stepName = defineJson.stepName
414
414
  params.tableName = tableName
415
- return post (ApplyInstallApi.insertDataToTempTable, {
415
+ return post(ApplyInstallApi.insertDataToTempTable, {
416
416
  tempTableData: params
417
417
  })
418
418
  .then(