| | |
| | | <template v-else> |
| | | <!--点击弹出单元格内容--> |
| | | <el-popover placement="top-start" trigger="click" :content="getPopoverContent(scope.row, column)"> |
| | | <span slot="reference" class="content-text">{{ scope.row[column.field] }}</span> |
| | | <!-- <span slot="reference" class="content-text">{{ scope.row[column.field] }}</span>--> |
| | | <span slot="reference" class="content-text">{{ splitField(scope.row, column.field) }}</span> |
| | | </el-popover> |
| | | </template> |
| | | </template> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import myButtonV2 from '@/views/components/myButtonV2' |
| | | import myButton from '@/views/components/myButton' |
| | | import mySwitch from './mySwitch' |
| | | import request from '@/utils/request' |
| | | import * as valid from '@/utils/validate' |
| | | import previewPicture from '@/views/components/previewPicture' |
| | | export default { |
| | | import myButtonV2 from '@/views/components/myButtonV2' |
| | | import myButton from '@/views/components/myButton' |
| | | import mySwitch from './mySwitch' |
| | | import request from '@/utils/request' |
| | | import * as valid from '@/utils/validate' |
| | | import previewPicture from '@/views/components/previewPicture' |
| | | |
| | | export default { |
| | | components: { myButtonV2, myButton, mySwitch, previewPicture }, |
| | | props: { |
| | | table: { |
| | |
| | | this.initTable() |
| | | }, |
| | | methods: { |
| | | /** |
| | | * 解决:field中属性套属性的情况。2023-04-25 |
| | | * @param row |
| | | * @param field |
| | | */ |
| | | splitField(row, field){ |
| | | if(field.indexOf('.') > -1){ |
| | | const arr = field.split('.'); |
| | | let fieldStr = ''; |
| | | for(let i=0, len=arr.length; i<len; i++){ |
| | | if(i == len - 1){ |
| | | fieldStr += arr[i]; |
| | | } else { |
| | | fieldStr += arr[i] + '.'; |
| | | } |
| | | } |
| | | return eval('row.' + fieldStr); |
| | | } else { |
| | | return row[field]; |
| | | } |
| | | }, |
| | | |
| | | initTable() { |
| | | if (this.table !== null) { |
| | | Object.assign(this.myTable, this.table) |