From 1a0e4972f80278bfa9e53283374b745b6c968341 Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期二, 13 八月 2024 17:30:57 +0800 Subject: [PATCH] 设备信息管理模块 --- pages/inspection/scene/info/device-info-items.js | 80 +++++++++++++++++++++++++-------------- 1 files changed, 51 insertions(+), 29 deletions(-) diff --git a/pages/inspection/scene/info/device-info-items.js b/pages/inspection/scene/info/device-info-items.js index f293483..e3b9907 100644 --- a/pages/inspection/scene/info/device-info-items.js +++ b/pages/inspection/scene/info/device-info-items.js @@ -1,3 +1,4 @@ +import { baseInputItem, hideInputItem, setDefaultValue } from "../../../../components/form/form-util.js"; import { monitorDevices } from '../../../../common/dataMonitorDeviceType'; import { treatmentDevices } from '../../../../common/dataTreatmentDeviceType'; import { productionDevices } from '../../../../common/dataProductionDeviceType'; @@ -6,38 +7,30 @@ import { ownership } from '../../../../common/dataOwnership'; /** - * 鐢熸垚涓�鏉¤〃鍗曟潯鐩� - * @param {String} _label 鏍囩鍚嶇О - * @param {String} _name 瀛楁鍚嶇О - * @param {String} _type 杈撳叆绫诲瀷 锛坱ext: 杈撳叆妗�; switch: 鍒囨崲鎸夐挳; picker: 涓嬫媺妗嗛�夐」; cascader: 绾ц仈閫夋嫨锛� - * @param {Boolean} _required 鏄惁涓哄繀濉」 - * @param {Array} _options 褰撹緭鍏ョ被鍨嬩负picker鏃讹紝鎻愪緵鍙�夐」 - */ -function baseInputItem(_label, _name, _required, _type = 'text', _options = []) { - return { - required: _required, - label: _label, - placeholder: (_type == 'text' ? '璇疯緭鍏�' : '璇烽�夋嫨') + _label, - name: _name, - value: null, - status: 'success', - tips: _label + '涓嶈兘涓虹┖', - inputType: _type, - options: _options, - cascaderTitles: ['1', '2'], - visible: false, - }; -} - -/** * 鐩戞祴璁惧琛ㄥ崟 + * @param {Number} sceneType 鍦烘櫙绫诲瀷锛堥缇界洃绠$郴缁燂級 + * @param {Object} defaultValue 琛ㄥ崟榛樿鍊� */ -export function monitorDeviceForm(sceneType) { - return [ +export function monitorDeviceForm(sceneType, defaultValue) { + const items = [ + hideInputItem('id', 'diId'), + hideInputItem('鍒涘缓鏃堕棿', 'diCreateTime'), + hideInputItem('鏇存柊鏃堕棿', 'diUpdateTime'), + hideInputItem('鍦烘櫙id', 'diSceneGuid'), + hideInputItem('鍦烘櫙绫诲瀷', 'diSceneTypeId'), + baseInputItem('绔欑偣鍚嶇О', 'diName', true), baseInputItem('璁惧缂栧彿', 'diDeviceCode'), // 璁惧绫诲瀷鍜岃澶囧瓙绫诲悎骞剁敤绾ц仈閫夋嫨鍣ㄥ睍绀� - baseInputItem('璁惧绫诲瀷', '_type', true, 'cascader', monitorDevices(sceneType)), + baseInputItem( + '璁惧绫诲瀷', + '_type', + true, + 'cascader', + monitorDevices(sceneType), + ['閫夋嫨璁惧绫诲瀷', '閫夋嫨璁惧瀛愮被'], + ['diTypeId', 'diSubtypeId'], + ), // baseInputItem('璁惧绫诲瀷', 'diTypeId', true, 'picker'), // baseInputItem('璁惧瀛愮被', 'diSubtypeId', true, 'picker'), baseInputItem('渚涘簲鍟�', 'diSupplier'), @@ -54,12 +47,17 @@ // baseInputItem('鏍囪瘑浜岀淮鐮�', 'DI_QR_Code'), // baseInputItem('鍏朵粬绗笁鏂规垨璁惧鑷甫浜岀淮鐮�', 'DI_Other_QR_Code'), ]; + + // 濉厖榛樿鏁版嵁 + setDefaultValue(items, defaultValue); + + return items; } /** * 娌荤悊璁惧琛ㄥ崟 */ -export function treatmentDeviceForm(sceneType) { +export function treatmentDeviceForm(sceneType, defaultValue) { return [ baseInputItem('绔欑偣鍚嶇О', 'diName', true), baseInputItem('璁惧缂栧彿', 'diDeviceCode'), @@ -74,7 +72,7 @@ /** * 鐢熶骇璁惧琛ㄥ崟 */ -export function productionDeviceForm(sceneType) { +export function productionDeviceForm(sceneType, defaultValue) { return [ baseInputItem('绔欑偣鍚嶇О', 'diName', true), baseInputItem('璁惧缂栧彿', 'diDeviceCode'), @@ -85,3 +83,27 @@ baseInputItem('鏄惁鎷嗛櫎', 'diRemoved', true, 'switch'), ]; } + +/** + * 璁惧鐘舵�佽〃鍗� + */ +export function deviceStatusForm(defaultValue) { + return [ + hideInputItem('id', 'dlId'), + hideInputItem('璁惧id', 'dlDeviceId'), + hideInputItem('璁惧绫诲瀷', 'dlDeviceType'), + hideInputItem('鍦烘櫙id', 'dlSceneGuid'), + hideInputItem('鍦烘櫙绫诲瀷', 'dlSceneTypeId'), + hideInputItem('鐜板満鍥剧墖', 'dlPicUrl'), + hideInputItem('鐜板満瑙嗛', 'dlVideoUrl'), + hideInputItem('鍒涘缓鏃堕棿', 'dlCreateTime'), + hideInputItem('鏇存柊鏃堕棿', 'dlUpdateTime'), + + baseInputItem('璁惧浣嶇疆', 'DL_Location', true), + baseInputItem('缁忓害', 'DL_Longitude'), + baseInputItem('缁村害', 'DL_Latitude', true), + baseInputItem('鏄惁瑙勮寖', 'DL_Standard', true, 'switch'), + baseInputItem('涓嶈鑼冨師鍥�', 'DL_UnStandard_Reason'), + baseInputItem('杩愯鐘舵��', 'DL_Real_Time_Status', true, 'picker', status), + ]; +} \ No newline at end of file -- Gitblit v1.9.3