vue2-client 1.14.91 → 1.14.93

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.14.91",
3
+ "version": "1.14.93",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -1,3 +1,3 @@
1
- import AmapPointRendering from './AmapPointRendering'
2
-
3
- export default AmapPointRendering
1
+ import AmapPointRendering from './AmapPointRendering'
2
+
3
+ export default AmapPointRendering
@@ -1,3 +1,3 @@
1
- import XDetailsView from './XDetailsView'
2
-
3
- export default XDetailsView
1
+ import XDetailsView from './XDetailsView'
2
+
3
+ export default XDetailsView
@@ -1,3 +1,3 @@
1
- import XFormGroupDetails from './XFormGroupDetails'
2
-
3
- export default XFormGroupDetails
1
+ import XFormGroupDetails from './XFormGroupDetails'
2
+
3
+ export default XFormGroupDetails
@@ -1,47 +1,93 @@
1
+ <template>
2
+ <a-card :bordered="false">
3
+ <x-form-table
4
+ title="示例页面"
5
+ :queryParamsName="queryParamsName"
6
+ :fixed-query-form="{
7
+ users_f_handler_id: currUser.id,
8
+ }"
9
+ @action="toDetail">
10
+ <template slot="button">
11
+ <a-button @click="add">
12
+ <a-icon type="plus"/>
13
+ 发起报建
14
+ </a-button>
15
+ </template>
16
+ </x-form-table>
17
+ <a-modal
18
+ v-model="applyAddFlag"
19
+ :footer="null"
20
+ :dialog-style="{ top: '5rem' }"
21
+ :z-index="1001"
22
+ title="发起报建"
23
+ :destroyOnClose="true">
24
+ <x-add-native-form ref="xForm" @onSubmit="applySubmit"/>
25
+ </a-modal>
26
+ <WorkflowDetail ref="workFlow" @success="success" @nextClick="nextClick"></WorkflowDetail>
27
+ </a-card>
28
+ </template>
29
+
1
30
  <script>
2
31
  import WorkflowDetail from '@vue2-client/pages/WorkflowDetail/WorkflowDetail.vue'
32
+ import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable'
33
+ import XAddNativeForm from '@vue2-client/base-client/components/common/XAddNativeForm/XAddNativeForm.vue'
34
+ import { getConfigByName, runLogic } from '@vue2-client/services/api/common'
35
+ import { mapState } from 'vuex'
3
36
 
4
37
  export default {
5
- name: 'WorkFlowDemo',
6
- components: { WorkflowDetail },
7
- mounted () {
8
- this.$refs.workFlow.init({
9
- workflowId: '58'
10
- })
38
+ name: 'Apply',
39
+ components: {
40
+ XFormTable,
41
+ XAddNativeForm,
42
+ WorkflowDetail
43
+ },
44
+ data () {
45
+ return {
46
+ // 查询配置文件名
47
+ queryParamsName: 'applyCRUD',
48
+ // 发起报建弹框控制
49
+ applyAddFlag: false
50
+ }
51
+ },
52
+ computed: {
53
+ ...mapState('account', { currUser: 'user' }),
11
54
  },
12
55
  methods: {
13
- /**
14
- * 流程详情页成功
15
- * @param note 备注信息
16
- * @param form 表单信息
17
- * @param workflowId
18
- */
19
- success ({ note, form, workflowId }) {
20
- console.log('success', note, form, workflowId)
56
+ add () {
57
+ this.applyAddFlag = true
58
+ this.$nextTick(
59
+ () => {
60
+ getConfigByName('addApplyForm', 'af-apply', (res) => {
61
+ this.$refs.xForm.init({
62
+ businessType: '新增',
63
+ title: '发起报建',
64
+ ...res
65
+ })
66
+ })
67
+ }
68
+ )
69
+ },
70
+ applySubmit (formData) {
71
+ runLogic('addApply', formData).then(
72
+ res => {
73
+ this.$message.success('发起报建成功')
74
+ this.applyAddFlag = false
75
+ }
76
+ ).catch(() => {
77
+ this.applyAddFlag = false
78
+ })
21
79
  },
22
- /**
23
- * 流程详情页成功
24
- * @param note 备注信息
25
- * @param form 表单信息
26
- * @param workflowId 工作流id
27
- * @param fromStepId 起ID
28
- * @param toStepId 往ID
29
- * @param successStepId 完成步骤id
30
- * @param successStep 完成步骤名称
31
- * @param fromStep 起步骤名称
32
- * @param toStep 往步骤名称
33
- */
34
- nextClick ({ note, form, workflowId, fromStepId, toStepId, fromStep, toStep, successStepId, successStep }) {
35
- console.log('success', note, form, workflowId, fromStepId, toStepId, fromStep, toStep, successStepId, successStep)
80
+ success () {
81
+ console.log('完工')
82
+ },
83
+ nextClick(data) {
84
+ console.log('提交下一步', data)
85
+ },
86
+ toDetail (record, id) {
87
+ this.$refs.workFlow.init({
88
+ workflowId: record.twf_id
89
+ })
36
90
  }
37
91
  }
38
92
  }
39
93
  </script>
40
-
41
- <template>
42
- <WorkflowDetail ref="workFlow" @success="success" @nextClick="nextClick"></WorkflowDetail>
43
- </template>
44
-
45
- <style scoped lang="less">
46
-
47
- </style>
@@ -27,9 +27,9 @@
27
27
  ref="workFlow"
28
28
  @success="success"
29
29
  @x-form-item-emit-func="handleFormItemEvent"
30
- @address-selected="handleAddressSelected"
31
30
  >
32
31
  </WorkflowDetail>
32
+ <address-select ref="addressSelect" @setAddress="setForm"></address-select>
33
33
  </a-card>
34
34
  </template>
35
35
 
@@ -39,13 +39,15 @@ import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XF
39
39
  import XAddNativeForm from '@vue2-client/base-client/components/common/XAddNativeForm/XAddNativeForm.vue'
40
40
  import { getConfigByName, runLogic } from '@vue2-client/services/api/common'
41
41
  import { mapState } from 'vuex'
42
+ import AddressSelect from '@vue2-client/pages/addressSelect/index.vue'
42
43
 
43
44
  export default {
44
45
  name: 'Apply',
45
46
  components: {
46
47
  XFormTable,
47
48
  XAddNativeForm,
48
- WorkflowDetail
49
+ WorkflowDetail,
50
+ AddressSelect
49
51
  },
50
52
  data () {
51
53
  return {
@@ -94,11 +96,11 @@ export default {
94
96
  handleFormItemEvent (func, data, value) {
95
97
  console.log('打印一下:', func, data, value)
96
98
  if (func === 'selectAddress') {
97
- this.$refs.workFlow.openAddressSelect()
99
+ this.$refs.addressSelect.setFormShow()
98
100
  }
99
101
  },
100
- handleAddressSelected (record) {
101
- this.$refs.workFlow.setAddress({ address: record.f_address })
102
+ setForm (record) {
103
+ this.$refs.workFlow.setFormValue({ address: record.f_address })
102
104
  }
103
105
  }
104
106
  }
@@ -49,7 +49,6 @@
49
49
  @success="success"
50
50
  @nextClick="nextClick"
51
51
  @x-form-item-emit-func="handleFormItemEvent"
52
- @address-selected="handleAddressSelected"
53
52
  class="handle-content"
54
53
  />
55
54
  </template>
@@ -154,7 +153,7 @@ export default {
154
153
  visible: false
155
154
  }
156
155
  },
157
- expose: ['setAddress', 'openAddressSelect'],
156
+ expose: ['setFormValue'],
158
157
  computed: {
159
158
  ...mapState('account', { currUser: 'user' }),
160
159
  ...mapState('setting', ['isMobile'])
@@ -249,15 +248,8 @@ export default {
249
248
  handleFormItemEvent (func, data, value) {
250
249
  this.$emit('x-form-item-emit-func', func, data, value)
251
250
  },
252
- handleAddressSelected (record) {
253
- this.$emit('address-selected', record)
254
- },
255
- // 选择地址弹出框方法
256
- openAddressSelect () {
257
- this.$refs.workflowHandle.$refs.addressSelect.setFormShow()
258
- },
259
251
  // 给地址选择表单项赋值
260
- setAddress (record) {
252
+ setFormValue (record) {
261
253
  this.$refs.workflowHandle.$refs.xAddForm.setForm(record)
262
254
  }
263
255
  }
@@ -209,13 +209,12 @@
209
209
  </a-form-item>
210
210
  </a-form>
211
211
  </a-tab-pane>
212
- <a-tab-pane v-if="canSubmit && !beforeStepActive && showPrevBtn && !workflowState" key="3" tab="工单拆分">
213
- <!-- 分配工单 -->
212
+ <!-- <a-tab-pane v-if="canSubmit && !beforeStepActive && showPrevBtn && !workflowState" key="3" tab="工单拆分">
213
+ &lt;!&ndash; 分配工单 &ndash;&gt;
214
214
  <workflow-list-resolution :workflow-project-id="workflowId" :details="details"></workflow-list-resolution>
215
- </a-tab-pane>
215
+ </a-tab-pane>-->
216
216
  </a-tabs>
217
217
  </template>
218
- <address-select ref="addressSelect" @selAddress="setFormValue"></address-select>
219
218
  </div>
220
219
  </template>
221
220
 
@@ -239,7 +238,6 @@ import * as util from '@vue2-client/utils/util'
239
238
  import { getConfigByNameAsync, runLogic } from '@vue2-client/services/api/common'
240
239
  import XTab from '@vue2-client/base-client/components/common/XTab/XTab.vue'
241
240
  import WorkFlowPreview from './WorkFlowPreview'
242
- import AddressSelect from '@vue2-client/pages/addressSelect/index.vue'
243
241
 
244
242
  export default {
245
243
  name: 'WorkFlowHandle',
@@ -253,40 +251,62 @@ export default {
253
251
  FilePreview,
254
252
  FileItem,
255
253
  ImageItem,
256
- WorkFlowPreview,
257
- AddressSelect
254
+ WorkFlowPreview
258
255
  },
259
256
  computed: {
260
257
  ...mapState('account', { currUser: 'user' }),
261
258
  canSubmit () {
262
259
  // 对于超级管理员直接认为可以提交
263
- if (this.currUser.name === '超级管理员') {
260
+ if (this.currUser.ename === '1') {
264
261
  return true
265
262
  }
266
263
  // currentStepId可能还没初始化,此处拿不到先返回false
267
264
  if (!this.currentStepId) {
268
265
  return false
269
266
  }
270
- const step = this.stepsForChild[this.currentStepId - 1]
271
- // 检查handler是否包含当前用户
272
- if (step && step.handler) {
273
- return step.handler.includes(this.currUser.name)
274
- }
275
- // 检查角色和部门权限
276
- if (step && step.properties && step.properties.chargePerson) {
277
- if (step.properties.chargePerson.personList && step.properties.chargePerson.personList.length > 0) {
267
+ // 如果当前选中节点不是正在进行的节点,则判断viewers权限
268
+ if (this.activeStepId !== this.currentStepId) {
269
+ const activeStep = this.stepsForChild[this.activeStepId - 1]
270
+ const viewers = activeStep?.properties?.otherProperty?.viewers ?? []
271
+ if (viewers.length > 0) {
278
272
  // 使用some方法判断当前人员是否满足任一条件
279
- return step.properties.chargePerson.personList.some(item => {
273
+ return viewers.some(item => {
280
274
  if (item.type === 'role') {
281
275
  // 检查rolestr是否存在并包含指定角色
282
- return this.currUser.rolestr && this.currUser.rolestr.includes(item.name)
276
+ return this.currUser.rolestr && this.currUser.rolestr.split(',').includes(item.name)
283
277
  }
284
278
  if (item.type === 'department') {
285
- // 检查parentname是否存在并包含指定部门
286
- return this.currUser.parentname && this.currUser.parentname.includes(item.name)
279
+ // 检查depname是否存在并包含指定部门
280
+ return this.currUser.depname && this.currUser.deps.includes(item.name)
287
281
  }
288
282
  return false
289
283
  })
284
+ } else {
285
+ return true
286
+ }
287
+ } else {
288
+ const step = this.stepsForChild[this.currentStepId - 1]
289
+ // 检查角色和部门权限
290
+ if (step && step.properties && step.properties.chargePerson) {
291
+ if (step.properties.chargePerson.personList && step.properties.chargePerson.personList.length > 0) {
292
+ // 使用some方法判断当前人员是否满足任一条件
293
+ return step.properties.chargePerson.personList.some(item => {
294
+ if (item.type === 'role') {
295
+ // 检查rolestr是否存在并包含指定角色
296
+ return this.currUser.rolestr && this.currUser.rolestr.split(',').includes(item.name)
297
+ }
298
+ if (item.type === 'department') {
299
+ // 检查parentname是否存在并包含指定部门
300
+ return this.currUser.parentname && this.currUser.parentname.includes(item.name)
301
+ }
302
+ return false
303
+ })
304
+ }
305
+ }
306
+
307
+ // 检查handler是否包含当前用户
308
+ if (step && step.handler) {
309
+ return step.handler.includes(this.currUser.name)
290
310
  }
291
311
  }
292
312
  return false
@@ -479,6 +499,8 @@ export default {
479
499
  .then(res => {
480
500
  res.state = this.stepsForChild[res.id - 1].name
481
501
  this.currentStepId = res.id
502
+ // 获取到当前步骤后复制下一步时间
503
+ this.deadline = this.getDefaultDeadline(this.stepsForChild[this.currentStepId - 1].properties?.otherProperty?.nextNodeInterval)
482
504
  this.currentStep = res
483
505
  this.getDirection()
484
506
  }, err => {
@@ -689,6 +711,7 @@ export default {
689
711
  this.showForm = true
690
712
  this.$nextTick(() => {
691
713
  this.$refs.xAddForm && this.$refs.xAddForm.init({
714
+ ...properties.form,
692
715
  businessType: '修改',
693
716
  formItems: this.stepDefine,
694
717
  layout: properties.form.xAddFormLayout,
@@ -738,6 +761,15 @@ export default {
738
761
  }
739
762
  }
740
763
  },
764
+ // 获取表单字段实际值
765
+ getRealKey (key, isHandleFormKey) {
766
+ if (key === 'selected_id') return key
767
+ if (isHandleFormKey) {
768
+ return key.substring(key.indexOf('_') + 1)
769
+ } else {
770
+ return key
771
+ }
772
+ },
741
773
  // 加载完成
742
774
  resolveStep () {
743
775
  // 获取当前步骤的按钮组配置
@@ -753,6 +785,7 @@ export default {
753
785
  async activeStep (stepId) {
754
786
  // 开启加载
755
787
  this.loadingHistory = true
788
+ this.activeStepId = stepId
756
789
  // 获取激活节点的步骤名
757
790
  this.activeStepName = this.getStepNameByStepId(stepId)
758
791
  // 清空回显数据
@@ -767,10 +800,13 @@ export default {
767
800
  formCompletedDataPreview = JSON.parse(JSON.stringify(this.formCompletedData))
768
801
  // 使用字段定义中内容,将回显数据的列名,替换为定义的中文名
769
802
  const formData = formCompletedDataPreview.data
803
+ const isKeyHandle = this.stepsDefine[stepId - 1]?.properties?.form?.isKeyHandle || false
770
804
  for (const key in formData) {
771
805
  for (let i = 0; i < this.targetStepDefine.length; i++) {
772
806
  const stepDefine = this.targetStepDefine[i]
773
- if (key === stepDefine.model) {
807
+ // 兼容下旧代码,这里是否处理key根据表单配置中的isKeyHandle来决定,也有另一种情况如果处理完的key在表单中已经重复会将未处理的key直接存进去(新增表单的逻辑)
808
+ // 所以两种都判断下命中任意一个都算
809
+ if (key === this.getRealKey(stepDefine.model, isKeyHandle) || key === stepDefine.model) {
774
810
  if (!['FilesId', 'Images'].includes(key)) {
775
811
  // 读取字典值
776
812
  if (stepDefine.formType === 'select' && stepDefine.selectType === 'key') {
@@ -843,7 +879,7 @@ export default {
843
879
  // return false
844
880
  // }
845
881
  const stepHandler = this.getStepHandler()
846
- if (!stepHandler) {
882
+ if (this.needSelectPerson && !this.checkedChargePerson) {
847
883
  this.$message.error('请设置下一环节处理人')
848
884
  return false
849
885
  }
@@ -901,9 +937,9 @@ export default {
901
937
  })
902
938
  },
903
939
  // 获取默认截止时间
904
- getDefaultDeadline () {
940
+ getDefaultDeadline (day = 1) {
905
941
  const date = new Date()
906
- date.setDate(date.getDate() + 1)
942
+ date.setDate(date.getDate() + day)
907
943
  date.setHours(date.getHours() + 2)
908
944
  return formatDate(date, 'yyyy-MM-dd hh:mm')
909
945
  },
@@ -982,7 +1018,7 @@ export default {
982
1018
  if (personItem.type === 'role') {
983
1019
  // 根据角色获取人员
984
1020
  filteredUsers = allUser.filter(user =>
985
- user.rolestr && user.rolestr.includes(personItem.name)
1021
+ user.rolestr && user.rolestr.split(',').includes(personItem.name)
986
1022
  ).map(user => {
987
1023
  return { label: user.label, value: user.value }
988
1024
  })
@@ -1042,9 +1078,6 @@ export default {
1042
1078
  },
1043
1079
  formItemEmitFunc (func, data, value) {
1044
1080
  this.$emit('x-form-item-emit-func', func, data, value)
1045
- },
1046
- setFormValue (record) {
1047
- this.$emit('address-selected', record)
1048
1081
  }
1049
1082
  },
1050
1083
  watch: {}
@@ -1,24 +1,24 @@
1
- <template>
2
- <!-- 测试界面——测试地址选择新增组件-->
3
- <div>
4
- <a-button @click="open">打开选择地址弹窗</a-button>
5
- <address-select :addressShow="showDialog"/>
6
- </div>
7
- </template>
8
-
9
- <script>
10
- import AddressSelect from '@/pages/addressSelect'
11
-
12
- export default {
13
- components: { AddressSelect },
14
- data: () => ({
15
- showDialog: false
16
- }),
17
- methods: {
18
- open () {
19
- console.log('打开选择地址弹窗')
20
- this.showDialog = true
21
- }
22
- }
23
- }
24
- </script>
1
+ <template>
2
+ <!-- 测试界面——测试地址选择新增组件-->
3
+ <div>
4
+ <a-button @click="open">打开选择地址弹窗</a-button>
5
+ <address-select :addressShow="showDialog"/>
6
+ </div>
7
+ </template>
8
+
9
+ <script>
10
+ import AddressSelect from '@/pages/addressSelect'
11
+
12
+ export default {
13
+ components: { AddressSelect },
14
+ data: () => ({
15
+ showDialog: false
16
+ }),
17
+ methods: {
18
+ open () {
19
+ console.log('打开选择地址弹窗')
20
+ this.showDialog = true
21
+ }
22
+ }
23
+ }
24
+ </script>
@@ -60,7 +60,7 @@ export default {
60
60
  f_address_id: record.tua_id
61
61
  }
62
62
  console.log('选择了地址是', form)
63
- this.$emit('selAddress', form)
63
+ this.$emit('setAddress', form)
64
64
  this.selectAddressVisible = false
65
65
  },
66
66
  addAddress () {
@@ -55,9 +55,6 @@ routerResource.newDynamicStatistics = () => import('@vue2-client/pages/NewDynami
55
55
  routerResource.example = {
56
56
  path: 'example',
57
57
  name: '示例主页面',
58
- // component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo2.vue'),
59
- // component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo.vue'),
60
- // component: () => import('@vue2-client/pages/addressSelect/addressDemo.vue'),
61
58
  // component: () => import('@vue2-client/base-client/components/common/XDescriptions/demo.vue'),
62
59
  // component: () => import('@vue2-client/base-client/components/common/XAddNativeForm/demo.vue'),
63
60
  // component: () => import('@vue2-client/base-client/components/common/XFormGroup/demo.vue'),
@@ -68,10 +65,9 @@ routerResource.example = {
68
65
  // component: () => import('@vue2-client/base-client/components/common/XRate/demo.vue'),
69
66
  // component: () => import('@vue2-client/base-client/components/common/XForm/demo.vue'),
70
67
  // component: () => import('@vue2-client/base-client/components/his/XTimeSelect/XTimeSelectDemo.vue'),
71
- // component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo.vue'),
72
- // component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo.vue'),
73
- component: () => import('@vue2-client/pages/XPageViewExample/index.vue'),
74
- // component: () => import('@vue2-client/base-client/components/common/XButtons/XButtonDemo.vue'),
68
+ component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo.vue'),
69
+ // component: () => import('@vue2-client/base-client/components/common/XConversation/XConversationDemo.vue'),
70
+ // component: () => import('@vue2-client/base-client/components/common/XButtons/XButtonexampleDemo.vue'),
75
71
  // component: () => import('@vue2-client/base-client/components/common/XLabelSelect/XLabelSelectDemo.vue'),
76
72
  // component: () => import('@vue2-client/base-client/components/common/XCheckList/XCheckList.vue'),
77
73
  // component: () => import('@vue2-client/base-client/components/common/XPrint/Demo.vue'),
package/vue.config.js CHANGED
@@ -11,12 +11,12 @@ const productionGzipExtensions = ['js', 'css']
11
11
  const isProd = process.env.NODE_ENV === 'production'
12
12
 
13
13
  // v4 产品演示
14
- const v3Server = 'http://aote-office.8866.org:31567'
14
+ const v3Server = 'http://192.168.50.67:31567'
15
15
  // const gateway = 'http://192.168.50.67:31467'
16
16
  // const testUpload = 'http://123.60.214.109:8406'
17
17
  const OSSServerDev = 'http://192.168.50.67:30351'
18
18
  // const revenue = 'http://aote-office.8866.org:31567'
19
- const revenue = 'http://aote-office.8866.org:31567'
19
+ const revenue = 'http://192.168.50.67:31567'
20
20
  // const OSSServerProd = 'http://192.168.50.67:31351'
21
21
  // const testUploadLocal = 'http://127.0.0.1:9001'
22
22
  // v3 铜川