|
|
|
|
@ -4,7 +4,7 @@
|
|
|
|
|
<el-form-item :label="t('DataCollection.Device.attributeCode')" prop="attributeCode">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="formData.attributeCode" :placeholder="t('DataCollection.Device.placeholderAttributeCode')"
|
|
|
|
|
@input="handleAttributeCodeInput" :disabled="formType === 'update'" />
|
|
|
|
|
:disabled="formType === 'update'" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item :label="t('DataCollection.Device.attributeName')" prop="attributeName">
|
|
|
|
|
<el-input v-model="formData.attributeName" :placeholder="t('DataCollection.Device.placeholderAttributeName')" />
|
|
|
|
|
@ -95,10 +95,6 @@ const formData = ref({
|
|
|
|
|
deviceId: undefined as number | undefined
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const handleAttributeCodeInput = (val: string) => {
|
|
|
|
|
const sanitized = (val || '').replace(/[^A-Za-z0-9_]/g, '')
|
|
|
|
|
formData.value.attributeCode = sanitized.replace(/^[0-9]+/, '')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|