时间控件
This commit is contained in:
@@ -54,7 +54,11 @@
|
||||
<el-row :gutter="24" >
|
||||
<el-col :span="8">
|
||||
<el-form-item label="生产日期" prop="createDate">
|
||||
<el-input v-model='formContent.createDate' placeholder="请输入生产日期"/>
|
||||
<el-date-picker
|
||||
v-model="formContent.createDate"
|
||||
type="datetime"
|
||||
placeholder="请选择生产日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
@@ -75,22 +79,21 @@
|
||||
</el-row>
|
||||
<el-row :gutter="24" >
|
||||
<el-col :span="8">
|
||||
<el-form-item label='通讯协议' prop='devType'>
|
||||
<el-select v-model="formContent.devType" clearable placeholder="请选择通讯协议">
|
||||
<el-form-item label='通讯协议' prop='protocol'>
|
||||
<el-select v-model="formContent.protocol" clearable placeholder="请选择通讯协议">
|
||||
<el-option
|
||||
v-for="item in dictStore.getDictData('High_Cate')"
|
||||
v-for="item in dictStore.getDictData('Event_Type')"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="IP地址" prop="ip">
|
||||
<!-- <el-input v-model='formContent.ip'/> -->
|
||||
<abc v-model:value="formContent.ip"/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
@@ -101,13 +104,9 @@
|
||||
<el-col :span="8">
|
||||
<el-form-item label='是否加密' prop='encryption'>
|
||||
<el-select v-model="formContent.encryption" clearable placeholder="请选择是否加密">
|
||||
<el-option
|
||||
v-for="item in dictStore.getDictData('High_Cate')"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
<el-option label="是" :value="1"></el-option>
|
||||
<el-option label="否" :value="0"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -154,7 +153,8 @@
|
||||
import { computed, type Ref, ref } from 'vue';
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
import { CirclePlus, Delete } from '@element-plus/icons-vue'
|
||||
import { el } from 'element-plus/es/locale';
|
||||
// 使用 dayjs 库格式化
|
||||
import dayjs from 'dayjs';
|
||||
const dictStore = useDictStore()
|
||||
// 定义弹出组件元信息
|
||||
const dialogFormRef = ref()
|
||||
@@ -175,9 +175,10 @@
|
||||
createId: '',
|
||||
hardwareVersion: '',
|
||||
softwareVersion: '',
|
||||
protocol: '',
|
||||
ip: '',
|
||||
port: 0,
|
||||
encryption: '',
|
||||
encryption: 1,
|
||||
reCheckNum:0,
|
||||
state: 1,
|
||||
})
|
||||
@@ -200,9 +201,10 @@
|
||||
createId: '',
|
||||
hardwareVersion: '',
|
||||
softwareVersion: '',
|
||||
protocol: '',
|
||||
ip: '',
|
||||
port: 0,
|
||||
encryption: '',
|
||||
encryption: 1,
|
||||
reCheckNum:0,
|
||||
state: 1,
|
||||
}
|
||||
@@ -244,6 +246,7 @@
|
||||
try {
|
||||
dialogFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
formContent.value.createDate = dayjs(formContent.value.createDate).format('YYYY-MM-DD HH:mm:ss');
|
||||
if (formContent.value.id) {
|
||||
updatePqDev(formContent.value).then(result => {
|
||||
if(result.code != 'A0000'){
|
||||
@@ -276,7 +279,7 @@
|
||||
titleType.value = sign
|
||||
dialogVisible.value = true
|
||||
if (data.id) {
|
||||
data.createDate = data.createDate.replace('T', ' ')
|
||||
|
||||
formContent.value = { ...data }
|
||||
} else {
|
||||
resetFormContent()
|
||||
|
||||
Reference in New Issue
Block a user