Commit 0003cec5 authored by 何虹's avatar 何虹 💬

修复表格bug

parent b0df0a0e
......@@ -21,7 +21,7 @@
:config='hsTableConfig'
:data='hsTableData'
:elInfo='hsTableEl'
fromWhere='hdrDtl'
:editable='true'
@handleClick='handleClick'
@toolClick='tableItemClick'
v-bind="$attrs"
......
......@@ -13,18 +13,18 @@
@keyup.enter.native="enterInput"
style="width:100%"
clearable
:disabled='getDisabled||isFromHdrDtl'
:disabled='getDisabled||isEditable'
size='mini'
v-model="formParms[item.prop]"
></el-input>
</template>
<template v-else-if="item.showType==='hsInput'">
<template v-else-if="item.showType==='hsInput'">
<hs-input
:prop='item.prop'
v-model="formParms[item.prop]"
:allSourceData='item.allSourceData'
:config='item.config'
:elInfo='item.elInfo'
:disabled='getDisabled||isFromHdrDtl'
:disabled='getDisabled||isEditable'
:formData='formParms'
></hs-input>
</template>
......@@ -33,7 +33,7 @@
style="width:100%"
type='textarea'
clearable
:disabled='getDisabled||isFromHdrDtl'
:disabled='getDisabled||isEditable'
v-model="formParms[item.prop]"
></el-input>
</template>
......@@ -41,7 +41,7 @@
<template v-else-if="item.showType==='elDatePicker'">
<el-date-picker
clearable
:disabled='getDisabled||isFromHdrDtl'
:disabled='getDisabled||isEditable'
style="width:100%"
size='mini'
v-model="formParms[item.prop]"
......@@ -56,7 +56,7 @@
<template v-else-if="item.showType==='elDatePickerDatetime'">
<el-date-picker
clearable
:disabled='getDisabled||isFromHdrDtl'
:disabled='getDisabled||isEditable'
style="width:100%"
size='mini'
v-model="formParms[item.prop]"
......@@ -68,10 +68,10 @@
<template v-else-if="item.showType==='hsSwitch'">
<hs-switch
:prop='item.prop'
:allSourceData='item.allSourceData'
:config='item.config'
:elInfo='item.elInfo'
v-model="formParms[item.prop]"
:disabled='getDisabled||isFromHdrDtl'
:disabled='getDisabled||isEditable'
>
</hs-switch>
</template>
......@@ -79,69 +79,70 @@
<el-checkbox
style="width:100%"
size='mini'
:disabled='getDisabled||isFromHdrDtl'
:disabled='getDisabled||isEditable'
v-model="formParms[item.prop]"
>
</el-checkbox>
</template>
<template v-else-if="item.showType==='hsComputed'">
<hs-computed
<hs-computed
:prop='item.prop'
v-model="formParms[item.prop]"
:allSourceData='item.allSourceData'
:config='item.config'
:elInfo='item.elInfo'
:disabled='getDisabled||isFromHdrDtl'
:disabled='getDisabled||isEditable'
:formData='formParms'
v-on="$listeners"
v-bind="$attrs"
>
>
</hs-computed>
</template>
<template v-else-if="item.showType==='hsSelectPlus'">
<hs-select-plus
parentType='table'
v-model="formParms[item.prop]"
:prop='item.prop'
:allSourceData='item.allSourceData'
:elInfo='item.elInfo'
:formData='formParms'
:disabled='getDisabled||isFromHdrDtl'
v-on="$listeners"
v-bind="$attrs"
parentType='table'
v-model="formParms[item.prop]"
:prop='item.prop'
:config='item.config'
:data='item.data'
:elInfo='item.elInfo'
:formData='formParms'
:disabled='getDisabled||isEditable'
v-on="$listeners"
v-bind="$attrs"
>
</hs-select-plus>
</template>
<template v-else-if="item.showType==='hsInputNumber'">
<template v-else-if="item.showType==='hsInputNumber'">
<hs-input-number
:prop='item.prop'
:prop='item.prop'
v-model="formParms[item.prop]"
:allSourceData='item.allSourceData'
:config='item.config'
:elInfo='item.elInfo'
:disabled='getDisabled||isFromHdrDtl'
:disabled='getDisabled||isEditable'
:formData='formParms'
v-bind="$attrs"
v-on="$listeners"
></hs-input-number>
</template>
<template v-else-if="item.showType==='hsPopoverTextarea'">
<template v-else-if="item.showType==='hsPopoverTextarea'">
<hs-popover-textarea
:prop='item.prop'
v-model="formParms[item.prop]"
:allSourceData='item.allSourceData'
:config='item.config'
:elInfo='item.elInfo'
:disabled='getDisabled||isFromHdrDtl'
:disabled='getDisabled||isEditable'
:formData='formParms'
v-bind="$attrs"
v-on="$listeners"
></hs-popover-textarea>
</template>
<template v-else-if="item.showType==='hsLookup'">
<template v-else-if="item.showType==='hsLookup'">
<hs-lookup
:prop='item.prop'
v-model="formParms[item.prop]"
:allSourceData='item.allSourceData'
:config='item.config'
:elInfo='item.elInfo'
:disabled='getDisabled||isFromHdrDtl'
:disabled='getDisabled||isEditable'
:formData='formParms'
v-on="$listeners"
v-bind="$attrs"
......@@ -150,49 +151,49 @@
</template>
<template v-else-if="item.showType==='hsTagsSelect'">
<hs-tags-select
v-model="formParms[item.prop]"
:prop='item.prop'
:allSourceData='item.allSourceData'
:elInfo='item.elInfo'
:formData='formParms'
:disabled='getDisabled||isFromHdrDtl'
v-on="$listeners"
v-bind="$attrs"
v-model="formParms[item.prop]"
:prop='item.prop'
:config='item.config'
:elInfo='item.elInfo'
:formData='formParms'
:disabled='getDisabled||isEditable'
v-on="$listeners"
v-bind="$attrs"
>
</hs-tags-select>
</template>
<template v-else-if="item.showType==='hsTagsTable'">
<hs-tags-table
v-model="formParms[item.prop]"
:prop='item.prop'
:allSourceData='item.allSourceData'
:elInfo='item.elInfo'
:formData='formParms'
:disabled='getDisabled'
v-on="$listeners"
v-bind="$attrs"
v-model="formParms[item.prop]"
:prop='item.prop'
:config='item.config'
:elInfo='item.elInfo'
:formData='formParms'
:disabled='getDisabled'
v-on="$listeners"
v-bind="$attrs"
>
</hs-tags-table>
</template>
<template v-else-if="item.showType==='hsTagsFrom'">
<hs-tags-from
v-model="formParms[item.prop]"
:prop='item.prop'
:allSourceData='item.allSourceData'
:elInfo='item.elInfo'
:formData='formParms'
:disabled='getDisabled||isFromHdrDtl'
v-on="$listeners"
v-bind="$attrs"
v-model="formParms[item.prop]"
:prop='item.prop'
:config='item.config'
:elInfo='item.elInfo'
:formData='formParms'
:disabled='getDisabled||isEditable'
v-on="$listeners"
v-bind="$attrs"
>
</hs-tags-from>
</template>
<template v-else-if="item.showType==='hsSelectList'">
<template v-else-if="item.showType==='hsSelectList'">
<hs-select-list
v-model="formParms[item.prop]"
:allSourceData='item.allSourceData'
:config='item.config'
:elInfo='item.elInfo'
:disabled='getDisabled||isFromHdrDtl'
:disabled='getDisabled||isEditable'
:formData='formParms'
:prop='item.prop'
v-on="$listeners"
......@@ -203,9 +204,9 @@
<template v-else-if="item.showType==='hsDragList'">
<hs-drag-list
v-model="formParms[item.prop]"
:allSourceData='item.allSourceData'
:config='item.config'
:elInfo='item.elInfo'
:disabled='getDisabled||isFromHdrDtl'
:disabled='getDisabled||isEditable'
:formData='formParms'
:prop='item.prop'
v-on="$listeners"
......@@ -216,9 +217,9 @@
<template v-else-if="item.showType==='hsInputSelect'">
<hs-input-select
v-model="formParms[item.prop]"
:allSourceData='item.allSourceData'
:config='item.config'
:elInfo='item.elInfo'
:disabled='getDisabled||isFromHdrDtl'
:disabled='getDisabled||isEditable'
:formData='formParms'
:prop='item.prop'
v-on="$listeners"
......@@ -244,13 +245,13 @@ export default {
}
},
computed: {
// 为什么加这个 因为有变态需求是列表上要修改, 原本是列表上一律不允许修改
isFromHdrDtl() {
const fromWhere = this.$attrs.fromWhere
if (fromWhere === 'importPage') {
// 为什么加这个 因为有变态需求是列表上要修改, 原本是列表上一律不允许修改 Editable
isEditable() {// 是否可编辑
const editable = this.$attrs.editable
if (editable) {
return false
} else {
return fromWhere !== 'hdrDtl'
return true
}
},
getDisabled() {
......
......@@ -58,7 +58,7 @@
title='展开'
>
<template v-slot:content="{ row }">
<rowTable :rowTable='row._childTable'></rowTable>
<rowTable :rowTable='row._childTable'></rowTable>
</template>
</ux-table-column>
<ux-table-column
......@@ -109,9 +109,9 @@
></i>
<childItem
v-else
:fromWhere='fromWhere'
v-bind="$attrs"
v-on="$listeners"
:editable='editable'
:item='column'
:prop="column.prop"
:formParms='scope.row'
......@@ -136,9 +136,9 @@
<childItem
:item='item'
:formParms='scope.row'
:editable='editable'
v-bind="$attrs"
v-on="$listeners"
:fromWhere='fromWhere'
>
</childItem>
</template>
......@@ -185,7 +185,7 @@ export default {
getSourceData: {
type: Function
},
fromWhere: {
editable: {
default: 'list'
},
// 数据
......@@ -444,7 +444,7 @@ export default {
? disabledLogicOperation
: false
const type = typeof disabled
const innerStatus = this.disabled && this.fromWhere === 'hdrDtl'
const innerStatus = this.disabled && this.editable
const data = { row, item }
if (disabledLevel === 1) {
if (type === 'boolean' || type === 'undefined') {
......@@ -462,8 +462,7 @@ export default {
},
getBindEntity() {
const bindEntity = this.tableConfig.bindEntity
if (bindEntity) return bindEntity
if (this.fromWhere === 'hdrDtl') return 'dtl'
return bindEntity || 'dtl'
},
clickToolLabel(item) {
const { click } = item
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment