|
@ -117,6 +117,7 @@ |
|
|
:apiCreate="apiCreate" |
|
|
:apiCreate="apiCreate" |
|
|
:fromeWhere="fromeWhere" |
|
|
:fromeWhere="fromeWhere" |
|
|
:isDetail="true" |
|
|
:isDetail="true" |
|
|
|
|
|
@onChange="onChange" |
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
:detailData="detailData" |
|
|
:detailData="detailData" |
|
|
@submitForm="submitForm" |
|
|
@submitForm="submitForm" |
|
@ -135,7 +136,6 @@ import BasicForm from '@/components/BasicForm/src/BasicForm.vue' |
|
|
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|
|
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|
|
import DetailTable from '@/components/DetailTable/src/DetailTable.vue' |
|
|
import DetailTable from '@/components/DetailTable/src/DetailTable.vue' |
|
|
import { isString } from '@/utils/is' |
|
|
import { isString } from '@/utils/is' |
|
|
import { Console } from 'console' |
|
|
|
|
|
|
|
|
|
|
|
defineOptions({ name: 'Detail' }) |
|
|
defineOptions({ name: 'Detail' }) |
|
|
|
|
|
|
|
@ -277,6 +277,12 @@ const props = defineProps({ |
|
|
required: false, |
|
|
required: false, |
|
|
default: true |
|
|
default: true |
|
|
}, |
|
|
}, |
|
|
|
|
|
// 表格按钮权限控制 |
|
|
|
|
|
buttonControllFunction: { |
|
|
|
|
|
type: Function, |
|
|
|
|
|
required: false, |
|
|
|
|
|
default: undefined |
|
|
|
|
|
}, |
|
|
}) |
|
|
}) |
|
|
const isShowDrawer = ref(false) |
|
|
const isShowDrawer = ref(false) |
|
|
const detailLoading = ref(false) |
|
|
const detailLoading = ref(false) |
|
@ -350,7 +356,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName: |
|
|
let detailButtonAdd: any = [] |
|
|
let detailButtonAdd: any = [] |
|
|
detailButtonAdd = props.isShowAddBtn?[ |
|
|
detailButtonAdd = props.isShowAddBtn?[ |
|
|
defaultButtons.defaultAddBtn({ |
|
|
defaultButtons.defaultAddBtn({ |
|
|
hide: isShowMainButton(row, ['1']) |
|
|
hide: !isShowMainButton(row, 'add') |
|
|
}) |
|
|
}) |
|
|
]:[] |
|
|
]:[] |
|
|
HeadButttondata.value = [...detailButtonAdd] |
|
|
HeadButttondata.value = [...detailButtonAdd] |
|
@ -359,10 +365,10 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName: |
|
|
buttondata.value = [ |
|
|
buttondata.value = [ |
|
|
...[ |
|
|
...[ |
|
|
defaultButtons.mainListEditBtn({ |
|
|
defaultButtons.mainListEditBtn({ |
|
|
hide: isShowMainButton(row, ['1']) |
|
|
hide: !isShowMainButton(row, 'edit') |
|
|
}), // 编辑 |
|
|
}), // 编辑 |
|
|
defaultButtons.mainListDeleteBtn({ |
|
|
defaultButtons.mainListDeleteBtn({ |
|
|
hide: isShowMainButton(row, ['1']) |
|
|
hide: !isShowMainButton(row, 'delete') |
|
|
}) |
|
|
}) |
|
|
], // 删除 |
|
|
], // 删除 |
|
|
...props.buttondataTable |
|
|
...props.buttondataTable |
|
@ -404,7 +410,12 @@ detailAllSchemasRef.value = props.detailAllSchemas |
|
|
|
|
|
|
|
|
// 根据状态返回该按钮是否显示 |
|
|
// 根据状态返回该按钮是否显示 |
|
|
const isShowMainButton = (row, val) => { |
|
|
const isShowMainButton = (row, val) => { |
|
|
return false |
|
|
if (props.buttonControllFunction != undefined) { |
|
|
|
|
|
return props.buttonControllFunction(row, val) |
|
|
|
|
|
} else { |
|
|
|
|
|
return true |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 获得表格的各种操作 |
|
|
// 获得表格的各种操作 |
|
@ -504,7 +515,8 @@ const emit = defineEmits([ |
|
|
'detailOpenForm', |
|
|
'detailOpenForm', |
|
|
'tableFormButton', |
|
|
'tableFormButton', |
|
|
'openImage', |
|
|
'openImage', |
|
|
'detailSubmitForm' |
|
|
'detailSubmitForm', |
|
|
|
|
|
'detailOnChange' |
|
|
]) |
|
|
]) |
|
|
/** 删除按钮操作 */ |
|
|
/** 删除按钮操作 */ |
|
|
const handleDelete = async (id: number) => { |
|
|
const handleDelete = async (id: number) => { |
|
@ -576,6 +588,11 @@ watch( |
|
|
getList() |
|
|
getList() |
|
|
} |
|
|
} |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
function onChange(field, cur, item) { |
|
|
|
|
|
emit('detailOnChange', field, cur, item) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
</script> |
|
|
</script> |
|
|
<style lang="scss"> |
|
|
<style lang="scss"> |
|
|
.el-drawer__body { |
|
|
.el-drawer__body { |
|
|