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
name: string
content: string
repairNumber: string
repairRecordNumber: string
}
// 查询维修经验记录列表

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

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

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

@ -32,8 +32,8 @@
<span>{{ row.recordNo }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
<template #action="{ row,$index }">
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
@ -154,13 +154,24 @@ const buttonBaseClick = (val, item) => {
}
}
// -
const butttondata = [
//defaultButtons.mainListEditBtn({hasPermi:'eam:equipmentMaintenanceRecordMain:update'}), //
//defaultButtons.mainListDeleteBtn({hasPermi:'eam:equipmentMaintenanceRecordMain:delete'}), //
defaultButtons.maintainExperienceBtn({ hasPermi: 'eam:equipmentMaintenanceRecordMain:maintainExperience' }) //
]
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: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) => {
if (val == 'edit') { //

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

@ -36,8 +36,8 @@
<span>{{ row.number }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event, row)" />
<template #action="{ row,$index }">
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event, row)" />
</template>
</Table>
</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) => {
if (val == 'edit') {

Loading…
Cancel
Save