fix 80070
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
v-on="$listeners"
|
v-on="$listeners"
|
||||||
:bordered="bordered"
|
:bordered="bordered"
|
||||||
:scroll="{x: '100%'}"
|
:scroll="{x: '100%'}"
|
||||||
|
:row-class-name="lineCanExpand"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:data-source="dataSource">
|
:data-source="dataSource">
|
||||||
<!-- 如果插槽是作用域插槽,将作用域插槽的props包装成对象传递给slot -->
|
<!-- 如果插槽是作用域插槽,将作用域插槽的props包装成对象传递给slot -->
|
||||||
@@ -26,7 +27,12 @@
|
|||||||
<template v-for="(value, key) in extraForm">
|
<template v-for="(value, key) in extraForm">
|
||||||
<template v-if="record[formIsDepend] === key">
|
<template v-if="record[formIsDepend] === key">
|
||||||
<a-form-model :key="key" :model="record" :rules="value.rules" :ref="`ruleForm${index}`">
|
<a-form-model :key="key" :model="record" :rules="value.rules" :ref="`ruleForm${index}`">
|
||||||
<a-form-model-item v-for="form in value.formArr" :key="form.dbFieldName" :labelCol="labelCol" :wrapperCol="wrapperCol" :label="form.dbFieldTxt" :prop="form.dbFieldName">
|
<a-form-model-item v-for="form in value.formArr"
|
||||||
|
:key="form.dbFieldName"
|
||||||
|
:labelCol="labelCol"
|
||||||
|
:wrapperCol="wrapperCol"
|
||||||
|
:label="form.dbFieldTxt"
|
||||||
|
:prop="form.dbFieldName">
|
||||||
<template v-if="form.fieldShowType === 1">
|
<template v-if="form.fieldShowType === 1">
|
||||||
<a-input
|
<a-input
|
||||||
type="textarea"
|
type="textarea"
|
||||||
@@ -66,7 +72,12 @@
|
|||||||
<!-- 没有依赖的字段,就直接把传入的extraForm数组渲染成表单 -->
|
<!-- 没有依赖的字段,就直接把传入的extraForm数组渲染成表单 -->
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<a-form-model :model="record" :rules="extraForm.rules" :ref="`ruleForm${index}`">
|
<a-form-model :model="record" :rules="extraForm.rules" :ref="`ruleForm${index}`">
|
||||||
<a-form-model-item v-for="form in extraForm.formArr" :key="form.dbFieldName" :labelCol="labelCol" :wrapperCol="wrapperCol" :label="form.dbFieldTxt" :prop="form.dbFieldName">
|
<a-form-model-item v-for="form in extraForm.formArr"
|
||||||
|
:key="form.dbFieldName"
|
||||||
|
:labelCol="labelCol"
|
||||||
|
:wrapperCol="wrapperCol"
|
||||||
|
:label="form.dbFieldTxt"
|
||||||
|
:prop="form.dbFieldName">
|
||||||
<template v-if="form.fieldShowType === 1">
|
<template v-if="form.fieldShowType === 1">
|
||||||
<a-input
|
<a-input
|
||||||
type="textarea"
|
type="textarea"
|
||||||
@@ -209,6 +220,18 @@ export default {
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: false,
|
required: false,
|
||||||
default: false
|
default: false
|
||||||
|
},
|
||||||
|
// 控制该行是否可展开的字段
|
||||||
|
lineCanExpandField: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: null
|
||||||
|
},
|
||||||
|
// 控制该行是否可以展开的字段值
|
||||||
|
lineCanExpandValue: {
|
||||||
|
type: [String, Number],
|
||||||
|
required: false,
|
||||||
|
default: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
@@ -260,6 +283,9 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
arr[i] = true
|
arr[i] = true
|
||||||
}
|
}
|
||||||
|
} else if (this.dataSource[i][this.lineCanExpandField] !== this.lineCanExpandValue) {
|
||||||
|
// 如果这行数据本身不需要填写
|
||||||
|
arr[i] = true
|
||||||
} else {
|
} else {
|
||||||
// 依赖的字段都没有填
|
// 依赖的字段都没有填
|
||||||
arr[i] = false
|
arr[i] = false
|
||||||
@@ -294,11 +320,25 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
lineCanExpand (record) {
|
||||||
|
console.log(this.lineCanExpandField, typeof this.lineCanExpandValue, record[this.lineCanExpandField] === this.lineCanExpandValue)
|
||||||
|
if (!this.lineCanExpandField || (!this.lineCanExpandValue && this.lineCanExpandValue !== 0 && this.lineCanExpandValue !== false)) {
|
||||||
|
return 'can-expend'
|
||||||
|
}
|
||||||
|
if (record[this.lineCanExpandField] === this.lineCanExpandValue) {
|
||||||
|
return 'can-expend'
|
||||||
|
}
|
||||||
|
return 'cannot-expend'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped lang="less">
|
||||||
|
/deep/ .cannot-expend {
|
||||||
|
.ant-table-row-expand-icon {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
+2
@@ -201,6 +201,8 @@
|
|||||||
form-is-depend="evaluationFeedback"
|
form-is-depend="evaluationFeedback"
|
||||||
:extra-form="extraForm"
|
:extra-form="extraForm"
|
||||||
:scroll="{x: '100%'}"
|
:scroll="{x: '100%'}"
|
||||||
|
line-can-expand-field="canAssignFlag"
|
||||||
|
:line-can-expand-value="1"
|
||||||
@change="handleTableChange">
|
@change="handleTableChange">
|
||||||
|
|
||||||
<!--条文内容-->
|
<!--条文内容-->
|
||||||
|
|||||||
Reference in New Issue
Block a user