Browse Source

生成保养经验按钮显示问题,组件不可输入问题

master_hella_20240701
zhang_li 5 months ago
parent
commit
5b627d5557
  1. 2
      src/api/eam/repairExperience/index.ts
  2. 7
      src/components/TableForm/src/TableForm.vue
  3. 29
      src/views/eam/equipmentMaintenanceRecordMain/index.vue
  4. 28
      src/views/eam/equipmentRepairRecordMain/index.vue

2
src/api/eam/repairExperience/index.ts

@ -4,7 +4,7 @@ export interface RepairExperienceVO {
id: number id: number
name: string name: string
content: string content: string
repairNumber: string repairRecordNumber: string
} }
// 查询维修经验记录列表 // 查询维修经验记录列表

7
src/components/TableForm/src/TableForm.vue

@ -66,7 +66,7 @@
clearable clearable
:type="headerItem?.tableForm?.inputType" :type="headerItem?.tableForm?.inputType"
:placeholder="t(`ts.${headerItem?.tableForm?.placeholder || '请输入' + headerItem.label}`).replace('ts.','')" :placeholder="t(`ts.${headerItem?.tableForm?.placeholder || '请输入' + headerItem.label}`).replace('ts.','')"
:disabled="disabledInput(headerItem)" :disabled="disabledInput(headerItem,row)"
style="flex:1" style="flex:1"
@blur="inputStringBlur(headerItem, row[headerItem.field], row,index)" @blur="inputStringBlur(headerItem, row[headerItem.field], row,index)"
/> />
@ -576,7 +576,7 @@ const batchAdd = ()=>{
console.log(field) console.log(field)
emit('batchAdd',keyWord.value) emit('batchAdd',keyWord.value)
} }
const disabledInput=(headerItem)=>{ const disabledInput=(headerItem,row)=>{
if(headerItem.tableForm?.isInpuFocusShow){ if(headerItem.tableForm?.isInpuFocusShow){
if(headerItem.tableForm?.enterSearch){ if(headerItem.tableForm?.enterSearch){
return false return false
@ -584,9 +584,10 @@ const disabledInput=(headerItem)=>{
return true return true
} }
}else{ }else{
return headerItem?.tableForm?.disabled || true return headerItem?.tableForm?.disabled || Boolean(row.disabled) || Boolean(row['disabled_' + headerItem.field]) ||false
} }
} }
// setup // setup
defineExpose({ defineExpose({
TableBaseComponents_Ref, TableBaseComponents_Ref,

29
src/views/eam/equipmentMaintenanceRecordMain/index.vue

@ -32,8 +32,8 @@
<span>{{ row.recordNo }}</span> <span>{{ row.recordNo }}</span>
</el-button> </el-button>
</template> </template>
<template #action="{ row }"> <template #action="{ row,$index }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> <ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" />
</template> </template>
</Table> </Table>
</ContentWrap> </ContentWrap>
@ -154,13 +154,24 @@ const buttonBaseClick = (val, item) => {
} }
} }
// - const butttondata = (row,$index) => {
const butttondata = [ const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1
//defaultButtons.mainListEditBtn({hasPermi:'eam:equipmentMaintenanceRecordMain:update'}), // if(findIndex>-1&&findIndex<$index){
//defaultButtons.mainListDeleteBtn({hasPermi:'eam:equipmentMaintenanceRecordMain:delete'}), // return []
defaultButtons.maintainExperienceBtn({ hasPermi: 'eam:equipmentMaintenanceRecordMain:maintainExperience' }) // }
] return [
defaultButtons.repairExperienceBtn({ hide:isShowMainButton(row,['0']),hasPermi: 'eam:equipmentMaintenanceRecordMain:maintainExperience' }) //
]
}
//
const isShowMainButton = (row,val) => {
console.log(row.isExperience)
if (val.indexOf(row.isExperience) > -1) {
return false
} else {
return true
}
}
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'edit') { // if (val == 'edit') { //

28
src/views/eam/equipmentRepairRecordMain/index.vue

@ -36,8 +36,8 @@
<span>{{ row.number }}</span> <span>{{ row.number }}</span>
</el-button> </el-button>
</template> </template>
<template #action="{ row }"> <template #action="{ row,$index }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event, row)" /> <ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event, row)" />
</template> </template>
</Table> </Table>
</ContentWrap> </ContentWrap>
@ -176,12 +176,26 @@ const buttonBaseClick = (val, item) => {
} }
// - // -
const butttondata = [
// defaultButtons.mainListEditBtn({hasPermi:'eam:equipmentRepairRecordMain:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'eam:equipmentRepairRecordMain:delete'}), //
defaultButtons.repairExperienceBtn({ hasPermi: 'eam:equipmentRepairRecordMain:repairExperience' }) //
]
const butttondata = (row,$index) => {
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1
if(findIndex>-1&&findIndex<$index){
return []
}
return [
defaultButtons.repairExperienceBtn({ hide:isShowMainButton(row,['0']),hasPermi: 'eam:equipmentRepairRecordMain:repairExperience' }) //
]
}
//
const isShowMainButton = (row,val) => {
console.log(row.isExperience)
if (val.indexOf(row.isExperience) > -1) {
return false
} else {
return true
}
}
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'edit') { if (val == 'edit') {

Loading…
Cancel
Save