vue2-client 1.2.1 → 1.2.2

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/docs/notice.md CHANGED
@@ -2,9 +2,7 @@
2
2
  ## 引入各种文件时,必须写绝对路径, 不允许写相对路径
3
3
  ```js
4
4
  // 引自己项目时文件时, @ 表示自己项目的src目录
5
- import('@/pages/safeguard/list/search/UserFiles')
6
- // 引入vue2-client项目文件时, @vue2-client: 表示@vue2-client下的src目录
7
- import { post } from '@vue2-client/services/api/restTools'
5
+ import('@vue2-client/pages/system/queryParams')
8
6
  ```
9
7
  ## 编写vue文件的样式时, 必须使用less, 样式必须在最外层添加当前页面html的id, id与vue文件名相同
10
8
  ```vue
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
Binary file
@@ -229,18 +229,9 @@
229
229
  <a-col :span="8">
230
230
  <a-form-model-item label="表单查询方式" prop="queryType" v-if="dataMode.queryForm && dataMode.sqlQueryCondition">
231
231
  <a-select v-model="item.queryType" placeholder="表单查询方式,可选">
232
- <a-select-option key="=">相等(=)</a-select-option>
233
- <a-select-option key="!=">不相等(!=)</a-select-option>
234
- <a-select-option key="LIKE">全模糊(like)</a-select-option>
235
- <a-select-option key="LEFT_LIKE">左模糊(left like)</a-select-option>
236
- <a-select-option key="RIGHT_LIKE">右模糊(right like)</a-select-option>
237
- <a-select-option key=">">大于(>)</a-select-option>
238
- <a-select-option key=">=">大于等于(>=)</a-select-option>
239
- <a-select-option key="<">小于(<)</a-select-option>
240
- <a-select-option key="<=">小于等于(<=)</a-select-option>
241
- <a-select-option key="IN">包含(in)</a-select-option>
242
- <a-select-option key="NOT_IN">不包含(not in)</a-select-option>
243
- <a-select-option key="BETWEEN">之间(between)</a-select-option>
232
+ <template v-for="queryTypeItem in queryTypeV">
233
+ <a-select-option :key="queryTypeItem.key">{{ queryTypeItem.label }}</a-select-option>
234
+ </template>
244
235
  </a-select>
245
236
  </a-form-model-item>
246
237
  </a-col>
@@ -601,6 +592,7 @@ import XFormItem from '@vue2-client/base-client/components/common/XForm/XFormIte
601
592
  import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable'
602
593
  import JsonViewer from 'vue-json-viewer'
603
594
  import FileSaver from 'file-saver'
595
+ import { queryType } from '@/config/CreateQueryConfig'
604
596
  import { mapState } from 'vuex'
605
597
  import { post } from '@vue2-client/services/api/restTools'
606
598
  import { commonApi } from '@vue2-client/services/api/common'
@@ -690,6 +682,12 @@ export default {
690
682
  },
691
683
  computed: {
692
684
  ...mapState('setting', ['isMobile']),
685
+ queryTypeV () {
686
+ if (this.item.formType) {
687
+ return queryType.filter(item => item.match.includes(this.item.formType))
688
+ }
689
+ return queryType
690
+ },
693
691
  conditionJoinArray: function () {
694
692
  const result = []
695
693
  for (const item in this.form.joinArray) {
@@ -283,7 +283,9 @@ export default {
283
283
  },
284
284
  // 刷新加载表格数据
285
285
  loadData (requestParameters, callback) {
286
- callback(query(requestParameters))
286
+ const result = query(requestParameters)
287
+ this.$emit('afterQuery', result)
288
+ callback(result)
287
289
  },
288
290
  // 详情按钮事件
289
291
  action (record, id) {
@@ -47,7 +47,7 @@ export default {
47
47
  | @action | 表格详情列的单击事件 | event | - |
48
48
  | @afterSubmit | 增删改提交后的回调方法 | event | - |
49
49
  | @afterSearchSubmit | 查询提交后的回调方法 | event | - |
50
-
50
+ | @afterQuery | 表格查询后的回调方法 | event | - |
51
51
  ## 例子1
52
52
  ----
53
53
  (基础使用)
@@ -153,16 +153,10 @@ export default {
153
153
  // 7日新增完成数
154
154
  finishLastWeekCount: 0,
155
155
  // 控制订单完成比例颜色
156
- finishRatioColor: '',
157
- // 部门名字典
158
- departmentDictionary: [],
159
- // 模块名字典
160
- modelDictionary: []
156
+ finishRatioColor: ''
161
157
  }
162
158
  },
163
159
  mounted () {
164
- this.getDepartmentDictionary()
165
- this.getModelDictionary()
166
160
  this.loadConfirmCount()
167
161
  this.loadFinishCount()
168
162
  this.initView()
@@ -199,9 +193,14 @@ export default {
199
193
  this.finishRatioColor = this.getFinishedRatioColor(this.details.finished_ticket_ratio)
200
194
  // 字典值解析
201
195
  const departmentValue = this.details.department
202
- this.details.department = this.resolveDepartmentDictionary(departmentValue)
196
+ this.details.department = this.$appdata.getDictionaryList('departmentMap')[departmentValue].label
203
197
  const modelInChargeValue = this.details.model_in_charge
204
- this.details.model_in_charge = this.resolveDepartmentDictionary(modelInChargeValue)
198
+ const modelDictionary = this.$appdata.getDictionaryList('serviceModuleType')
199
+ for (let i = 0; i < modelDictionary.length; i++) {
200
+ if (modelInChargeValue === modelDictionary[i].value) {
201
+ this.details.model_in_charge = this.$appdata.getDictionaryList('serviceModuleType')[i].label
202
+ }
203
+ }
205
204
  this.finishedRatioLoadStatus = 'success'
206
205
  this.loadTicketDetails = false
207
206
  }, err => {
@@ -209,40 +208,6 @@ export default {
209
208
  console.error(err)
210
209
  })
211
210
  },
212
- // 获取部门名字典
213
- getDepartmentDictionary () {
214
- return post(EmployeeDetailsViewApi.getDepartmentDictionary)
215
- .then(res => {
216
- this.departmentDictionary = res
217
- }, err => {
218
- console.log(err)
219
- })
220
- },
221
- // 解析部门名字典
222
- resolveDepartmentDictionary (key) {
223
- for (let i = 0; i < this.departmentDictionary.length; i++) {
224
- if (this.departmentDictionary[i].value == key) {
225
- return this.departmentDictionary[i].name
226
- }
227
- }
228
- },
229
- // 获取模块名字典
230
- getModelDictionary () {
231
- return post(EmployeeDetailsViewApi.getModelDictionary)
232
- .then(res => {
233
- this.modelDictionary = res
234
- }, err => {
235
- console.log(err)
236
- })
237
- },
238
- // 解析模块名字典
239
- resolveModelDictionary (key) {
240
- for (let i = 0; i < this.modelDictionary.length; i++) {
241
- if (this.modelDictionary[i].value == key) {
242
- return this.modelDictionary[i].name
243
- }
244
- }
245
- },
246
211
  // 获取应答订单数量
247
212
  loadConfirmCount () {
248
213
  this.confirmSumWeekly = []