vue2-client 1.2.35 → 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 -82
  2. package/CHANGELOG.md +10 -0
  3. package/package.json +1 -1
  4. package/src/base-client/all.js +59 -59
  5. package/src/base-client/components/common/CreateQuery/CreateQuery.vue +1342 -1335
  6. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +752 -752
  7. package/src/base-client/components/common/Upload/Upload.vue +124 -124
  8. package/src/base-client/components/common/Upload/index.js +3 -3
  9. package/src/base-client/components/common/XAddForm/XAddForm.vue +338 -338
  10. package/src/base-client/components/common/XForm/XFormItem.vue +280 -280
  11. package/src/base-client/components/common/XFormTable/XFormTable.vue +484 -484
  12. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsException.vue +57 -57
  13. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsRead.vue +131 -131
  14. package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +532 -532
  15. package/src/config/config.js +2 -0
  16. package/src/config/default/setting.config.js +34 -34
  17. package/src/layouts/AdminLayout.vue +2 -2
  18. package/src/layouts/tabs/TabsView.vue +6 -0
  19. package/src/pages/login/Login.vue +198 -198
  20. package/src/pages/resourceManage/resourceManageMain.vue +0 -1
  21. package/src/pages/system/ticket/index.vue +440 -440
  22. package/src/router/async/config.async.js +26 -26
  23. package/src/router/async/router.map.js +59 -59
  24. package/src/router/index.js +27 -27
  25. package/src/services/api/restTools.js +24 -24
  26. package/src/utils/request.js +198 -198
  27. package/vue.config.js +27 -27
@@ -1,280 +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' || 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>
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>