update 基本完成设备信息的编辑和新增
This commit is contained in:
parent
f17fab4749
commit
3e42b99996
@ -38,7 +38,11 @@
|
|||||||
:props="configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].props"
|
:props="configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].props"
|
||||||
></el-cascader>
|
></el-cascader>
|
||||||
<el-time-select v-if="getType(n, c) === 'time'" v-model="dataForm[configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].name]"></el-time-select>
|
<el-time-select v-if="getType(n, c) === 'time'" v-model="dataForm[configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].name]"></el-time-select>
|
||||||
<el-date-picker v-if="getType(n, c) === 'date'" v-model="dataForm[configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].name]"></el-date-picker>
|
<el-date-picker
|
||||||
|
v-if="getType(n, c) === 'date'"
|
||||||
|
v-bind="configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].props"
|
||||||
|
v-model="dataForm[configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].name]"
|
||||||
|
></el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -322,6 +326,8 @@ export default {
|
|||||||
return 'select'
|
return 'select'
|
||||||
} else if (['cascader'].includes(opt.type)) {
|
} else if (['cascader'].includes(opt.type)) {
|
||||||
return 'cascader'
|
return 'cascader'
|
||||||
|
} else if (['date'].includes(opt.type)) {
|
||||||
|
return 'date'
|
||||||
}
|
}
|
||||||
// add more...
|
// add more...
|
||||||
} else {
|
} else {
|
||||||
|
@ -9,8 +9,8 @@
|
|||||||
:on-preview="handleDownload"
|
:on-preview="handleDownload"
|
||||||
:on-remove="handleRemove"
|
:on-remove="handleRemove"
|
||||||
:before-upload="/.*?image.*?/i.test(extraParams.typeCode) ? validateImage : validateFile"
|
:before-upload="/.*?image.*?/i.test(extraParams.typeCode) ? validateImage : validateFile"
|
||||||
:before-remove="beforeRemove"
|
|
||||||
>
|
>
|
||||||
|
<!-- :before-remove="beforeRemove" -->
|
||||||
<!-- accept="image/*" -->
|
<!-- accept="image/*" -->
|
||||||
<!-- <el-upload class="yd-upload" :action="$http.adornUrl(url)" multiple name="files" :data="extraParams" :file-list="fileList" :on-remove="handleRemove" :before-remove="beforeRemove"> -->
|
<!-- <el-upload class="yd-upload" :action="$http.adornUrl(url)" multiple name="files" :data="extraParams" :file-list="fileList" :on-remove="handleRemove" :before-remove="beforeRemove"> -->
|
||||||
<el-button size="small" type="primary">{{ buttonContent }}</el-button>
|
<el-button size="small" type="primary">{{ buttonContent }}</el-button>
|
||||||
@ -97,7 +97,7 @@ export default {
|
|||||||
|
|
||||||
/** 大小验证,由配置文件开启 */
|
/** 大小验证,由配置文件开启 */
|
||||||
validateFile(file) {
|
validateFile(file) {
|
||||||
console.log("[*] 验证文件大小")
|
console.log('[*] 验证文件大小')
|
||||||
|
|
||||||
const isRightSize = file.size / 1024 / 1024 < 2
|
const isRightSize = file.size / 1024 / 1024 < 2
|
||||||
if (!isRightSize) {
|
if (!isRightSize) {
|
||||||
@ -109,7 +109,7 @@ export default {
|
|||||||
|
|
||||||
/** 图片验证,由配置文件开启 */
|
/** 图片验证,由配置文件开启 */
|
||||||
validateImage(file) {
|
validateImage(file) {
|
||||||
console.log("[*] 验证图片")
|
console.log('[*] 验证图片')
|
||||||
|
|
||||||
const isRightSize = file.size / 1024 / 1024 < 2
|
const isRightSize = file.size / 1024 / 1024 < 2
|
||||||
if (!isRightSize) {
|
if (!isRightSize) {
|
||||||
|
@ -66,8 +66,32 @@ const addOrUpdateConfigs = {
|
|||||||
{ name: 'abbr', label: '缩写' },
|
{ name: 'abbr', label: '缩写' },
|
||||||
{ name: 'equipmentTypeId', label: '设备类型', required: true, type: 'select', options: [] },
|
{ name: 'equipmentTypeId', label: '设备类型', required: true, type: 'select', options: [] },
|
||||||
{ name: 'groupId', label: '设备分组', required: true, type: 'select', options: [] },
|
{ name: 'groupId', label: '设备分组', required: true, type: 'select', options: [] },
|
||||||
{ name: 'productionTime', label: '生产日期' },
|
{
|
||||||
{ name: 'enterTime', label: '进厂日期' },
|
name: 'productionTime',
|
||||||
|
label: '生产日期',
|
||||||
|
type: 'date',
|
||||||
|
props: {
|
||||||
|
'type': 'date', // element-ui 的配置
|
||||||
|
'placeholder': '请选择日期',
|
||||||
|
'value-format': 'yyyy-MM-ddTHH:mm:ss',
|
||||||
|
'style': {
|
||||||
|
width: '100%'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'enterTime',
|
||||||
|
label: '进厂日期',
|
||||||
|
type: 'date',
|
||||||
|
props: {
|
||||||
|
'type': 'date', // element-ui 的配置
|
||||||
|
'placeholder': '请选择日期',
|
||||||
|
'value-format': 'yyyy-MM-ddTHH:mm:ss',
|
||||||
|
'style': {
|
||||||
|
width: '100%'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
{ name: 'tvalue', label: '设备TT值', required: true, rules: [{ type: 'number', message: '请输入正确的浮点值', trigger: 'blur', transform: val => Number(val) }] },
|
{ name: 'tvalue', label: '设备TT值', required: true, rules: [{ type: 'number', message: '请输入正确的浮点值', trigger: 'blur', transform: val => Number(val) }] },
|
||||||
{ name: 'processingTime', label: '单件产品加工时间(秒)', rules: [{ type: 'number', message: '请输入正确的数值', trigger: 'blur', transform: val => Number(val) }] },
|
{ name: 'processingTime', label: '单件产品加工时间(秒)', rules: [{ type: 'number', message: '请输入正确的数值', trigger: 'blur', transform: val => Number(val) }] },
|
||||||
{ name: 'manufacturer', label: '制造商' },
|
{ name: 'manufacturer', label: '制造商' },
|
||||||
|
Loading…
Reference in New Issue
Block a user