@zscreate/zhxy-app-component 1.0.273 → 1.0.275

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.
@@ -0,0 +1,15 @@
1
+ <script setup>
2
+
3
+ </script>
4
+
5
+ <template>
6
+ <view
7
+ class="uni-date__icon-clear clear-btn"
8
+ @click.stop="clear">
9
+
10
+ </view>
11
+ </template>
12
+
13
+ <style scoped lang="scss">
14
+
15
+ </style>
@@ -1,128 +1,128 @@
1
- <script>
2
- import FullModal from "../../fullModal/fullModal.vue";
3
-
4
- export default {
5
- name: "responsibility",
6
- props: {
7
- value: {
8
- type: String,
9
- default: ''
10
- },
11
- widget: {
12
- type: Object,
13
- default: () => ({})
14
- },
15
- },
16
- components: {FullModal},
17
- data() {
18
- return {
19
- countDown: 0,
20
- force: false,
21
- clearTimeout: null,
22
- dataModel: false,
23
- isShow: false,
24
- }
25
- },
26
- watch: {
27
- value: {
28
- handler(val) {
29
- if (!val) return this.dataModel = false
30
- this.dataModel = true
31
- },
32
- immediate: true
33
- },
34
- dataModel(val) {
35
- this.$emit('input', val ? true : '')
36
- this.$emit('change', val ? true: '')
37
- },
38
- },
39
- methods: {
40
- handleClick() {
41
- if (this.widget.options.disabled) {
42
- this.isShow = true
43
- return
44
- }
45
- this.isShow = true
46
- this.countDown = 0
47
- clearInterval(this.clearTimeout)
48
- if (this.widget.options.force) {
49
- this.countDown = this.widget.options.countDown
50
- this.clearTimeout = setInterval(() => {
51
- if (this.countDown < 0) {
52
- clearInterval(this.clearTimeout)
53
- }
54
- this.countDown -= 1
55
- }, 1000)
56
- }
57
- },
58
- confirm() {
59
- if (this.countDown <= 0) {
60
- this.dataModel = true
61
- this.isShow = false
62
- }
63
- },
64
- cancel() {
65
- this.isShow = false
66
- this.dataModel = false
67
- clearInterval(this.clearTimeout)
68
- },
69
- handleCheck() {
70
- const { disabled, force} = this.widget.options
71
- if (disabled) return
72
- if (force && !disabled) {
73
- if (this.dataModel) return this.dataModel = false
74
- return this.handleClick()
75
- }
76
- this.dataModel = !this.dataModel
77
- },
78
- change(e) {
79
- console.log(e)
80
- },
81
- disabledScroll() {
82
- return
83
- }
84
- }
85
- }
86
- </script>
87
-
88
- <template>
89
- <view>
90
- <full-modal v-model="isShow">
91
- <view style="height: 100%; background-color: #fff" @touchmove.stop.prevent="disabledScroll">
92
- <scroll-view scroll-y="true" style="height: calc(100% - 100rpx); " >
93
- <view style="padding: 20rpx 40rpx;">
94
- <rich-text :nodes="widget.options.content" style="text-align: left"></rich-text>
95
- </view>
96
- <view v-if="!widget.options.disabled" style="display: flex; padding: 20rpx; margin-bottom: 20rpx; justify-content: center">
97
- <button @click="confirm" type="primary" style="margin-right: 10px; border-radius: 10rpx; padding: 0 20px; height: 60rpx; line-height: 60rpx; font-size: 26rpx" :disabled="widget.options.force && countDown > 0">我同意 <text v-if="widget.options.force && countDown > 0">({{ countDown }}s)</text></button>
98
- <button style="height: 60rpx; line-height: 60rpx; font-size: 26rpx; border-radius: 10rpx; color: #333" @click="cancel">不同意</button>
99
- </view>
100
- <view v-else style="display: flex; justify-content: center; align-items: center">
101
- <button @click="isShow = false" type="primary" style="margin-bottom: 20px; border-radius: 10rpx; padding: 0 20px; height: 60rpx; line-height: 60rpx; font-size: 26rpx; " >关闭</button>
102
- </view>
103
- </scroll-view>
104
- </view>
105
- </full-modal>
106
- <view class="responsibility_check" >
107
- <view @click.stop="handleCheck">
108
- <label>
109
- <checkbox :disabled="widget.options.disabled" :readonly="widget.options.disabled" v-if="!isShow" :checked="dataModel" color="#007AFF" style="transform: scale(0.8,0.8);"/>
110
- </label>
111
- </view>
112
- <view class="option-font-size" @click.stop="handleClick">{{ widget.options.title }}</view>
113
-
114
- </view>
115
- </view>
116
-
117
- </template>
118
-
119
- <style lang="less">
120
- .responsibility_check {
121
- display: flex;
122
- align-items: center;
123
- /deep/ .uni-checkbox-input {
124
- width: 18px;
125
- height: 18px;
126
- }
127
- }
1
+ <script>
2
+ import FullModal from "../../fullModal/fullModal.vue";
3
+
4
+ export default {
5
+ name: "responsibility",
6
+ props: {
7
+ value: {
8
+ type: String,
9
+ default: ''
10
+ },
11
+ widget: {
12
+ type: Object,
13
+ default: () => ({})
14
+ },
15
+ },
16
+ components: {FullModal},
17
+ data() {
18
+ return {
19
+ countDown: 0,
20
+ force: false,
21
+ clearTimeout: null,
22
+ dataModel: false,
23
+ isShow: false,
24
+ }
25
+ },
26
+ watch: {
27
+ value: {
28
+ handler(val) {
29
+ if (!val) return this.dataModel = false
30
+ this.dataModel = true
31
+ },
32
+ immediate: true
33
+ },
34
+ dataModel(val) {
35
+ this.$emit('input', val ? true : '')
36
+ this.$emit('change', val ? true: '')
37
+ },
38
+ },
39
+ methods: {
40
+ handleClick() {
41
+ if (this.widget.options.disabled) {
42
+ this.isShow = true
43
+ return
44
+ }
45
+ this.isShow = true
46
+ this.countDown = 0
47
+ clearInterval(this.clearTimeout)
48
+ if (this.widget.options.force) {
49
+ this.countDown = this.widget.options.countDown
50
+ this.clearTimeout = setInterval(() => {
51
+ if (this.countDown < 0) {
52
+ clearInterval(this.clearTimeout)
53
+ }
54
+ this.countDown -= 1
55
+ }, 1000)
56
+ }
57
+ },
58
+ confirm() {
59
+ if (this.countDown <= 0) {
60
+ this.dataModel = true
61
+ this.isShow = false
62
+ }
63
+ },
64
+ cancel() {
65
+ this.isShow = false
66
+ this.dataModel = false
67
+ clearInterval(this.clearTimeout)
68
+ },
69
+ handleCheck() {
70
+ const { disabled, force} = this.widget.options
71
+ if (disabled) return
72
+ if (force && !disabled) {
73
+ if (this.dataModel) return this.dataModel = false
74
+ return this.handleClick()
75
+ }
76
+ this.dataModel = !this.dataModel
77
+ },
78
+ change(e) {
79
+ console.log(e)
80
+ },
81
+ disabledScroll() {
82
+ return
83
+ }
84
+ }
85
+ }
86
+ </script>
87
+
88
+ <template>
89
+ <view>
90
+ <full-modal v-model="isShow">
91
+ <view style="height: 100%; background-color: #fff" @touchmove.stop.prevent="disabledScroll">
92
+ <scroll-view scroll-y="true" style="height: calc(100% - 100rpx); " >
93
+ <view style="padding: 20rpx 40rpx;">
94
+ <rich-text :nodes="widget.options.content" style="text-align: left"></rich-text>
95
+ </view>
96
+ <view v-if="!widget.options.disabled" style="display: flex; padding: 20rpx; margin-bottom: 20rpx; justify-content: center">
97
+ <button @click="confirm" type="primary" style="margin-right: 10px; border-radius: 10rpx; padding: 0 20px; height: 60rpx; line-height: 60rpx; font-size: 26rpx" :disabled="widget.options.force && countDown > 0">我同意 <text v-if="widget.options.force && countDown > 0">({{ countDown }}s)</text></button>
98
+ <button style="height: 60rpx; line-height: 60rpx; font-size: 26rpx; border-radius: 10rpx; color: #333" @click="cancel">不同意</button>
99
+ </view>
100
+ <view v-else style="display: flex; justify-content: center; align-items: center">
101
+ <button @click="isShow = false" type="primary" style="margin-bottom: 20px; border-radius: 10rpx; padding: 0 20px; height: 60rpx; line-height: 60rpx; font-size: 26rpx; " >关闭</button>
102
+ </view>
103
+ </scroll-view>
104
+ </view>
105
+ </full-modal>
106
+ <view class="responsibility_check" >
107
+ <view @click.stop="handleCheck">
108
+ <label>
109
+ <checkbox :disabled="widget.options.disabled" :readonly="widget.options.disabled" v-if="!isShow" :checked="dataModel" color="#007AFF" style="transform: scale(0.8,0.8);"/>
110
+ </label>
111
+ </view>
112
+ <view class="option-font-size" @click.stop="handleClick">{{ widget.options.title }}</view>
113
+
114
+ </view>
115
+ </view>
116
+
117
+ </template>
118
+
119
+ <style lang="less">
120
+ .responsibility_check {
121
+ display: flex;
122
+ align-items: center;
123
+ /deep/ .uni-checkbox-input {
124
+ width: 18px;
125
+ height: 18px;
126
+ }
127
+ }
128
128
  </style>
