diff --git a/manifest.json b/manifest.json index 1729a0c..afd0a1b 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "name" : "海驰24", - "appid" : "__UNI__C30329B", + "appid" : "__UNI__F8B45C3", "description" : "111", "versionName" : "1.2.6", "versionCode" : 106, diff --git a/package_a/device/device.vue b/package_a/device/device.vue index 3d9eb0a..c8ee2a5 100644 --- a/package_a/device/device.vue +++ b/package_a/device/device.vue @@ -17,7 +17,7 @@ 设备型号: - {{ item.deviceModel || '-' }} + {{ getDeviceModelLabel(item.deviceModel) || '-' }} @@ -62,7 +62,14 @@ 设备型号 - + + {{ modelIndex !== -1 ? deviceModels[modelIndex].label : '请选择设备型号' }} + + + + + 通道 + @@ -101,12 +108,19 @@ export default { ], typeIndex: -1, + deviceModels: [ + { label: '单机(IPC)', value: '1' }, + { label: '主机(NVR)', value: '2' } + ], + modelIndex: -1, + form: { deviceCode: '', deviceName: '', deviceType: '', deviceBrand: '', deviceModel: '', + channel: '', remark: '' } } @@ -129,6 +143,11 @@ export default { goBack() { uni.navigateBack(); }, + getDeviceModelLabel(modelValue) { + if (!modelValue && modelValue !== 0) return ''; + const match = this.deviceModels.find(m => m.value == modelValue); + return match ? match.label : modelValue; + }, fetchDeviceList() { this.loading = true; getDeviceList(this.storeId).then(res => { @@ -158,9 +177,11 @@ export default { deviceType: '', deviceBrand: '', deviceModel: '', + channel: '', remark: '' }; this.typeIndex = -1; + this.modelIndex = -1; this.$refs.addPopup.open(); }, closeAddDialog() { @@ -170,6 +191,10 @@ export default { this.typeIndex = e.detail.value; this.form.deviceType = this.deviceTypes[this.typeIndex].value; }, + onModelChange(e) { + this.modelIndex = e.detail.value; + this.form.deviceModel = this.deviceModels[this.modelIndex].value; + }, submitAdd() { if (!this.form.deviceCode) { return uni.showToast({ title: '请输入设备编号', icon: 'none' });