@zscreate/zhxy-app-component 1.0.214 → 1.0.216
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.
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
<view class="form-item"
|
|
3
3
|
:class="{ showFalse: showFalse, isScroll: isScroll, isCorrected: widget.options.isCorrected ? true : false }"
|
|
4
4
|
@click="resetShowFalse">
|
|
5
|
-
<view v-if="widget.options.isCorrected" class="correctedWrap">
|
|
6
|
-
|
|
5
|
+
<view v-if="widget.options.isCorrected" class="editCorrent correctedWrap" >
|
|
6
|
+
<view @click.native="CorrentItem">原值是: {{ correctOldValue(widget.options.oldValue) }}</view>
|
|
7
7
|
</view>
|
|
8
8
|
<view class="editCorrent"
|
|
9
|
-
v-if="isCorrect && widget.options.canCorrect"
|
|
9
|
+
v-else-if="isCorrect && widget.options.canCorrect"
|
|
10
10
|
@click.stop="CorrentItem">
|
|
11
11
|
<!-- ===undefined兼容老版本表单 -->
|
|
12
12
|
<text style="color: #4480E3">纠错</text>
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
</view>
|
|
66
66
|
<textarea v-else maxlength="9999999" class="form-input cover-text" v-model="dataModel"
|
|
67
67
|
:style="{ height: (widget.options.height || 100) * 2 + 'px'}"
|
|
68
|
-
|
|
68
|
+
placeholder-class="form-input-placeholder"
|
|
69
69
|
:placeholder="widget.options.placeholder" :disabled="widget.options.disabled">
|
|
70
70
|
</textarea>
|
|
71
71
|
</view>
|
|
@@ -261,7 +261,7 @@
|
|
|
261
261
|
{{ widget.name }}
|
|
262
262
|
</view>
|
|
263
263
|
<view class="evan-form-item-container__main" :style="mContentStyle">
|
|
264
|
-
<unploadFile :widget="widget" :action="getUploadFileUrl(widget)" @filePost="filePost" @fileDelete="fileDelete"
|
|
264
|
+
<unploadFile :widget="widget" ref="imgUpload" :action="getUploadFileUrl(widget)" @filePost="filePost" @fileDelete="fileDelete"
|
|
265
265
|
:defaultImg="dataModel"></unploadFile>
|
|
266
266
|
</view>
|
|
267
267
|
</view>
|
|
@@ -301,7 +301,7 @@
|
|
|
301
301
|
{{ widget.name }}
|
|
302
302
|
</view>
|
|
303
303
|
<view class="evan-form-item-container__main" :style="mContentStyle">
|
|
304
|
-
<lb-picker style="width: 100%" :placeholder="widget.options.placeholder" ref="
|
|
304
|
+
<lb-picker style="width: 100%" :placeholder="widget.options.placeholder" ref="lb_picker" v-model="dataModel"
|
|
305
305
|
@change="cityChecked" :value="widget.options.defaultValue" :disabled="widget.options.disabled">
|
|
306
306
|
</lb-picker>
|
|
307
307
|
</view>
|
|
@@ -722,6 +722,7 @@ export default {
|
|
|
722
722
|
checkboxAndRadioOptions: [],
|
|
723
723
|
selectedData: [],
|
|
724
724
|
locationInfo: {},
|
|
725
|
+
correctObj: undefined
|
|
725
726
|
}
|
|
726
727
|
},
|
|
727
728
|
mounted() {
|
|
@@ -781,6 +782,15 @@ export default {
|
|
|
781
782
|
uni.$off(this.widget.model);
|
|
782
783
|
},
|
|
783
784
|
methods: {
|
|
785
|
+
correctOldValue(oldValue) {
|
|
786
|
+
const type = this.widget.type
|
|
787
|
+
if (Array.isArray(oldValue) && oldValue.length === 0) return '【空】'
|
|
788
|
+
if (type === 'switch') return Boolean(oldValue) ? 'true' : 'false'
|
|
789
|
+
if (type === 'slider') return Number(oldValue || 0)
|
|
790
|
+
|
|
791
|
+
const res = ['', undefined, null].includes(oldValue) ? '【空】': oldValue
|
|
792
|
+
return res.length > 10 ? res.substring(0, 10) + '...' : res
|
|
793
|
+
},
|
|
784
794
|
numberBoxPlus(e) {
|
|
785
795
|
console.log(e, this.dataModel);
|
|
786
796
|
this.dataModel = this.widget.options.step ? e.value + this.widget.options.step : e.value + 1
|
|
@@ -1067,13 +1077,105 @@ export default {
|
|
|
1067
1077
|
getApp().globalData.correntFormData
|
|
1068
1078
|
getApp().globalData.correntWidget = {
|
|
1069
1079
|
...this.widget,
|
|
1070
|
-
dataModel: this.dataModel
|
|
1080
|
+
dataModel: this.dataModel,
|
|
1081
|
+
correctInfo: {
|
|
1082
|
+
isSubTable: this.tableKey ? 1 : 0, //是否纠错子表单 0否 1是
|
|
1083
|
+
subTableCode: this.tableKey, //新增纠错子表名
|
|
1084
|
+
correctIndex: this.tableIndex, //新增纠错索引
|
|
1085
|
+
},
|
|
1086
|
+
setCorrectData: (correctObj) => {
|
|
1087
|
+
const { oldValue: oldVal, newDataObj: newVal } = correctObj
|
|
1088
|
+
this.correctObj = correctObj
|
|
1089
|
+
console.log('setCorrectData', correctObj)
|
|
1090
|
+
if (['checkbox', 'radio'].includes(this.widget.type)) {
|
|
1091
|
+
correctObj.dictOptions = this.checkboxAndRadioOptions
|
|
1092
|
+
}
|
|
1093
|
+
this.setCorrectStatus(correctObj)
|
|
1094
|
+
|
|
1095
|
+
// const options = this.widget.options
|
|
1096
|
+
this.dataModel = newVal
|
|
1097
|
+
// if (!options.isCorrected) {
|
|
1098
|
+
// this.$set(this.widget.options, 'isCorrected', true)
|
|
1099
|
+
// this.widget.options.oldValue = oldVal
|
|
1100
|
+
// }
|
|
1101
|
+
setTimeout(() => {
|
|
1102
|
+
if (this.widget.type === 'imgupload') this.$refs.imgUpload.showImage()
|
|
1103
|
+
}, 0)
|
|
1104
|
+
},
|
|
1071
1105
|
}
|
|
1072
1106
|
console.log(getApp().globalData.correntWidget)
|
|
1073
|
-
Pubsub.
|
|
1074
|
-
|
|
1107
|
+
Pubsub.publish('correct_item', {
|
|
1108
|
+
originData: getApp().globalData.correntWidget,
|
|
1109
|
+
correctObj: this.correctObj
|
|
1075
1110
|
})
|
|
1076
|
-
|
|
1111
|
+
},
|
|
1112
|
+
setCorrectStatus(correctObj) {
|
|
1113
|
+
try {
|
|
1114
|
+
if (this.widget.options.oldValue === undefined) {
|
|
1115
|
+
// 如果当前oldValue为undefined,说明是第一次纠错,需要保存一下oldValue;之后oldValue值不变
|
|
1116
|
+
let oldValue = this.tableKey
|
|
1117
|
+
? this.models[this.tableKey][this.tableIndex][this.widget.model]
|
|
1118
|
+
: this.models[this.widget.model];
|
|
1119
|
+
|
|
1120
|
+
if (correctObj.oldValue) oldValue = correctObj.oldValue
|
|
1121
|
+
// 获取select radio select 字典信息
|
|
1122
|
+
const dictOptions = correctObj.dictOptions
|
|
1123
|
+
|
|
1124
|
+
const getOldValue = (oldValue, keyName) => {
|
|
1125
|
+
if (!Array.isArray(oldValue)) return ""
|
|
1126
|
+
return Array.isArray(oldValue) ? oldValue.reduce((i, j) => j[keyName] + "," + i, "").slice(0, -1) : ""
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
const getDictValue = (oldValue) => {
|
|
1130
|
+
if (!Array.isArray(oldValue)) {
|
|
1131
|
+
const findItem = dictOptions.find( item => item.value === oldValue)
|
|
1132
|
+
if (findItem) {
|
|
1133
|
+
return findItem.text || findItem.label
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
if (!Array.isArray(oldValue)) return ""
|
|
1137
|
+
return oldValue.reduce((i, j) => {
|
|
1138
|
+
const findItem = dictOptions.find( item => item.value === j)
|
|
1139
|
+
if (findItem) return (findItem['text'] || findItem['label']) + "," + i
|
|
1140
|
+
}, "").slice(0, -1)
|
|
1141
|
+
}
|
|
1142
|
+
if (oldValue) {
|
|
1143
|
+
switch (this.widget.type) {
|
|
1144
|
+
case "cascader":
|
|
1145
|
+
oldValue = correctObj.cascaderLabel
|
|
1146
|
+
break;
|
|
1147
|
+
case "userSelectorByRole":
|
|
1148
|
+
case "userSelector":
|
|
1149
|
+
oldValue = Array.isArray(oldValue) ? oldValue.reduce((i, j) => i + " " + (j.realname || j.username), "") : ""
|
|
1150
|
+
break
|
|
1151
|
+
case 'time':
|
|
1152
|
+
oldValue = Array.isArray(oldValue) ? oldValue.reduce((i, j) => i + " " + j, '') : oldValue
|
|
1153
|
+
break
|
|
1154
|
+
case 'radio':
|
|
1155
|
+
case 'checkbox':
|
|
1156
|
+
case "select":
|
|
1157
|
+
oldValue = getDictValue(oldValue)
|
|
1158
|
+
break
|
|
1159
|
+
case "imgupload":
|
|
1160
|
+
case "fileupload":
|
|
1161
|
+
oldValue = getOldValue(correctObj['oldValue'], 'name')
|
|
1162
|
+
break
|
|
1163
|
+
case "deptSelector":
|
|
1164
|
+
oldValue = getOldValue(oldValue, 'departName')
|
|
1165
|
+
break
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
console.log(oldValue)
|
|
1169
|
+
this.$set(this.widget.options, "oldValue", oldValue);
|
|
1170
|
+
}
|
|
1171
|
+
this.$set(this.widget.options, "isCorrected", true);
|
|
1172
|
+
// this.updateModels(correctObj.newDataObj);
|
|
1173
|
+
} catch (err) {
|
|
1174
|
+
console.log(err);
|
|
1175
|
+
} finally {
|
|
1176
|
+
correctObj.dictOptions = []
|
|
1177
|
+
correctObj.cascaderLabel = undefined
|
|
1178
|
+
}
|
|
1077
1179
|
},
|
|
1078
1180
|
/****更新*userSelector**/
|
|
1079
1181
|
updateUserSelectorModal() {
|
|
@@ -1681,6 +1783,12 @@ export default {
|
|
|
1681
1783
|
if (this.widget.type === 'deptSelector') {
|
|
1682
1784
|
this.updatedeptSelectorModal()
|
|
1683
1785
|
}
|
|
1786
|
+
if (['select', 'radio', 'checkbox'].includes(this.widget.type) ) {
|
|
1787
|
+
this.updatedSelectModal()
|
|
1788
|
+
}
|
|
1789
|
+
if (this.widget.type === 'userSelectorByRole' ) {
|
|
1790
|
+
this.handleSelectRoleUserOk(v)
|
|
1791
|
+
}
|
|
1684
1792
|
if (this.widget.type === 'number') {
|
|
1685
1793
|
const { max, min } = this.widget.options
|
|
1686
1794
|
if ((max || max === 0) && v > max) {
|
|
@@ -2061,5 +2169,9 @@ checkbox-group label {
|
|
|
2061
2169
|
.uni-list-cell::after {
|
|
2062
2170
|
z-index: 0 !important;
|
|
2063
2171
|
}
|
|
2172
|
+
|
|
2173
|
+
::v-deep .uni-slider-thumb {
|
|
2174
|
+
z-index: 1;
|
|
2175
|
+
}
|
|
2064
2176
|
</style>
|
|
2065
2177
|
|
|
@@ -87,14 +87,17 @@
|
|
|
87
87
|
this.getEcho()
|
|
88
88
|
},
|
|
89
89
|
watch: {
|
|
90
|
-
value(
|
|
91
|
-
|
|
90
|
+
value(oldVal,newVal) {
|
|
91
|
+
if (JSON.stringify(oldVal) !== JSON.stringify(newVal)) {
|
|
92
|
+
this.getdata(this.list, 0)
|
|
93
|
+
}
|
|
94
|
+
// this.bindChange({ detail: {value: v}})
|
|
95
|
+
// this.handleOk()
|
|
92
96
|
}
|
|
93
97
|
},
|
|
94
98
|
methods: {
|
|
95
99
|
bindChange: function(e) {
|
|
96
100
|
const val = e.detail.value
|
|
97
|
-
console.log(1)
|
|
98
101
|
if (val[0] != this.indexList[0]) {
|
|
99
102
|
this.indexList[0] = val[0];
|
|
100
103
|
this.indexList[1] = 0;
|
|
@@ -129,6 +132,7 @@
|
|
|
129
132
|
* @param {Number} xindex 第几级数据
|
|
130
133
|
* **/
|
|
131
134
|
async getdata(list, xindex) {
|
|
135
|
+
if (xindex === 0) this.cityLabel = []
|
|
132
136
|
if (xindex > this.value.length-1) return;
|
|
133
137
|
for (var j = 0; j < list.length; j++) {
|
|
134
138
|
if (list[j].value == this.value[xindex]) {
|
|
@@ -149,13 +153,24 @@
|
|
|
149
153
|
},
|
|
150
154
|
//获得一级
|
|
151
155
|
init() {
|
|
152
|
-
|
|
156
|
+
return new Promise(resolve => {
|
|
157
|
+
if (Vue.prototype.data_listProvince) return resolve(Vue.prototype.data_listProvince)
|
|
158
|
+
this.$u.get('/sys/dict/listProvince').then( res => {
|
|
159
|
+
Vue.prototype.data_listProvince = res
|
|
160
|
+
resolve(res)
|
|
161
|
+
})
|
|
162
|
+
})
|
|
153
163
|
},
|
|
154
164
|
//请求下级
|
|
155
165
|
getnext(id) {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
166
|
+
if (!Vue.prototype.data_listAreaByCode) Vue.prototype.data_listAreaByCode = {}
|
|
167
|
+
return new Promise(resolve => {
|
|
168
|
+
if (Vue.prototype.data_listAreaByCode[id]) return resolve(Vue.prototype.data_listAreaByCode[id])
|
|
169
|
+
this.$u.get('/sys/dict/listAreaByCode', {code: id}).then( res => {
|
|
170
|
+
Vue.prototype.data_listAreaByCode[id] = res
|
|
171
|
+
resolve(res)
|
|
172
|
+
})
|
|
173
|
+
})
|
|
159
174
|
},
|
|
160
175
|
handleclick() {
|
|
161
176
|
if (this.disabled) return false;
|
|
@@ -85,7 +85,6 @@ export default {
|
|
|
85
85
|
},
|
|
86
86
|
|
|
87
87
|
methods: {
|
|
88
|
-
|
|
89
88
|
handleClick() {
|
|
90
89
|
if (this.uploadIng) {
|
|
91
90
|
return uni.showToast({
|
|
@@ -196,23 +195,27 @@ export default {
|
|
|
196
195
|
});
|
|
197
196
|
},
|
|
198
197
|
showImage() {
|
|
199
|
-
this
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
...item,
|
|
206
|
-
};
|
|
207
|
-
tempItem.url = this.uniEnv.imgUrl + tempItem.url;
|
|
208
|
-
if (tempItem.fileId) {
|
|
209
|
-
tempItem.url = (this.uniEnv.BASE_API || this.uniEnv.apiUrl) + `/sys/common/downloadZip?fileId=${tempItem.fileId}&openId=${this.openId}&token=${this.header['X-Access-Token']}`
|
|
210
|
-
}
|
|
211
|
-
return tempItem;
|
|
212
|
-
})
|
|
198
|
+
this.$nextTick(() => {
|
|
199
|
+
this.$refs.uUpload.lists = []
|
|
200
|
+
this.fileList = []
|
|
201
|
+
this.emitList = cloneObj(this.defaultImg || [])
|
|
202
|
+
this.showProgress = false;
|
|
203
|
+
if (this.emitList && this.emitList.length && this.emitList.length > 0) {
|
|
213
204
|
|
|
214
|
-
|
|
215
|
-
|
|
205
|
+
this.fileList = this.emitList
|
|
206
|
+
.map((item, index) => {
|
|
207
|
+
let tempItem = {
|
|
208
|
+
...item,
|
|
209
|
+
};
|
|
210
|
+
tempItem.url = this.uniEnv.imgUrl + tempItem.url;
|
|
211
|
+
if (tempItem.fileId) {
|
|
212
|
+
tempItem.url = (this.uniEnv.BASE_API || this.uniEnv.apiUrl) + `/sys/common/downloadZip?fileId=${tempItem.fileId}&openId=${this.openId}&token=${this.header['X-Access-Token']}`
|
|
213
|
+
}
|
|
214
|
+
return tempItem;
|
|
215
|
+
})
|
|
216
|
+
console.log('fileList:', this.fileList)
|
|
217
|
+
}
|
|
218
|
+
})
|
|
216
219
|
},
|
|
217
220
|
initWidget() {
|
|
218
221
|
//action url
|
|
@@ -313,4 +316,7 @@ export default {
|
|
|
313
316
|
.u-add-wrap__hover {
|
|
314
317
|
background-color: rgb(235, 236, 238);
|
|
315
318
|
}
|
|
319
|
+
/deep/ .u-delete-icon {
|
|
320
|
+
z-index: 1;
|
|
321
|
+
}
|
|
316
322
|
</style>
|
|
@@ -31,8 +31,11 @@
|
|
|
31
31
|
<u-tr v-for="user in roleUserList" :key="user.id">
|
|
32
32
|
<u-td width="50px" >
|
|
33
33
|
<view style="min-width: 33px;">
|
|
34
|
-
<u-checkbox v-model="user.checked" @change="handleCheck" :name="user.id" >
|
|
34
|
+
<u-checkbox v-model="user.checked" @change="handleCheck" :name="user.id" v-if="multiple">
|
|
35
35
|
</u-checkbox>
|
|
36
|
+
<u-radio-group v-model="radioItem" v-else>
|
|
37
|
+
<u-radio @change="handleCheckRadio" :name="user.id" class="table-radio"></u-radio>
|
|
38
|
+
</u-radio-group>
|
|
36
39
|
</view>
|
|
37
40
|
</u-td>
|
|
38
41
|
<u-td style="flex: 1"><view>{{ user.realname }}</view></u-td>
|
|
@@ -60,6 +63,7 @@ export default {
|
|
|
60
63
|
data() {
|
|
61
64
|
return {
|
|
62
65
|
roleSelectShow: false,
|
|
66
|
+
radioItem: '',
|
|
63
67
|
rolesList: [],
|
|
64
68
|
roleUserList: [],
|
|
65
69
|
currValue: [],
|
|
@@ -102,6 +106,7 @@ export default {
|
|
|
102
106
|
this.role = widget.options.role
|
|
103
107
|
this.multiple = widget.options.multiple
|
|
104
108
|
this.currValue = cloneObj(value || [])
|
|
109
|
+
if(!this.multiple) this.radioItem = this.currValue[0].id
|
|
105
110
|
this.$u.get('/sys/role/list', {
|
|
106
111
|
pageNo: 1,
|
|
107
112
|
pageSize: 100000,
|
|
@@ -122,6 +127,17 @@ export default {
|
|
|
122
127
|
return item.checked
|
|
123
128
|
}).length === len
|
|
124
129
|
},
|
|
130
|
+
handleCheckRadio(e) {
|
|
131
|
+
this.radioItem = e
|
|
132
|
+
console.log(e,this.radioItem)
|
|
133
|
+
this.roleUserList.forEach(item => item.checked = false)
|
|
134
|
+
this.roleUserList.forEach(item => {
|
|
135
|
+
if(item.id === e) {
|
|
136
|
+
item.checked = true
|
|
137
|
+
this.currValue = [item]
|
|
138
|
+
}
|
|
139
|
+
})
|
|
140
|
+
},
|
|
125
141
|
handleCheck({value , name}) {
|
|
126
142
|
console.log(value, name)
|
|
127
143
|
if (!this.multiple) {
|
|
@@ -215,6 +231,9 @@ export default {
|
|
|
215
231
|
/deep/ .u-checkbox__label {
|
|
216
232
|
display: none !important;
|
|
217
233
|
}
|
|
234
|
+
/deep/ .table-radio .u-radio__label {
|
|
235
|
+
display: none !important;
|
|
236
|
+
}
|
|
218
237
|
.role-select-body {
|
|
219
238
|
display: flex;
|
|
220
239
|
flex-direction: column;
|