@@ -183,8 +183,8 @@
183
183
  /> -->
184
184
 
185
185
  <view class="evan-form-item-container__main--body">
186
- <uni-datetime-picker ref="datetime_picker" @change="dateChange" @click.native="isClickByUser = true" :type="widget.options.type"
187
- :format="widget.options.format" :clearIcon="!widget.options.disabled && widget.options.clearable"
186
+ <uni-datetime-picker ref="datetime_picker" @change="dateChange" :hide-second="!widget.options.format.includes(':ss')" @click.native="isClickByUser = true" :type="widget.options.type"
187
+ :format="formatTime()" :clearIcon="!widget.options.disabled && widget.options.clearable"
188
188
  v-model="dataModel" @maskClick="maskClick" :border="false" :disabled="widget.options.disabled">
189
189
  <view class="option-font-size">
190
190
  {{ dataModel | filterDataModel(widget) }}
@@ -849,6 +849,16 @@ export default {
849
849
  this.clearAllLinkageSelect(this.widget.options?.linkage)
850
850
  }
851
851
  },
852
+ formatTime() {
853
+ let format = this.widget.options.format
854
+ const dateTimeStr = "2023-06-28 01:01:01"
855
+ const momentObj = moment(dateTimeStr, String(format).trim())
856
+ if (momentObj.isSame(momentObj.clone().startOf('day'))) {
857
+ return this.widget.options.format
858
+ } else {
859
+ return 'YYYY-MM-DD HH:mm:ss'
860
+ }
861
+ },
852
862
  clearAllLinkageSelect(linkage) {
853
863
  linkage?.forEach(link_model => {
854
864
  uni.$emit(link_model)
@@ -1956,6 +1966,14 @@ export default {
1956
1966
  this.widget.key = v
1957
1967
  this.$emit('upDateWidget', this.widget)
1958
1968
  } else if (this.widget.type === 'date') {
1969
+ if (this.widget.options.type !== 'range' && v) {
1970
+ try {
1971
+ this.dataModel = v = moment(v).format(this.widget.options.format)
1972
+ } catch (e) {
1973
+
1974
+ }
1975
+ }
1976
+
1959
1977
  if (this.widget.options.type === 'range' && !Array.isArray(v)) {
1960
1978
  this.dataModel = v = []
1961
1979
  }
@@ -55,7 +55,7 @@
55
55
  <view v-else-if="item.type === 'grid-lay-out'" v-show="item.options.canView" class="form_layout">
56
56
  <view v-for="(colItem, colIndex) in item.columns" :key="colIndex" class="form-item-container ">
57
57
  <view v-for="(col, itemIndex) in colItem.list" :key="itemIndex" v-show="col.options.canView">
58
- <template v-if="col.type == 'hnkj-verify' && item.options.canView">
58
+ <template v-if="['hnkj-confirm', 'hnkj-verify'].includes(col.type) && item.options.canView">
59
59
  <view class="verify">
60
60
  <view class="verify-step">
61
61
  <text v-if="col.name" class="title-block"></text>
@@ -120,7 +120,7 @@
120
120
  </view>
121
121
  </view>
122
122
 
123
- <template v-else-if="['verify', 'hnkj-verify'].includes(item.type) && item.options.canView">
123
+ <template v-else-if="['verify', 'hnkj-verify', 'hnkj-confirm'].includes(item.type) && item.options.canView">
124
124
 
125
125
  <view class="verify">
126
126
  <view class="verify-step">
@@ -149,12 +149,19 @@
149
149
  </view>
150
150
  <view class="verify-cot" :style="{position:item.model === verifyNode ? 'initial' : 'relative'}">
151
151
  <m-textarea
152
+ v-if="models[item.model]"
152
153
  :max-length="item.options.commentsLength"
153
154
  show-word-limit
154
155
  :value="models[item.model].comments"
155
- :disabled="item.model !== verifyNode" :placeholder="item.options.placeholder"
156
+ :disabled="warpVerifyDisable(item)" :placeholder="item.options.placeholder"
156
157
  @change="val => handlerText(val, item.model)">
157
158
  </m-textarea>
159
+ <m-textarea
160
+ v-else
161
+ disabled
162
+ :placeholder="item.options.placeholder"
163
+ >
164
+ </m-textarea>
158
165
  </view>
159
166
  <!-- #ifdef HBSF-MODE -->
160
167
  <view style="display: flex;align-items: center;background-color: #fff;padding: 20rpx 30rpx;" v-if="item.model === verifyNode">
@@ -166,7 +173,7 @@
166
173
  </view>
167
174
  </view>
168
175
  <!-- #endif -->
169
- <view v-if="item.model == verifyNode" class="verify-cot">
176
+ <view v-if="!warpVerifyDisable(item)" class="verify-cot">
170
177
  <view class="verify-title">{{item.options.operation}}</view>
171
178
  <view style="width:200rpx;">
172
179
  <u-input id="suggestSelect" :border="false" type="select" :select-open="selectShow"
@@ -179,17 +186,17 @@
179
186
  </picker> -->
180
187
  </view>
181
188
  </view>
182
- <view v-if="item.model !== verifyNode" class="verify-cot">
189
+ <view v-if="warpVerifyDisable(item)" class="verify-cot">
183
190
  <view class="verify-title">{{item.options.operation}}</view>
184
- <view>{{models[item.model].operation}}</view>
191
+ <view v-if="models[item.model]">{{models[item.model].operationShow || models[item.model].operation}}</view>
185
192
  </view>
186
193
  <view class="verify-cot">
187
194
  <view class="verify-title">{{ item.options.operator }}</view>
188
- <view>{{ models[item.model].operator }}</view>
195
+ <view v-if="models[item.model]">{{ models[item.model].operator }}</view>
189
196
  </view>
190
197
  <view class="verify-cot">
191
198
  <view class="verify-title">{{ item.options.operationTime }}</view>
192
- <view>{{ models[item.model].operationTime }}</view>
199
+ <view v-if="models[item.model]">{{ models[item.model].operationTime }}</view>
193
200
  </view>
194
201
  </view>
195
202
  </template>
@@ -222,10 +229,10 @@ import evanForm from "../evan-form/evan-form";
222
229
  import mTextarea from "../m-textarea/m-textarea";
223
230
  import packageJson from '../../package.json'
224
231
  import { run } from "../../utils/formula_run"
232
+ import moment from "../../utils/moment"
225
233
  import {intersection, isEqual, isEqualWith, reduce, cloneDeep} from "lodash";
226
- import {getRecursionWidget} from "../../utils/util";
234
+ import {getRecursionWidget, cacheHttp} from "../../utils/util";
227
235
  console.log('zhxy-app-component: ', packageJson.version)
228
-
229
236
  function timeout(ms) {
230
237
  return new Promise(resolve => {
231
238
  setTimeout(() => {
@@ -266,7 +273,7 @@ export default {
266
273
 
267
274
  },
268
275
  data: {},
269
- userSignature: undefined,
276
+ userSignature: cacheHttp.get('workhall/userseal/queryById'),
270
277
  // dataObj:dataObj,
271
278
  isScroll: true,
272
279
  tableRowsShow: {},
@@ -317,7 +324,7 @@ export default {
317
324
  verifyNode: {
318
325
  handler(val) {
319
326
  if (val) {
320
- this.userSignature = this.$u.get('workhall/userseal/queryById')
327
+ // this.userSignature = this.$u.get('workhall/userseal/queryById')
321
328
  }
322
329
  },
323
330
  immediate: true
@@ -405,6 +412,10 @@ export default {
405
412
  // this.initPo();
406
413
  },
407
414
  methods: {
415
+ warpVerifyDisable(widget) {
416
+ if (widget.options.isConfirmComponent) return widget.options.disabled
417
+ return widget.model !== this.verifyNode
418
+ },
408
419
  m_isCorrectAudit() {
409
420
  return Number(this.isCorrect) === 1 && globalThis._CONFIG.JCTJBT
410
421
  },
@@ -475,8 +486,20 @@ export default {
475
486
  },
476
487
  fillVerifySignSeal(widget) {
477
488
  const { model, options, type } = widget
489
+ if (options.isConfirmComponent) {
490
+ return this.userSignature.then(res => {
491
+ if (res.success) {
492
+ const { userSign } = res?.result || {}
493
+ if (userSign) {
494
+ this.models[model].userSign = userSign
495
+ }
496
+ }
497
+ }).finally(() => {
498
+ this.models[model].loadingSign = false
499
+ })
500
+ return
501
+ }
478
502
  if (type === 'hnkj-verify') {
479
-
480
503
  const select = this.selectList.find(item => item.label === this.suggestType)
481
504
  const { enableSign , enableSeal } = options
482
505
  if (select.description === 'TIJIAO') {
@@ -943,6 +966,7 @@ export default {
943
966
  this.generateModle(item.list);
944
967
  });
945
968
  } else {
969
+
946
970
  if (
947
971
  this.value &&
948
972
  Object.keys(this.value).indexOf(genList[i].model) >= 0
@@ -962,10 +986,45 @@ export default {
962
986
  this.generateTableData(genList[i]); //生成tableModel
963
987
  //设置rules
964
988
  }
989
+ if (genList[i].type === "hnkj-confirm") {
990
+ const dictName = genList[i].options.dictName
991
+ if (dictName) cacheHttp.get(`/sys/dict/getDictItems/${dictName}`).then(res => {
992
+ if (res.success) {
993
+ this.selectList = res.result?.map(item => ({
994
+ label: item.title,
995
+ value: item.value,
996
+ description: item.value
997
+ }))
998
+ const operation = this.models[genList[i].model].operation
999
+ this.$set(this.models[genList[i].model], 'operationShow', this.selectList.find(item => item.value === operation)?.label)
1000
+ }
1001
+ })
1002
+ }
965
1003
  } else {
1004
+
966
1005
  /**审核**/
967
1006
  if (genList[i].type === "verify") {
968
1007
  this.models[genList[i].model] = genList[i].operationColumns;
1008
+ } else if (genList[i].type === "hnkj-confirm") {
1009
+ if (genList[i].options.isConfirmComponent && !this.warpVerifyDisable(genList[i])) {
1010
+ const dictName = genList[i].options.dictName
1011
+ if (dictName) cacheHttp.get( `/sys/dict/getDictItems/${dictName}`).then( res => {
1012
+ if (res.success) {
1013
+ this.selectList = res.result?.map(item => ({ label: item.title, value: item.value, description: item.value}))
1014
+ }
1015
+ })
1016
+ const userInfo = uni.getStorageSync('userinfo')
1017
+ this.$set(
1018
+ this.models,
1019
+ genList[i].model,
1020
+ {
1021
+ comments: '',
1022
+ operator: userInfo.username,
1023
+ operationTime: moment().format('YYYY-MM-DD HH:mm:ss'),
1024
+ userSign: ''
1025
+ }
1026
+ )
1027
+ }
969
1028
  } else if (genList[i].type === "blank") {
970
1029
  this.$set(
971
1030
  this.models,
@@ -524,7 +524,7 @@
524
524
  // }
525
525
  // }
526
526
  // this.formItem && this.formItem.setValue(value)
527
-
527
+
528
528
  this.$emit('change', value)
529
529
  this.$emit('input', value)
530
530
  this.$emit('update:modelValue', value)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zscreate/zhxy-app-component",
3
- "version": "1.0.273",
3
+ "version": "1.0.275",
4
4
  "private": false,
5
5
  "description": "zhxy-app-component",
6
6
  "main": "index.js",
package/utils/util.js CHANGED
@@ -266,6 +266,12 @@ export const getDictInfo = memoize((dictCode) => {
266
266
 
267
267
  })
268
268
 
269
+
270
+ export const cacheHttp = {
271
+ get : memoize(Vue.prototype.$u.get, (...args) => JSON.stringify(args)),
272
+ post : memoize(Vue.prototype.$u.post, (...args) => JSON.stringify(args)),
273
+ }
274
+
269
275
  function h5PreviewFile(url, h5_preview_type) {
270
276
  getDictInfo('form_h5_preview_config').then(result => {
271
277
  let h5_preview_url = result.find(item => item.itemValue === h5_preview_type).description
@@ -290,6 +296,7 @@ module.exports = {
290
296
  getParentFunc,
291
297
  getRecursionWidget,
292
298
  getDictInfo,
299
+ cacheHttp,
293
300
  h5PreviewFile,
294
301
  getOpenId
295
302
  }