@zscreate/zhxy-app-component 1.0.93 → 1.0.94
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/components/evan-form-item/evan-form-item.vue +93 -25
- package/components/evan-form-item/mixins/pubSubMixin.js +8 -0
- package/components/evan-form-item/utils.js +5 -1
- package/components/form-container/form-container.vue +10 -1
- package/components/l-file/l-file.vue +37 -6
- package/components/lb-picker/index.vue +14 -5
- package/components/rich-editor/index.vue +23 -22
- package/components/signatrue-write/signatrue-write.vue +7 -1
- package/components/uni-datetime-picker/components/uni-datetime-picker/calendar.vue +6 -0
- package/components/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue +1 -1
- package/components/uploadFile/uploadFile.vue +101 -19
- package/package.json +1 -1
- package/components/userSelectByRole/userSelectByRole.vue +0 -210
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
:class="{showAsteriskRect:hasRequiredAsterisk,isRequired:showRequiredAsterisk}" :style="mLabelStyle">
|
|
46
46
|
{{ widget.name }}
|
|
47
47
|
</view>
|
|
48
|
-
<view class="evan-form-item-container__main
|
|
48
|
+
<view class="evan-form-item-container__main " style="display: block" :style="mContentStyle">
|
|
49
49
|
<view @click.prevent="downLoadFile(item)" style="margin-right: 20px;color: #007AFF;"
|
|
50
50
|
v-for="(item, index) in widget.options.defaultValue" :key="index"
|
|
51
51
|
:class="{disabledClick: widget.options.disabled}">
|
|
@@ -134,7 +134,10 @@
|
|
|
134
134
|
</view>
|
|
135
135
|
<view class="evan-form-item-container__main" :style="mContentStyle" style="padding: 0;">
|
|
136
136
|
<slider style="width: 100%;" :value="dataModel" :show-value="true" @change="sliderChange"
|
|
137
|
-
activeColor="#007AFF" backgroundColor="#E4E7ED"
|
|
137
|
+
activeColor="#007AFF" backgroundColor="#E4E7ED"
|
|
138
|
+
:max="widget.options.max"
|
|
139
|
+
:min="widget.options.min"
|
|
140
|
+
:step="widget.options.step"
|
|
138
141
|
:disabled="widget.options.disabled"/>
|
|
139
142
|
</view>
|
|
140
143
|
</view>
|
|
@@ -186,7 +189,7 @@
|
|
|
186
189
|
<view class="evan-form-item-container__main--body">
|
|
187
190
|
<uni-datetime-picker @change="dateChange" @click.native="isClickByUser = true"
|
|
188
191
|
:type="widget.options.type" :format="widget.options.format"
|
|
189
|
-
:clearIcon="widget.options.clearable" v-model="dataModel" @maskClick="maskClick"
|
|
192
|
+
:clearIcon="!widget.options.disabled && widget.options.clearable" v-model="dataModel" @maskClick="maskClick"
|
|
190
193
|
:border="false" :disabled="widget.options.disabled">
|
|
191
194
|
<view class="option-font-size">
|
|
192
195
|
{{ dataModel | filterDataModel(widget) }}
|
|
@@ -222,7 +225,7 @@
|
|
|
222
225
|
</view>
|
|
223
226
|
<view class="option-font-size" @tap="showTime(widget.model,0)">
|
|
224
227
|
{{
|
|
225
|
-
showTimeStr(dataModel, 0) ? showTimeStr(dataModel, 0) : widget.options.
|
|
228
|
+
showTimeStr(dataModel, 0) ? showTimeStr(dataModel, 0) : (widget.options.startPlaceholder || widget.options.placeholder)
|
|
226
229
|
}}
|
|
227
230
|
</view>
|
|
228
231
|
<view class="option-time-icon" v-if="widget.options.isRange">
|
|
@@ -230,7 +233,7 @@
|
|
|
230
233
|
</view>
|
|
231
234
|
<view v-if="widget.options.isRange" class="option-font-size" @tap="showTime(widget.model,1)">
|
|
232
235
|
{{
|
|
233
|
-
showTimeStr(dataModel, 1) ? showTimeStr(dataModel, 1) :
|
|
236
|
+
showTimeStr(dataModel, 1) ? showTimeStr(dataModel, 1) : (widget.options.endPlaceholder || widget.options.placeholder)
|
|
234
237
|
}}
|
|
235
238
|
</view>
|
|
236
239
|
<view class="u_close" v-if="widget.options.clearable && getTime(dataModel) && !widget.options.disabled"
|
|
@@ -300,7 +303,7 @@
|
|
|
300
303
|
{{ widget.name }}
|
|
301
304
|
</view>
|
|
302
305
|
<view class="evan-form-item-container__main" :style="mContentStyle">
|
|
303
|
-
<lb-picker ref="picker" v-model="dataModel" @change="cityChecked" :value="widget.options.defaultValue"
|
|
306
|
+
<lb-picker :placeholder="widget.options.placeholder" ref="picker" v-model="dataModel" @change="cityChecked" :value="widget.options.defaultValue"
|
|
304
307
|
:disabled="widget.options.disabled">
|
|
305
308
|
</lb-picker>
|
|
306
309
|
</view>
|
|
@@ -343,7 +346,7 @@
|
|
|
343
346
|
</view>
|
|
344
347
|
<view class="evan-form-item-container__main" :style="mContentStyle">
|
|
345
348
|
<uni-link :href="widget.options.defaultValue" :text="widget.options.title"
|
|
346
|
-
:disabled="widget.options.disabled">
|
|
349
|
+
:disabled="widget.options.disabled" color="#0c60e1" :showUnderLine="false">
|
|
347
350
|
</uni-link>
|
|
348
351
|
</view>
|
|
349
352
|
</view>
|
|
@@ -370,7 +373,7 @@
|
|
|
370
373
|
:class="{showAsteriskRect:hasRequiredAsterisk,isRequired:showRequiredAsterisk}" :style="mLabelStyle">
|
|
371
374
|
{{ widget.name }}
|
|
372
375
|
</view>
|
|
373
|
-
<view class="evan-form-item-container__main" :style="mContentStyle">
|
|
376
|
+
<view class="evan-form-item-container__main" style="display: block" :style="mContentStyle">
|
|
374
377
|
<view style="float: left;">
|
|
375
378
|
<button v-show="!widget.options.disabled" size="mini" type="primary" @click="signatrueFlag = true"
|
|
376
379
|
style="white-space: nowrap;">签名
|
|
@@ -410,7 +413,7 @@
|
|
|
410
413
|
{{ widget.name }}
|
|
411
414
|
</view>
|
|
412
415
|
<view class="evan-form-item-container__main" :style="mContentStyle"
|
|
413
|
-
@click
|
|
416
|
+
@click="selectUser(widget.options.multiple)">
|
|
414
417
|
<!-- <input class="form-input" placeholder-class="form-input-placeholder" v-model="dataModelShow"
|
|
415
418
|
:placeholder="widget.options.placeholder" :disabled="widget.options.disabled" /> -->
|
|
416
419
|
<view class="form-input">{{ dataModelShow ? dataModelShow : widget.options.placeholder }}</view>
|
|
@@ -426,8 +429,8 @@
|
|
|
426
429
|
{{ widget.name }}
|
|
427
430
|
</view>
|
|
428
431
|
<view class="evan-form-item-container__main" :style="mContentStyle"
|
|
429
|
-
@click
|
|
430
|
-
<user-select-by-role ref="userSelectByRole" @ok="handleSelectRoleUserOk"
|
|
432
|
+
@click="selectUserByRole(widget)">
|
|
433
|
+
<!-- <user-select-by-role ref="userSelectByRole" @ok="handleSelectRoleUserOk"/>-->
|
|
431
434
|
<!-- <input class="form-input" placeholder-class="form-input-placeholder" v-model="dataModelShow"
|
|
432
435
|
:placeholder="widget.options.placeholder" :disabled="widget.options.disabled" /> -->
|
|
433
436
|
<view class="form-input">{{ dataModelShow ? dataModelShow : widget.options.placeholder }}</view>
|
|
@@ -443,7 +446,7 @@
|
|
|
443
446
|
{{ widget.name }}
|
|
444
447
|
</view>
|
|
445
448
|
<view class="evan-form-item-container__main" :style="mContentStyle"
|
|
446
|
-
@click
|
|
449
|
+
@click="selectdept(widget.options.multiple)">
|
|
447
450
|
<!-- <input class="form-input" placeholder-class="form-input-placeholder" v-model="dataModelShow"
|
|
448
451
|
:placeholder="widget.options.placeholder" :disabled="widget.options.disabled"
|
|
449
452
|
:departvalue="widget.options.defaultValue" /> -->
|
|
@@ -497,6 +500,14 @@
|
|
|
497
500
|
</view>
|
|
498
501
|
</view>
|
|
499
502
|
|
|
503
|
+
<!-- 公文组件 editorAirt -->
|
|
504
|
+
<view v-else-if="widget.type ==='editorAirt'" class="evan-form-item-container"
|
|
505
|
+
:class="'evan-form-item-container--' + labelPosition" >
|
|
506
|
+
<view class="evan-form-item-container__main" :style="mContentStyle">
|
|
507
|
+
<rich-text :nodes="dataModel" style="width: 100%;"></rich-text>
|
|
508
|
+
</view>
|
|
509
|
+
</view>
|
|
510
|
+
|
|
500
511
|
<view class="error-message" v-if="showFalse">{{ showFalseMsg }}</view>
|
|
501
512
|
</view>
|
|
502
513
|
</template>
|
|
@@ -505,7 +516,6 @@
|
|
|
505
516
|
import moment from "../../utils/moment.js";
|
|
506
517
|
import uniDatetimePicker
|
|
507
518
|
from '../../components/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue'
|
|
508
|
-
// import utils from './utils.js'
|
|
509
519
|
import tColorPicker from '../../components/t-color-picker/t-color-picker.vue'
|
|
510
520
|
import unploadFile from '../../components/uploadFile/uploadFile.vue'
|
|
511
521
|
import lFile from '../../components/l-file/l-file.vue'
|
|
@@ -531,15 +541,15 @@ import {
|
|
|
531
541
|
import {
|
|
532
542
|
getMode
|
|
533
543
|
} from './utilForForm'
|
|
534
|
-
import UserSelectByRole from "../userSelectByRole/userSelectByRole";
|
|
535
544
|
import {downloadFile} from "../../utils/util";
|
|
536
545
|
import XpPicker from "../xp-picker/xp-picker.vue";
|
|
546
|
+
import signatrueWrite from "../signatrue-write/signatrue-write.vue";
|
|
537
547
|
|
|
538
548
|
export default {
|
|
549
|
+
options: { styleIsolation: 'shared' },
|
|
539
550
|
mixins: [computedMixin, validateFormMixin, pubSubMixin, valueChangeMixin],
|
|
540
551
|
components: {
|
|
541
552
|
'xp-picker': XpPicker,
|
|
542
|
-
UserSelectByRole,
|
|
543
553
|
UniRate,
|
|
544
554
|
tColorPicker,
|
|
545
555
|
unploadFile,
|
|
@@ -548,11 +558,12 @@ export default {
|
|
|
548
558
|
MyPicker,
|
|
549
559
|
jinEdit,
|
|
550
560
|
uniDatetimePicker,
|
|
551
|
-
richEditor
|
|
561
|
+
richEditor,
|
|
562
|
+
signatrueWrite
|
|
552
563
|
},
|
|
553
564
|
name: 'EvanFormItem',
|
|
554
565
|
props: {
|
|
555
|
-
linkage: Object,
|
|
566
|
+
linkage: [Object,Array],
|
|
556
567
|
formId: String,
|
|
557
568
|
itemkey: [Number, String],
|
|
558
569
|
models: [Object],
|
|
@@ -602,6 +613,9 @@ export default {
|
|
|
602
613
|
}
|
|
603
614
|
return '请选择'
|
|
604
615
|
}
|
|
616
|
+
if (widget.options.type === 'week' ) {
|
|
617
|
+
return dataModel
|
|
618
|
+
}
|
|
605
619
|
if (widget.type === 'date' && widget.options.format) {
|
|
606
620
|
return moment(dataModel).format(widget.options.format)
|
|
607
621
|
}
|
|
@@ -616,6 +630,7 @@ export default {
|
|
|
616
630
|
return '请选择'
|
|
617
631
|
}
|
|
618
632
|
},
|
|
633
|
+
inject: ['dataObj'],
|
|
619
634
|
data() {
|
|
620
635
|
return {
|
|
621
636
|
nameSign: '',
|
|
@@ -693,6 +708,22 @@ export default {
|
|
|
693
708
|
uni.$off(this.widget.model);
|
|
694
709
|
},
|
|
695
710
|
methods: {
|
|
711
|
+
getAllComponent() {
|
|
712
|
+
const data = this.dataObj()
|
|
713
|
+
const findComponent = (list = []) => {
|
|
714
|
+
return list.reduce((all, curr) => {
|
|
715
|
+
if (Array.isArray(curr.columns)) {
|
|
716
|
+
all = all.concat(curr)
|
|
717
|
+
return all.concat(findComponent(curr.columns))
|
|
718
|
+
}
|
|
719
|
+
if (Array.isArray(curr)) {
|
|
720
|
+
return all.concat(findComponent(curr))
|
|
721
|
+
}
|
|
722
|
+
return all.concat(curr)
|
|
723
|
+
}, [])
|
|
724
|
+
}
|
|
725
|
+
return findComponent(data.list)
|
|
726
|
+
},
|
|
696
727
|
getUploadFileUrl(widget) {
|
|
697
728
|
let action = ''
|
|
698
729
|
if (String(widget.options.action).startsWith('http')) {
|
|
@@ -749,17 +780,19 @@ export default {
|
|
|
749
780
|
if (!value || !time) {
|
|
750
781
|
callback()
|
|
751
782
|
}
|
|
783
|
+
const comps = this.getAllComponent()
|
|
784
|
+
let target = comps.find(item => item.model == options.conditionValue)
|
|
752
785
|
if (options.condition == '小于') {
|
|
753
786
|
if (moment(value).unix() <= moment(time).unix()) {
|
|
754
787
|
callback()
|
|
755
788
|
} else {
|
|
756
|
-
callback(
|
|
789
|
+
callback(`${this.widget.name}必须小于等于${target.name}`);
|
|
757
790
|
}
|
|
758
791
|
} else {
|
|
759
792
|
if (moment(value).unix() >= moment(time).unix()) {
|
|
760
793
|
callback()
|
|
761
794
|
} else {
|
|
762
|
-
callback(
|
|
795
|
+
callback(`${this.widget.name}必须大于等于${target.name}`);
|
|
763
796
|
}
|
|
764
797
|
}
|
|
765
798
|
},
|
|
@@ -814,6 +847,7 @@ export default {
|
|
|
814
847
|
},
|
|
815
848
|
showTime(picker, index) {
|
|
816
849
|
if (!picker || this.widget.options.disabled) return;
|
|
850
|
+
this.$refs[picker].value = Array.isArray(this.dataModel) ? this.dataModel[index] : this.dataModel
|
|
817
851
|
this.$refs[picker].show(index);
|
|
818
852
|
},
|
|
819
853
|
//时间 日期清除
|
|
@@ -849,7 +883,8 @@ export default {
|
|
|
849
883
|
SQL: widget.SQL,
|
|
850
884
|
columnName: widget.columnName,
|
|
851
885
|
columnCode: widget.columnCode,
|
|
852
|
-
apiUrl: widget.apiUrl
|
|
886
|
+
apiUrl: widget.apiUrl,
|
|
887
|
+
selectedCode:widget.labels
|
|
853
888
|
}
|
|
854
889
|
var PubsubSign = String(Math.random()).split('.')[1];
|
|
855
890
|
Pubsub.subscribe(PubsubSign, (msg, data) => {
|
|
@@ -860,7 +895,7 @@ export default {
|
|
|
860
895
|
// this.pulishMsg(data,true);//true代表用户点击
|
|
861
896
|
})
|
|
862
897
|
uni.navigateTo({
|
|
863
|
-
url: '/pages/picker/relateSub?params=' + JSON.stringify(params) + '&sign=' + PubsubSign +
|
|
898
|
+
url: '/pages/picker/relateSub?multiple=' + Number(widget.multiple) + '¶ms=' + JSON.stringify(params) + '&sign=' + PubsubSign +
|
|
864
899
|
'&selectedData=' + JSON.stringify(this.dataModel ? this.dataModel : [])
|
|
865
900
|
});
|
|
866
901
|
|
|
@@ -879,6 +914,7 @@ export default {
|
|
|
879
914
|
if (this.widget.type === 'relateSub') {
|
|
880
915
|
this.showLabels(this.dataModel)
|
|
881
916
|
}
|
|
917
|
+
|
|
882
918
|
if (['nameSignature', 'sealSignature'].some(item => this.widget.type.includes(item))) this.getUserSign()
|
|
883
919
|
},
|
|
884
920
|
|
|
@@ -1006,12 +1042,19 @@ export default {
|
|
|
1006
1042
|
if (this.widget.type == 'select') {
|
|
1007
1043
|
let arr = res.result
|
|
1008
1044
|
if (!Array.isArray(arr)) return;
|
|
1045
|
+
let showLabel = ''
|
|
1009
1046
|
for (let i = 0; i < arr.length; i++) {
|
|
1047
|
+
if (Array.isArray(this.dataModel)) {
|
|
1048
|
+
if (this.dataModel.includes(arr[i].dataKey)) {
|
|
1049
|
+
showLabel += ',' + arr[i].dataValue
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1010
1052
|
if (arr[i].dataKey == this.dataModel) {
|
|
1011
1053
|
this.dataModelShow = arr[i].dataValue
|
|
1012
1054
|
return
|
|
1013
1055
|
}
|
|
1014
1056
|
}
|
|
1057
|
+
this.dataModelShow = showLabel.substring(1)
|
|
1015
1058
|
} else if (this.widget.type == 'radio' || this.widget.type == 'checkbox') {
|
|
1016
1059
|
this.updateRadioOrCheckboxModel(this.arrFindDictOrTable(res.result, 'dictTable'))
|
|
1017
1060
|
}
|
|
@@ -1078,6 +1121,7 @@ export default {
|
|
|
1078
1121
|
if (this.tableKey) {
|
|
1079
1122
|
this.dataModel = this.models[this.tableKey][this.tableIndex][this.widget.model]
|
|
1080
1123
|
} else {
|
|
1124
|
+
const value = this.models[this.widget.model]
|
|
1081
1125
|
if (this.widget.type === 'number') {
|
|
1082
1126
|
if (this.models[this.widget.model]) {
|
|
1083
1127
|
this.dataModel = this.models[this.widget.model]
|
|
@@ -1085,8 +1129,24 @@ export default {
|
|
|
1085
1129
|
this.dataModel = this.widget.options.min
|
|
1086
1130
|
}
|
|
1087
1131
|
if (!this.dataModel) this.dataModel = 0
|
|
1132
|
+
} else if (!value && this.widget.type === 'codeControl') {
|
|
1133
|
+
const randomNum = String(Math.random())
|
|
1134
|
+
const dateStr = String(new Date().getFullYear()).slice(2)
|
|
1135
|
+
+ (new Date().getMonth() + 1 > 9 ? new Date().getMonth() + 1 : '0' + (new Date().getMonth() + 1))
|
|
1136
|
+
+ (new Date().getDate() > 9 ? new Date().getDate() : '0' + new Date().getDate())
|
|
1137
|
+
+ randomNum.slice(-4)
|
|
1138
|
+
this.dataModel = dateStr + ''
|
|
1088
1139
|
} else {
|
|
1089
|
-
|
|
1140
|
+
const { max, min } = this.widget.options
|
|
1141
|
+
if (max && value > max) {
|
|
1142
|
+
this.dataModel = max
|
|
1143
|
+
return
|
|
1144
|
+
}
|
|
1145
|
+
if (min && value < min) {
|
|
1146
|
+
this.dataModel = min
|
|
1147
|
+
return
|
|
1148
|
+
}
|
|
1149
|
+
this.dataModel = value
|
|
1090
1150
|
}
|
|
1091
1151
|
}
|
|
1092
1152
|
},
|
|
@@ -1122,6 +1182,7 @@ export default {
|
|
|
1122
1182
|
},
|
|
1123
1183
|
// 选择人员
|
|
1124
1184
|
selectUser(flag) {
|
|
1185
|
+
|
|
1125
1186
|
if (this.widget.options.disabled) return
|
|
1126
1187
|
this.isClickByUser = true
|
|
1127
1188
|
var PubsubSign = 'SelectUser' + String(Math.random()).split('.')[1];
|
|
@@ -1147,7 +1208,7 @@ export default {
|
|
|
1147
1208
|
selectUserByRole(widget) {
|
|
1148
1209
|
if (widget.options.disabled) return
|
|
1149
1210
|
this.isClickByUser = true
|
|
1150
|
-
this.$refs.userSelectByRole.init(widget, this.dataModel)
|
|
1211
|
+
// this.$refs.userSelectByRole.init(widget, this.dataModel)
|
|
1151
1212
|
},
|
|
1152
1213
|
handleSelectRoleUserOk(value) {
|
|
1153
1214
|
this.dataModelShow = ""
|
|
@@ -1307,6 +1368,7 @@ export default {
|
|
|
1307
1368
|
this.updatedeptSelectorModal()
|
|
1308
1369
|
}
|
|
1309
1370
|
if (this.widget.type === 'codeControl') {
|
|
1371
|
+
|
|
1310
1372
|
const randomNum = String(Math.random())
|
|
1311
1373
|
const dateStr = String(new Date().getFullYear()).slice(2)
|
|
1312
1374
|
+ (new Date().getMonth() + 1 > 9 ? new Date().getMonth() + 1 : '0' + (new Date().getMonth() + 1))
|
|
@@ -1335,9 +1397,10 @@ export default {
|
|
|
1335
1397
|
}
|
|
1336
1398
|
</script>
|
|
1337
1399
|
|
|
1338
|
-
|
|
1339
|
-
<style lang="scss" scoped>
|
|
1400
|
+
<style>
|
|
1340
1401
|
@import "../../static/uni.css";
|
|
1402
|
+
</style>
|
|
1403
|
+
<style lang="scss" scoped>
|
|
1341
1404
|
//.clear-btn {
|
|
1342
1405
|
// position: absolute;
|
|
1343
1406
|
// width: 31px;
|
|
@@ -1367,6 +1430,7 @@ icon {
|
|
|
1367
1430
|
|
|
1368
1431
|
.disabledClick {
|
|
1369
1432
|
pointer-events: none;
|
|
1433
|
+
color: initial !important;
|
|
1370
1434
|
}
|
|
1371
1435
|
|
|
1372
1436
|
.cover-text {
|
|
@@ -1470,6 +1534,7 @@ checkbox-group label {
|
|
|
1470
1534
|
.form-input {
|
|
1471
1535
|
font-size: $uni-form-content-font-size;
|
|
1472
1536
|
width: 100%;
|
|
1537
|
+
min-height: 20px;
|
|
1473
1538
|
color: #555555 // padding-left: 28upx;
|
|
1474
1539
|
}
|
|
1475
1540
|
|
|
@@ -1599,4 +1664,7 @@ checkbox-group label {
|
|
|
1599
1664
|
.option-time-icon {
|
|
1600
1665
|
width: 150rpx;
|
|
1601
1666
|
}
|
|
1667
|
+
::v-deep .uni-calendar__mask {
|
|
1668
|
+
z-index: 999;
|
|
1669
|
+
}
|
|
1602
1670
|
</style>
|
|
@@ -51,6 +51,13 @@ export const pubSubMixin = {
|
|
|
51
51
|
updateModelByScript(data, list) {
|
|
52
52
|
this.isClickByUser = data.isClickByUser;
|
|
53
53
|
this.isWx = true
|
|
54
|
+
// #ifdef H5
|
|
55
|
+
const that = this
|
|
56
|
+
let global= globalThis
|
|
57
|
+
eval(data.operateValue)
|
|
58
|
+
return
|
|
59
|
+
// #endif
|
|
60
|
+
|
|
54
61
|
console.log(run(data.operateValue, {
|
|
55
62
|
that: this,
|
|
56
63
|
global: globalThis,
|
|
@@ -58,6 +65,7 @@ export const pubSubMixin = {
|
|
|
58
65
|
isWx: true,
|
|
59
66
|
uni
|
|
60
67
|
}))
|
|
68
|
+
|
|
61
69
|
},
|
|
62
70
|
/**
|
|
63
71
|
* @description 发布消息
|
|
@@ -10,7 +10,11 @@ const utils = {
|
|
|
10
10
|
const propRules = [].concat(rules[prop] || []);
|
|
11
11
|
propRules.forEach((rule) => {
|
|
12
12
|
if (rule.pattern) {
|
|
13
|
-
|
|
13
|
+
let pattern = rule.pattern
|
|
14
|
+
if (typeof pattern === 'string' && String(pattern).startsWith('/') && String(pattern).endsWith('/')) {
|
|
15
|
+
pattern = String(pattern).substring(1, pattern.length -1)
|
|
16
|
+
}
|
|
17
|
+
rule.pattern = new RegExp(pattern)
|
|
14
18
|
}
|
|
15
19
|
})
|
|
16
20
|
const descriptor = {
|
|
@@ -200,12 +200,20 @@ import Pubsub from 'pubsub-js'
|
|
|
200
200
|
import evanFormItem from "../evan-form-item/evan-form-item";
|
|
201
201
|
import evanForm from "../evan-form/evan-form";
|
|
202
202
|
import mTextarea from "../m-textarea/m-textarea";
|
|
203
|
+
import packageJson from '../../package.json'
|
|
204
|
+
console.log('zhxy-app-component: ', packageJson.version)
|
|
203
205
|
export default {
|
|
206
|
+
options: { styleIsolation: 'shared' },
|
|
204
207
|
name: 'formContainer',
|
|
205
208
|
props: ['dataObj', 'value', 'isButton', 'verifyNode', 'verifyLogs', 'suggest', 'isCorrect', 'isDraft', 'formId', 'linkage', "labelPosition",
|
|
206
209
|
'isApply'
|
|
207
210
|
],
|
|
208
211
|
components: { evanFormItem ,evanForm, mTextarea },
|
|
212
|
+
provide() {
|
|
213
|
+
return {
|
|
214
|
+
dataObj: () => this.dataObj
|
|
215
|
+
}
|
|
216
|
+
},
|
|
209
217
|
data() {
|
|
210
218
|
return {
|
|
211
219
|
timer: null,
|
|
@@ -761,6 +769,7 @@ export default {
|
|
|
761
769
|
fn('failed')
|
|
762
770
|
} //['成功了', 'success']
|
|
763
771
|
}).catch((error) => {
|
|
772
|
+
fn('failed')
|
|
764
773
|
console.log(error)
|
|
765
774
|
})
|
|
766
775
|
// this.$refs.form.validate((res) => {
|
|
@@ -910,7 +919,7 @@ $mybottom: 0; //底部按钮
|
|
|
910
919
|
.form-input {
|
|
911
920
|
font-size: 28rpx;
|
|
912
921
|
color: #333;
|
|
913
|
-
text-align: right;
|
|
922
|
+
//text-align: right;
|
|
914
923
|
width: 100%;
|
|
915
924
|
box-sizing: border-box;
|
|
916
925
|
height: 60rpx;
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
<view class="file_conten">
|
|
4
4
|
<view class="file_upload option-font-size" @click="chooseMessageFile"
|
|
5
5
|
v-if="isShow">
|
|
6
|
-
|
|
6
|
+
{{ widget.options.placeholder || '点击上传'}}
|
|
7
7
|
</view>
|
|
8
8
|
<view>
|
|
9
9
|
<view class="file_item" v-for="(item,idx) in defaultFile" :key="idx">
|
|
10
|
-
<view @click="downLoadFile(item.url,item.name)">{{item.name}}</view>
|
|
10
|
+
<view @click="downLoadFile(item.url,item.name)" style="max-width: 640rpx;color: rgb(0, 122, 255); overflow: hidden" :style="{maxWidth: disabled ? '100%': '640rpx'}">{{item.name}}</view>
|
|
11
11
|
<icon type="clear" size="16" @click="handleDelete(idx)" v-if="!disabled" />
|
|
12
12
|
</view>
|
|
13
13
|
</view>
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
name: "",
|
|
51
51
|
percent: 0,
|
|
52
52
|
show: true,
|
|
53
|
+
uploadIng: false,
|
|
53
54
|
isShow:true,//是否展示点击上传
|
|
54
55
|
}
|
|
55
56
|
},
|
|
@@ -86,7 +87,20 @@
|
|
|
86
87
|
chooseMessageFile: function(e) {
|
|
87
88
|
console.log(this.widget, )
|
|
88
89
|
const { options } = this.widget
|
|
89
|
-
|
|
90
|
+
|
|
91
|
+
if (this.disabled || (this.defaultFile.length && this.defaultFile.length >= options.length)) {
|
|
92
|
+
this.uploadIng = false
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (this.uploadIng) {
|
|
97
|
+
uni.showToast({
|
|
98
|
+
title: `文件上传中`,
|
|
99
|
+
icon: 'none'
|
|
100
|
+
})
|
|
101
|
+
return
|
|
102
|
+
}
|
|
103
|
+
this.uploadIng = true
|
|
90
104
|
var that = this;
|
|
91
105
|
//#ifdef H5
|
|
92
106
|
uni.chooseFile
|
|
@@ -100,16 +114,27 @@
|
|
|
100
114
|
success: (res) => {
|
|
101
115
|
console.log(res.tempFiles)
|
|
102
116
|
const path = res.tempFiles
|
|
103
|
-
const { ext = '' } = this.widget
|
|
117
|
+
const { ext = '' , options } = this.widget
|
|
118
|
+
const { fileSize } = options
|
|
104
119
|
that.name = res.tempFiles[0].name
|
|
120
|
+
|
|
105
121
|
console.log(ext, that.name.split('.').pop())
|
|
106
122
|
if (!ext.includes(that.name.split('.').pop())) {
|
|
123
|
+
that.uploadIng = false
|
|
107
124
|
return uni.showToast({
|
|
108
125
|
title: `不支持该文件`,
|
|
109
126
|
icon: 'none'
|
|
110
127
|
})
|
|
111
128
|
}
|
|
129
|
+
if (res.tempFiles[0].size > fileSize * 1024) {
|
|
130
|
+
that.uploadIng = false
|
|
131
|
+
return uni.showToast({
|
|
132
|
+
title: `文件超出${fileSize}KB!`,
|
|
133
|
+
icon: 'none'
|
|
134
|
+
})
|
|
135
|
+
}
|
|
112
136
|
|
|
137
|
+
this.uploadIng = true
|
|
113
138
|
const uploadTask = uni.uploadFile({
|
|
114
139
|
url: that.url,
|
|
115
140
|
filePath: path[0].path,
|
|
@@ -123,9 +148,13 @@
|
|
|
123
148
|
url: JSON.parse(res.data).message
|
|
124
149
|
}
|
|
125
150
|
that.$emit('filePost', imgObj)
|
|
126
|
-
}
|
|
151
|
+
},
|
|
152
|
+
complete() {
|
|
153
|
+
that.uploadIng = false
|
|
154
|
+
}
|
|
127
155
|
});
|
|
128
156
|
|
|
157
|
+
that.show = true
|
|
129
158
|
uploadTask.onProgressUpdate(function(res) {
|
|
130
159
|
that.percent = res.progress;
|
|
131
160
|
if (Number(res.progress) == 100) {
|
|
@@ -133,7 +162,9 @@
|
|
|
133
162
|
}
|
|
134
163
|
});
|
|
135
164
|
},
|
|
165
|
+
|
|
136
166
|
error: function(e) {
|
|
167
|
+
that.uploadIng = false
|
|
137
168
|
console.log(e);
|
|
138
169
|
}
|
|
139
170
|
});
|
|
@@ -179,7 +210,7 @@
|
|
|
179
210
|
display: flex;
|
|
180
211
|
justify-content: space-between;
|
|
181
212
|
align-items: center;
|
|
182
|
-
view{
|
|
213
|
+
view {
|
|
183
214
|
margin-top: 10upx;
|
|
184
215
|
}
|
|
185
216
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view>
|
|
3
|
-
<view class="pick-name" @click="handleclick">{{title ? title :
|
|
2
|
+
<view style="width: 100%">
|
|
3
|
+
<view class="pick-name" @click="handleclick">{{title ? title : placeholder}}</view>
|
|
4
4
|
<!-- <uni-icons type="arrowdown" color="#D7d7d7" size="20" v-if="title =='' " @click="handleclick"></uni-icons> -->
|
|
5
5
|
<!-- <input type="text" placeholder="请选择" v-if="title =='' " @click="handleclick" /> -->
|
|
6
6
|
<uni-popup ref="popup" type="bottom">
|
|
@@ -53,6 +53,11 @@
|
|
|
53
53
|
type: Array,
|
|
54
54
|
default: []
|
|
55
55
|
},
|
|
56
|
+
placeholder:
|
|
57
|
+
{
|
|
58
|
+
type: String,
|
|
59
|
+
default: '请选择地区'
|
|
60
|
+
},
|
|
56
61
|
disabled: {
|
|
57
62
|
type: Boolean,
|
|
58
63
|
default: false
|
|
@@ -197,7 +202,7 @@
|
|
|
197
202
|
hadletwo(item, idx) {
|
|
198
203
|
this.indexthree = -1
|
|
199
204
|
this.indextwo = idx
|
|
200
|
-
if (item.isLeaf == false) {
|
|
205
|
+
if (item && item.isLeaf == false) {
|
|
201
206
|
this.getnext(item.value).then(res => {
|
|
202
207
|
console.log(res)
|
|
203
208
|
this.levellist = res.result
|
|
@@ -215,9 +220,11 @@
|
|
|
215
220
|
console.log(this.indexList)
|
|
216
221
|
const arr = this.indexList
|
|
217
222
|
this.svalue = arr
|
|
223
|
+
if (this.listtwo.length === 0) this.listtwo = [{value: '', label: ''}]
|
|
224
|
+
if (this.levellist.length === 0) this.levellist = [{value: '', label: ''}]
|
|
218
225
|
this.city = [this.list[arr[0]].value, this.listtwo[arr[1]].value, this.levellist[arr[2]].value]
|
|
219
|
-
this.title = this.list[arr[0]].label + '/' + this.listtwo[arr[1]].label + '/' + this.levellist[arr[2]]
|
|
220
|
-
|
|
226
|
+
this.title = this.list[arr[0]].label + (this.listtwo[arr[1]].label ? ('/' + this.listtwo[arr[1]].label): '') + (this.levellist[arr[2]].label ? ('/' + this.levellist[arr[2]].label): '')
|
|
227
|
+
|
|
221
228
|
console.log('city', this.city)
|
|
222
229
|
|
|
223
230
|
this.$emit('change', this.city);
|
|
@@ -241,6 +248,8 @@
|
|
|
241
248
|
.pick-name {
|
|
242
249
|
font-size: 32rpx;
|
|
243
250
|
color: #555555;
|
|
251
|
+
width: 100%;
|
|
252
|
+
min-height: 14px;
|
|
244
253
|
}
|
|
245
254
|
|
|
246
255
|
.uni-padding-wrap {
|
|
@@ -6,32 +6,32 @@
|
|
|
6
6
|
字体图标,微信小程序官方的确没有给出名称
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
|
-
<view class="toolbar"
|
|
9
|
+
<view class="toolbar" :style="'bottom: ' + (isIOS ? keyboardHeight : 0) + 'px'">
|
|
10
10
|
<!-- <i class="iconfont icon-charutupian" @touchend.stop="insertImage"></i> -->
|
|
11
11
|
<i :class="'iconfont icon-format-header-1 ' + (formats.header === 1 ? 'ql-active' : '')" data-name="header"
|
|
12
|
-
:data-value="1"></i>
|
|
12
|
+
:data-value="1" @click="format('header', 1)"></i>
|
|
13
13
|
<i :class="'iconfont icon-format-header-2 ' + (formats.header === 2 ? 'ql-active' : '')" data-name="header"
|
|
14
|
-
:data-value="2"></i>
|
|
14
|
+
:data-value="2" @click="format('header', 2)"></i>
|
|
15
15
|
<i :class="'iconfont icon-format-header-3 ' + (formats.header === 3 ? 'ql-active' : '')" data-name="header"
|
|
16
|
-
:data-value="3"></i>
|
|
16
|
+
:data-value="3" @click="format('header', 3)"></i>
|
|
17
17
|
<!-- <i :class="'iconfont icon-format-header-4 ' + (formats.header === 4 ? 'ql-active' : '')" data-name="header"
|
|
18
18
|
:data-value="4"></i>
|
|
19
19
|
<i :class="'iconfont icon-format-header-5 ' + (formats.header === 5 ? 'ql-active' : '')" data-name="header"
|
|
20
20
|
:data-value="5"></i>
|
|
21
21
|
<i :class="'iconfont icon-format-header-6 ' + (formats.header === 6 ? 'ql-active' : '')" data-name="header"
|
|
22
22
|
:data-value="6"></i> -->
|
|
23
|
-
<i :class="'iconfont icon-zitijiacu ' + (formats.bold ? 'ql-active' : '')" data-name="bold"></i>
|
|
23
|
+
<i :class="'iconfont icon-zitijiacu ' + (formats.bold ? 'ql-active' : '')" data-name="bold" @click="format('bold')"></i>
|
|
24
24
|
<!-- <i :class="'iconfont icon-zitishanchuxian ' + (formats.strike ? 'ql-active' : '')" data-name="strike"></i>-->
|
|
25
|
-
<i :class="'iconfont icon-zitixieti ' + (formats.italic ? 'ql-active' : '')" data-name="italic"></i>
|
|
26
|
-
<i :class="'iconfont icon-zitixiahuaxian ' + (formats.underline ? 'ql-active' : '')" data-name="underline"></i>
|
|
25
|
+
<i :class="'iconfont icon-zitixieti ' + (formats.italic ? 'ql-active' : '')" data-name="italic" @click="format('italic')"></i>
|
|
26
|
+
<i :class="'iconfont icon-zitixiahuaxian ' + (formats.underline ? 'ql-active' : '')" data-name="underline" @click="format('underline')"></i>
|
|
27
27
|
<!-- <i class="iconfont icon-fengexian" @tap="insertDivider"></i>-->
|
|
28
28
|
<!-- <i class="iconfont icon--checklist" data-name="list" data-value="check"></i> -->
|
|
29
|
-
<i :class="'iconfont icon-zuoduiqi ' + (formats.align === 'left' ? 'ql-active' : '')" data-name="align" data-value="left"></i>
|
|
29
|
+
<i :class="'iconfont icon-zuoduiqi ' + (formats.align === 'left' ? 'ql-active' : '')" data-name="align" data-value="left" @click="format('align', 'left')"></i>
|
|
30
30
|
<i :class="'iconfont icon-juzhongduiqi ' + (formats.align === 'center' ? 'ql-active' : '')" data-name="align"
|
|
31
|
-
data-value="center"></i>
|
|
32
|
-
<i :class="'iconfont icon-youduiqi ' + (formats.align === 'right' ? 'ql-active' : '')" data-name="align" data-value="right"></i>
|
|
31
|
+
data-value="center" @click="format('align', 'center')"></i>
|
|
32
|
+
<i :class="'iconfont icon-youduiqi ' + (formats.align === 'right' ? 'ql-active' : '')" data-name="align" data-value="right" @click="format('align', 'right')"></i>
|
|
33
33
|
<i :class="'iconfont icon-zuoyouduiqi ' + (formats.align === 'justify' ? 'ql-active' : '')" data-name="align"
|
|
34
|
-
data-value="justify"></i>
|
|
34
|
+
data-value="justify" @click="format('align', 'justify')"></i>
|
|
35
35
|
<!-- <i :class="'iconfont icon-line-height ' + (formats.lineHeight ? 'ql-active' : '')" data-name="lineHeight" data-value="2"></i> -->
|
|
36
36
|
<!-- <i :class="'iconfont icon-Character-Spacing ' + (formats.letterSpacing ? 'ql-active' : '')" data-name="letterSpacing"
|
|
37
37
|
data-value="2em"></i> -->
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
<!-- <i class="iconfont icon-date" @tap="insertDate"></i> -->
|
|
52
52
|
|
|
53
53
|
<i :class="'iconfont icon-youxupailie ' + (formats.list === 'ordered' ? 'ql-active' : '')" data-name="list"
|
|
54
|
-
data-value="ordered"></i>
|
|
55
|
-
<i :class="'iconfont icon-wuxupailie ' + (formats.list === 'bullet' ? 'ql-active' : '')" data-name="list" data-value="bullet"></i>
|
|
54
|
+
data-value="ordered" @click="format('list', 'ordered')"></i>
|
|
55
|
+
<i :class="'iconfont icon-wuxupailie ' + (formats.list === 'bullet' ? 'ql-active' : '')" data-name="list" data-value="bullet" @click="format('list', 'bullet')"></i>
|
|
56
56
|
<!-- <i class="iconfont icon-outdent" data-name="indent" data-value="-1"></i>
|
|
57
57
|
<i class="iconfont icon-indent" data-name="indent" data-value="+1"></i> -->
|
|
58
58
|
<!-- <i class="iconfont icon-preview" @tap="store" id="2"></i> -->
|
|
@@ -61,15 +61,15 @@
|
|
|
61
61
|
<i :class="'iconfont icon-zitishangbiao ' + (formats.script === 'super' ? 'ql-active' : '')" data-name="script"
|
|
62
62
|
data-value="super"></i> -->
|
|
63
63
|
<!-- <i class="iconfont icon-quanping"></i>-->
|
|
64
|
-
<i class="iconfont icon-undo" @tap="undo"></i>
|
|
65
|
-
<i class="iconfont icon-redo" @tap="redo"></i>
|
|
66
|
-
<i class="iconfont icon-shanchu" @tap="clear"></i>
|
|
64
|
+
<i class="iconfont icon-undo" @tap="undo" @click="format('undo')"></i>
|
|
65
|
+
<i class="iconfont icon-redo" @tap="redo" @click="format('redo')"></i>
|
|
66
|
+
<i class="iconfont icon-shanchu" @tap="clear" @click="format('clear')"></i>
|
|
67
67
|
<!-- <i :class="'iconfont icon-direction-rtl ' + (formats.direction === 'rtl' ? 'ql-active' : '')" data-name="direction"
|
|
68
68
|
data-value="rtl"></i> -->
|
|
69
69
|
<!-- <i class="iconfont icon-baocun" @tap="store" id="1"></i>-->
|
|
70
70
|
</view>
|
|
71
71
|
<view class="container">
|
|
72
|
-
<editor id="editor" show-img-size :read-only="isEdit" show-img-resize show-img-toolbar class="ql-container"
|
|
72
|
+
<editor ref="editor" id="editor" show-img-size :read-only="isEdit" show-img-resize show-img-toolbar class="ql-container"
|
|
73
73
|
:placeholder="placeholder" @statuschange="onStatusChange" @ready="onEditorReady" @input="handleInput">
|
|
74
74
|
</editor>
|
|
75
75
|
<view v-if="maxLength" class="text-num">{{textLength}}/{{maxLength}}</view>
|
|
@@ -148,6 +148,11 @@
|
|
|
148
148
|
console.log(this.editorCtx, res)
|
|
149
149
|
this.editorCtx.setContents({
|
|
150
150
|
html: this.value
|
|
151
|
+
})
|
|
152
|
+
this.editorCtx.getContents({
|
|
153
|
+
success: (res) => {
|
|
154
|
+
this.textLength = res.text.replaceAll(`\n`,"").length
|
|
155
|
+
},
|
|
151
156
|
})
|
|
152
157
|
}).exec();
|
|
153
158
|
},
|
|
@@ -233,12 +238,8 @@
|
|
|
233
238
|
// })
|
|
234
239
|
},
|
|
235
240
|
|
|
236
|
-
format(
|
|
241
|
+
format(name, value) {
|
|
237
242
|
// this.hideKey();
|
|
238
|
-
let {
|
|
239
|
-
name,
|
|
240
|
-
value
|
|
241
|
-
} = e.target.dataset;
|
|
242
243
|
if (!name) return; // console.log('format', name, value)
|
|
243
244
|
this.editorCtx.format(name, value);
|
|
244
245
|
},
|
|
@@ -50,12 +50,18 @@
|
|
|
50
50
|
methods: {
|
|
51
51
|
overSign: function() {
|
|
52
52
|
if (this.isEnd) {
|
|
53
|
+
let url = ''
|
|
54
|
+
if (String(this.uniEnv.uploadUrl).startsWith('http')) {
|
|
55
|
+
url = this.uniEnv.uploadUrl;
|
|
56
|
+
} else {
|
|
57
|
+
url = this.uniEnv.uploadUrl.includes('sys/common/upload') ? this.uniEnv.uploadUrl : (this.uniEnv.uploadUrl + '/sys/common/upload')
|
|
58
|
+
}
|
|
53
59
|
uni.canvasToTempFilePath({
|
|
54
60
|
canvasId: 'firstCanvas',
|
|
55
61
|
fileType: 'png',
|
|
56
62
|
success: (res) => {
|
|
57
63
|
uni.uploadFile({
|
|
58
|
-
url
|
|
64
|
+
url,
|
|
59
65
|
filePath: res.tempFilePath,
|
|
60
66
|
name: 'file',
|
|
61
67
|
success: (uploadFileRes) => {
|
|
@@ -676,8 +676,14 @@
|
|
|
676
676
|
this.cale.setMultiple(this.calendar.fullDate, true)
|
|
677
677
|
this.weeks = this.cale.weeks
|
|
678
678
|
this.tempSingleDate = this.calendar.fullDate
|
|
679
|
+
if (new Date(this.cale.multipleStatus.before) > new Date(this.cale.multipleStatus.after)) {
|
|
680
|
+
let temp = this.cale.multipleStatus.before
|
|
681
|
+
this.cale.multipleStatus.before = this.cale.multipleStatus.after
|
|
682
|
+
this.cale.multipleStatus.after = temp
|
|
683
|
+
}
|
|
679
684
|
this.tempRange.before = this.cale.multipleStatus.before
|
|
680
685
|
this.tempRange.after = this.cale.multipleStatus.after
|
|
686
|
+
|
|
681
687
|
console.log('多选')
|
|
682
688
|
console.log(this.calendar.fullDate)
|
|
683
689
|
console.log(this.cale)
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view>
|
|
3
|
-
<u-upload ref="uUpload" :file-list="fileList" :action="action"
|
|
3
|
+
<u-upload ref="uUpload" :file-list="fileList" :action="action" :deletable="!disabled"
|
|
4
4
|
@afterRead="afterRead"
|
|
5
5
|
@delete="onRemove"
|
|
6
|
-
:upload-text="widget.options.placeholder"
|
|
7
|
-
width="150" height="150" :multiple="false" :max-count="maxCount" :disabled="disabled"
|
|
8
|
-
|
|
6
|
+
:upload-text="widget.options.placeholder"
|
|
7
|
+
width="150" height="150" :multiple="false" :max-count="maxCount" :disabled="disabled"
|
|
8
|
+
@on-remove="onRemove" @on-oversize="onOversize" @on-success="onSuccess"
|
|
9
|
+
:show-progress="showProgress">
|
|
10
|
+
|
|
11
|
+
<template name="addbtn">
|
|
12
|
+
<view class="u-list-item u-add-wrap" hover-class="u-add-wrap__hover" hover-stay-time="150" @click.stop="handleClick">
|
|
13
|
+
<u-icon name="plus" size="40"></u-icon>
|
|
14
|
+
<view class="u-add-tips">{{ '上传' }}</view>
|
|
15
|
+
</view>
|
|
16
|
+
</template>
|
|
17
|
+
</u-upload>
|
|
18
|
+
|
|
9
19
|
<!-- uview组件 修改了 disabled 用法 更新需要注意 -->
|
|
10
20
|
</view>
|
|
11
21
|
</template>
|
|
@@ -34,11 +44,11 @@ export default {
|
|
|
34
44
|
percent: 0,
|
|
35
45
|
upimg: '',
|
|
36
46
|
maxCount: 8,
|
|
37
|
-
maxSize: 300000,
|
|
38
47
|
disabled: false,
|
|
39
48
|
show: true,
|
|
40
49
|
fileList: [],
|
|
41
|
-
emitList:[],
|
|
50
|
+
emitList: [],
|
|
51
|
+
uploadIng: false,
|
|
42
52
|
showProgress: true
|
|
43
53
|
};
|
|
44
54
|
},
|
|
@@ -54,14 +64,48 @@ export default {
|
|
|
54
64
|
},
|
|
55
65
|
|
|
56
66
|
methods: {
|
|
67
|
+
|
|
68
|
+
handleClick() {
|
|
69
|
+
if (this.uploadIng) {
|
|
70
|
+
return uni.showToast({
|
|
71
|
+
title: `文件上传中`,
|
|
72
|
+
icon: 'none'
|
|
73
|
+
})
|
|
74
|
+
}
|
|
75
|
+
if (this.$refs.uUpload.selectFile) this.$refs.uUpload.selectFile()
|
|
76
|
+
if (this.$refs.uUpload.chooseFile) this.$refs.uUpload.chooseFile()
|
|
77
|
+
},
|
|
57
78
|
async afterRead(event) {
|
|
58
|
-
const {
|
|
79
|
+
const {ext = '', options} = this.widget
|
|
80
|
+
const { fileSize, length } = options
|
|
81
|
+
|
|
59
82
|
if (!ext.includes(event.name.split('.').pop())) {
|
|
60
83
|
return uni.showToast({
|
|
61
84
|
title: `不支持该文件`,
|
|
62
85
|
icon: 'none'
|
|
63
86
|
})
|
|
64
87
|
}
|
|
88
|
+
if (event.file.size > this.maxSize) {
|
|
89
|
+
return uni.showToast({
|
|
90
|
+
title: `文件超出${this.maxSize/1024}KB!`,
|
|
91
|
+
icon: 'none'
|
|
92
|
+
})
|
|
93
|
+
}
|
|
94
|
+
if (this.fileList.length >= this.maxCount) {
|
|
95
|
+
return uni.showToast({
|
|
96
|
+
title: `最多上传${this.maxCount}个文件!`,
|
|
97
|
+
icon: 'none'
|
|
98
|
+
})
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (this.uploadIng) {
|
|
102
|
+
return uni.showToast({
|
|
103
|
+
title: `文件上传中`,
|
|
104
|
+
icon: 'none'
|
|
105
|
+
})
|
|
106
|
+
}
|
|
107
|
+
this.uploadIng = true
|
|
108
|
+
|
|
65
109
|
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
|
|
66
110
|
let lists = [].concat(event.file)
|
|
67
111
|
// lists.map((item) => {
|
|
@@ -77,12 +121,13 @@ export default {
|
|
|
77
121
|
const item = {
|
|
78
122
|
key: id,
|
|
79
123
|
uid: id,
|
|
80
|
-
url:
|
|
124
|
+
url: result,
|
|
81
125
|
status: "done",
|
|
82
126
|
name: id
|
|
83
127
|
}
|
|
84
128
|
this.emitList.push(item)
|
|
85
129
|
this.fileList.push(Object.assign({}, item, {url: this.uniEnv.imgUrl + item.url}))
|
|
130
|
+
this.uploadIng = false
|
|
86
131
|
this.$emit('imgUrlPost', this.emitList)
|
|
87
132
|
}
|
|
88
133
|
},
|
|
@@ -95,24 +140,30 @@ export default {
|
|
|
95
140
|
success: (uploadFileRes) => {
|
|
96
141
|
const res = JSON.parse(uploadFileRes.data)
|
|
97
142
|
resolve(res.message)
|
|
98
|
-
}
|
|
143
|
+
},
|
|
144
|
+
complete: () => {
|
|
145
|
+
setTimeout(() => {
|
|
146
|
+
this.uploadIng = false
|
|
147
|
+
}, 1000)
|
|
148
|
+
},
|
|
99
149
|
});
|
|
100
150
|
})
|
|
101
151
|
},
|
|
102
|
-
onOversize(
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
152
|
+
onOversize() {
|
|
153
|
+
uni.showToast({
|
|
154
|
+
title: `文件超出${this.maxSize/1024}KB!`,
|
|
155
|
+
icon: 'none',
|
|
156
|
+
duration: 1000
|
|
157
|
+
});
|
|
108
158
|
},
|
|
109
159
|
showImage() {
|
|
110
160
|
this.emitList = this.defaultImg
|
|
111
161
|
this.showProgress = false;
|
|
112
162
|
if (this.defaultImg && this.defaultImg.length && this.defaultImg.length > 0) {
|
|
113
163
|
this.fileList = this.defaultImg
|
|
114
|
-
.map((item,index) => {
|
|
115
|
-
let tempItem = {
|
|
164
|
+
.map((item, index) => {
|
|
165
|
+
let tempItem = {
|
|
166
|
+
...item,
|
|
116
167
|
};
|
|
117
168
|
tempItem.url = this.uniEnv.imgUrl + tempItem.url;
|
|
118
169
|
return tempItem;
|
|
@@ -129,7 +180,7 @@ export default {
|
|
|
129
180
|
this.action = this.actionUrl.includes('sys/common/upload') ? this.actionUrl : (this.actionUrl + '/sys/common/upload')
|
|
130
181
|
}
|
|
131
182
|
//文件大小限制
|
|
132
|
-
this.maxSize = this.widget.options.fileSize ? this.widget.options.fileSize *
|
|
183
|
+
this.maxSize = this.widget.options.fileSize ? this.widget.options.fileSize * 1024 : 300000;
|
|
133
184
|
|
|
134
185
|
// this.maxSize = 100
|
|
135
186
|
//最大上传个数
|
|
@@ -165,7 +216,7 @@ export default {
|
|
|
165
216
|
this.$emit('imgUrlPost', this.emitList)
|
|
166
217
|
},
|
|
167
218
|
onRemove(index, lists, name) {
|
|
168
|
-
if (typeof(index) === 'object') index = index.index
|
|
219
|
+
if (typeof (index) === 'object') index = index.index
|
|
169
220
|
this.emitList.splice(index, 1);
|
|
170
221
|
this.fileList.splice(index, 1);
|
|
171
222
|
this.$emit('imgUrlPost', this.emitList)
|
|
@@ -175,4 +226,35 @@ export default {
|
|
|
175
226
|
</script>
|
|
176
227
|
|
|
177
228
|
<style lang="less" scoped>
|
|
229
|
+
.u-list-item {
|
|
230
|
+
width: 200rpx;
|
|
231
|
+
height: 200rpx;
|
|
232
|
+
overflow: hidden;
|
|
233
|
+
margin: 10rpx;
|
|
234
|
+
background: rgb(244, 245, 246);
|
|
235
|
+
position: relative;
|
|
236
|
+
border-radius: 10rpx;
|
|
237
|
+
/* #ifndef APP-NVUE */
|
|
238
|
+
display: flex;
|
|
239
|
+
/* #endif */
|
|
240
|
+
align-items: center;
|
|
241
|
+
justify-content: center;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.u-preview-wrap {
|
|
245
|
+
border: 1px solid rgb(235, 236, 238);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.u-add-wrap {
|
|
249
|
+
flex-direction: column;
|
|
250
|
+
font-size: 26rpx;
|
|
251
|
+
}
|
|
252
|
+
.u-add-tips {
|
|
253
|
+
margin-top: 20rpx;
|
|
254
|
+
line-height: 40rpx;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.u-add-wrap__hover {
|
|
258
|
+
background-color: rgb(235, 236, 238);
|
|
259
|
+
}
|
|
178
260
|
</style>
|
package/package.json
CHANGED
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<u-popup v-model="roleSelectShow" width="100%">
|
|
3
|
-
<view class="role-select-body" style="padding: 20rpx; margin-top: 40rpx">
|
|
4
|
-
<view>角色选择</view>
|
|
5
|
-
<u-radio-group v-model="roleChecked" >
|
|
6
|
-
<u-radio
|
|
7
|
-
@change="roleChange"
|
|
8
|
-
v-for="(item, index) in rolesList" :key="index"
|
|
9
|
-
:name="item.id"
|
|
10
|
-
>
|
|
11
|
-
{{item.roleName}}
|
|
12
|
-
</u-radio>
|
|
13
|
-
</u-radio-group>
|
|
14
|
-
<view style="margin-top: 20rpx; display: flex; flex-wrap: wrap">
|
|
15
|
-
<view>已选:</view>
|
|
16
|
-
<u-tag sconsttyle="margin-right: 5px" v-for="val in currValue" :text="val.realname" closeable @close="removeClick(val)" :key="val.id" />
|
|
17
|
-
</view>
|
|
18
|
-
<view style="margin-top: 20rpx">
|
|
19
|
-
<u-table>
|
|
20
|
-
<u-tr>
|
|
21
|
-
<u-th width="50px" style="box-sizing: border-box">
|
|
22
|
-
<view v-if="multiple">
|
|
23
|
-
<u-checkbox :value="isAllCheck" @change="roleCheckAll">
|
|
24
|
-
</u-checkbox>
|
|
25
|
-
</view>
|
|
26
|
-
<view v-else>选择</view>
|
|
27
|
-
</u-th>
|
|
28
|
-
<u-th >姓名</u-th>
|
|
29
|
-
<u-th>所属部门</u-th>
|
|
30
|
-
</u-tr>
|
|
31
|
-
<u-tr v-for="user in roleUserList" :key="user.id">
|
|
32
|
-
<u-td width="50px" >
|
|
33
|
-
<view>
|
|
34
|
-
<u-checkbox v-model="user.checked" @change="handleCheck" :name="user.id">
|
|
35
|
-
</u-checkbox>
|
|
36
|
-
</view>
|
|
37
|
-
</u-td>
|
|
38
|
-
<u-td style="flex: 1"><view>{{ user.realname }}</view></u-td>
|
|
39
|
-
<u-td style="flex: 1; word-break: break-all; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;"><view>{{ user.departName }}</view></u-td>
|
|
40
|
-
</u-tr>
|
|
41
|
-
</u-table>
|
|
42
|
-
|
|
43
|
-
</view>
|
|
44
|
-
|
|
45
|
-
<view style="display: flex; justify-content: space-between; margin-top: 20rpx">
|
|
46
|
-
<u-button type="primary" size="medium" @click="handleSelectRoleUserOk">确定</u-button>
|
|
47
|
-
<u-button size="medium" @click="roleSelectShow = false">取消</u-button>
|
|
48
|
-
</view>
|
|
49
|
-
</view>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
<t-loading :isLoading="isLoading"/>
|
|
53
|
-
</u-popup>
|
|
54
|
-
</template>
|
|
55
|
-
|
|
56
|
-
<script>
|
|
57
|
-
import {cloneObj} from "../../utils/util";
|
|
58
|
-
|
|
59
|
-
export default {
|
|
60
|
-
name: "userSelectByRole",
|
|
61
|
-
props: {
|
|
62
|
-
|
|
63
|
-
},
|
|
64
|
-
data() {
|
|
65
|
-
return {
|
|
66
|
-
roleSelectShow: false,
|
|
67
|
-
rolesList: [],
|
|
68
|
-
roleUserList: [],
|
|
69
|
-
currValue: [],
|
|
70
|
-
role: '',
|
|
71
|
-
multiple: false,
|
|
72
|
-
depId: '',
|
|
73
|
-
roleChecked: '',
|
|
74
|
-
isLoading: true,
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
computed: {
|
|
78
|
-
checkIds() {
|
|
79
|
-
return this.currValue.map(item => item.id)
|
|
80
|
-
},
|
|
81
|
-
isAllCheck() {
|
|
82
|
-
if (this.roleUserList.length === 0) return false
|
|
83
|
-
return this.roleUserList.every(item => item.checked)
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
methods: {
|
|
87
|
-
init(widget, value) {
|
|
88
|
-
this.roleSelectShow = true
|
|
89
|
-
this.isLoading = true
|
|
90
|
-
if (widget.options.departRelation) {
|
|
91
|
-
const userInfo = uni.getStorageSync('userinfo')
|
|
92
|
-
console.log("userInfo: ", userInfo)
|
|
93
|
-
this.depId = userInfo.departId || userInfo.depart_id
|
|
94
|
-
}
|
|
95
|
-
this.role = widget.options.role
|
|
96
|
-
this.multiple = widget.options.multiple
|
|
97
|
-
this.currValue = cloneObj(value || [])
|
|
98
|
-
this.$u.get('/sys/role/list', {
|
|
99
|
-
pageNo: 1,
|
|
100
|
-
pageSize: 100000,
|
|
101
|
-
}).then(res => {
|
|
102
|
-
this.rolesList = res.result.records.filter((item) => {
|
|
103
|
-
return this.role.includes(item.id);
|
|
104
|
-
})
|
|
105
|
-
}).finally(() => {
|
|
106
|
-
this.isLoading = false
|
|
107
|
-
})
|
|
108
|
-
},
|
|
109
|
-
removeClick(val) {
|
|
110
|
-
this.currValue = this.currValue.filter(item => item.id !== val.id)
|
|
111
|
-
const len = this.roleUserList
|
|
112
|
-
this.roleUserList.checked = this.roleUserList.filter((item, idx) => {
|
|
113
|
-
if (val.id === item.id) this.$set(item, 'checked', false )
|
|
114
|
-
return item.checked
|
|
115
|
-
}).length === len
|
|
116
|
-
},
|
|
117
|
-
handleCheck({value , name}) {
|
|
118
|
-
console.log(value, name)
|
|
119
|
-
if (!this.multiple) {
|
|
120
|
-
this.currValue = []
|
|
121
|
-
this.roleUserList = this.roleUserList.map((item, idx) => {
|
|
122
|
-
item.checked = false
|
|
123
|
-
return item
|
|
124
|
-
})
|
|
125
|
-
}
|
|
126
|
-
if (!value) {
|
|
127
|
-
this.currValue = this.currValue.filter(item => item.id != name)
|
|
128
|
-
}
|
|
129
|
-
const len = this.roleUserList
|
|
130
|
-
this.roleUserList.checked = this.roleUserList.filter((item, idx) => {
|
|
131
|
-
if (item.id === name) {
|
|
132
|
-
if (value && !this.checkIds.includes(item.id)) {
|
|
133
|
-
this.currValue.push(item)
|
|
134
|
-
}
|
|
135
|
-
this.$set(item, 'checked', value)
|
|
136
|
-
return value
|
|
137
|
-
}
|
|
138
|
-
return item.checked
|
|
139
|
-
}).length === len
|
|
140
|
-
console.log(this.currValue)
|
|
141
|
-
},
|
|
142
|
-
|
|
143
|
-
handleSelectRoleUserOk() {
|
|
144
|
-
this.roleSelectShow = false
|
|
145
|
-
// let checked = this.roleUserList.filter(item => {
|
|
146
|
-
// if (item.checked) return item
|
|
147
|
-
// })
|
|
148
|
-
//
|
|
149
|
-
// let ids = []
|
|
150
|
-
// checked = checked.concat(this.currValue).filter(item => {
|
|
151
|
-
// if (ids[item.id]) return false
|
|
152
|
-
// ids[item.id] = true
|
|
153
|
-
// return item
|
|
154
|
-
// })
|
|
155
|
-
|
|
156
|
-
this.$emit("ok", this.currValue)
|
|
157
|
-
},
|
|
158
|
-
roleCheckAll({value}) {
|
|
159
|
-
this.roleUserList.checked != this.roleUserList.checked
|
|
160
|
-
if (value) {
|
|
161
|
-
this.roleUserList.forEach(item => {
|
|
162
|
-
if (!this.checkIds.includes(item.id)) {
|
|
163
|
-
this.currValue.push(item)
|
|
164
|
-
}
|
|
165
|
-
this.$set(item, 'checked', value)
|
|
166
|
-
})
|
|
167
|
-
}
|
|
168
|
-
if (!value) {
|
|
169
|
-
this.roleUserList.forEach(item => {
|
|
170
|
-
this.currValue = this.currValue.filter(curr => curr.id !== item.id)
|
|
171
|
-
})
|
|
172
|
-
}
|
|
173
|
-
},
|
|
174
|
-
roleChange(roleId) {
|
|
175
|
-
this.isLoading = true
|
|
176
|
-
this.$u.get('/formApi/listFormUserByRole', {
|
|
177
|
-
pageNo: 1,
|
|
178
|
-
pageSize: 100000,
|
|
179
|
-
depId: this.depId,
|
|
180
|
-
roleId
|
|
181
|
-
}).then(res => {
|
|
182
|
-
this.roleUserList = res.result.records.filter(item => {
|
|
183
|
-
item.checked = this.checkIds.includes(item.id)
|
|
184
|
-
return item
|
|
185
|
-
})
|
|
186
|
-
}).finally( () => {
|
|
187
|
-
this.$nextTick(() => {
|
|
188
|
-
this.isLoading = false
|
|
189
|
-
})
|
|
190
|
-
})
|
|
191
|
-
|
|
192
|
-
},
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
</script>
|
|
196
|
-
|
|
197
|
-
<style scoped>
|
|
198
|
-
/deep/ u-th:nth-child(1) {
|
|
199
|
-
flex: 0 0 40px;
|
|
200
|
-
}
|
|
201
|
-
/deep/ u-th {
|
|
202
|
-
flex: 1;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
.role-select-body {
|
|
207
|
-
display: flex;
|
|
208
|
-
flex-direction: column;
|
|
209
|
-
}
|
|
210
|
-
</style>
|