|
@@ -1,5 +1,15 @@
|
|
<template>
|
|
<template>
|
|
- <a-table :columns="columns" :data-source="tableData" :pagination="false" :customRow="customRow">
|
|
|
|
|
|
+ <a-table
|
|
|
|
+ :rowKey="
|
|
|
|
+ (record, index) => {
|
|
|
|
+ return index;
|
|
|
|
+ }
|
|
|
|
+ "
|
|
|
|
+ :columns="columns"
|
|
|
|
+ :data-source="tableData"
|
|
|
|
+ :pagination="false"
|
|
|
|
+ :customRow="customRow"
|
|
|
|
+ >
|
|
<a slot="name" slot-scope="text">{{ text }}</a>
|
|
<a slot="name" slot-scope="text">{{ text }}</a>
|
|
</a-table>
|
|
</a-table>
|
|
</template>
|
|
</template>
|
|
@@ -10,66 +20,71 @@ export default {
|
|
return {
|
|
return {
|
|
columns: [
|
|
columns: [
|
|
{
|
|
{
|
|
- title: '车位',
|
|
|
|
- dataIndex: 'position',
|
|
|
|
- key: 'position',
|
|
|
|
|
|
+ title: "车位",
|
|
|
|
+ dataIndex: "position",
|
|
|
|
+ key: "position",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: "单位",
|
|
|
|
+ dataIndex: "company",
|
|
|
|
+ key: "company",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: "占用最长时间",
|
|
|
|
+ key: "longTime",
|
|
|
|
+ dataIndex: "longTime",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: "占用最短时间",
|
|
|
|
+ key: "shortTime",
|
|
|
|
+ dataIndex: "shortTime",
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ tableData: [
|
|
|
|
+ {
|
|
|
|
+ position: "B201",
|
|
|
|
+ name: "北京规划院",
|
|
|
|
+ longTime: "2h",
|
|
|
|
+ shortTime: "2min",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ position: "B201",
|
|
|
|
+ name: "北京规划院",
|
|
|
|
+ longTime: "2h",
|
|
|
|
+ shortTime: "2min",
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- title: '单位',
|
|
|
|
- dataIndex: 'company',
|
|
|
|
- key: 'company',
|
|
|
|
|
|
+ position: "B201",
|
|
|
|
+ name: "北京规划院",
|
|
|
|
+ longTime: "2h",
|
|
|
|
+ shortTime: "2min",
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- title: '占用最长时间',
|
|
|
|
- key: 'longTime',
|
|
|
|
- dataIndex: 'longTime',
|
|
|
|
|
|
+ position: "B201",
|
|
|
|
+ name: "北京规划院",
|
|
|
|
+ longTime: "2h",
|
|
|
|
+ shortTime: "2min",
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- title: '占用最短时间',
|
|
|
|
- key: 'shortTime',
|
|
|
|
- dataIndex: 'shortTime',
|
|
|
|
|
|
+ position: "B201",
|
|
|
|
+ name: "北京规划院",
|
|
|
|
+ longTime: "2h",
|
|
|
|
+ shortTime: "2min",
|
|
},
|
|
},
|
|
],
|
|
],
|
|
- tableData: [{
|
|
|
|
- position: 'B201',
|
|
|
|
- name: '北京规划院',
|
|
|
|
- longTime: '2h',
|
|
|
|
- shortTime: '2min'
|
|
|
|
- }, {
|
|
|
|
- position: 'B201',
|
|
|
|
- name: '北京规划院',
|
|
|
|
- longTime: '2h',
|
|
|
|
- shortTime: '2min'
|
|
|
|
- }, {
|
|
|
|
- position: 'B201',
|
|
|
|
- name: '北京规划院',
|
|
|
|
- longTime: '2h',
|
|
|
|
- shortTime: '2min'
|
|
|
|
- }, {
|
|
|
|
- position: 'B201',
|
|
|
|
- name: '北京规划院',
|
|
|
|
- longTime: '2h',
|
|
|
|
- shortTime: '2min'
|
|
|
|
- }, {
|
|
|
|
- position: 'B201',
|
|
|
|
- name: '北京规划院',
|
|
|
|
- longTime: '2h',
|
|
|
|
- shortTime: '2min'
|
|
|
|
- }]
|
|
|
|
- }
|
|
|
|
|
|
+ };
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
customRow(record, index) {
|
|
customRow(record, index) {
|
|
return {
|
|
return {
|
|
style: {
|
|
style: {
|
|
- 'background-color': index%2===0 ? '#ffffff' : '#fafafa'
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
|
|
+ "background-color": index % 2 === 0 ? "#ffffff" : "#fafafa",
|
|
|
|
+ },
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+};
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
<style lang="less" scoped>
|
|
-
|
|
|
|
</style>
|
|
</style>
|