Prechádzať zdrojové kódy

生活去除elementui

tianyabing 2 rokov pred
rodič
commit
73503af139

+ 3 - 27
src/components/life/parking/components/lifeParkDetailTable.vue

@@ -2,32 +2,6 @@
   <a-table :columns="columns" :data-source="data" :pagination="false" :customRow="customRow">
     <a slot="name" slot-scope="text">{{ text }}</a>
   </a-table>
-  <!--<el-table-->
-  <!--    :data="tableData"-->
-  <!--    stripe-->
-  <!--    :header-row-style="{fontSize: '12px'}"-->
-  <!--    :cell-style="{fontSize: '12px'}"-->
-  <!--&gt;-->
-  <!--  <el-table-column-->
-  <!--      prop="carPosition"-->
-  <!--      label="车位" min-width="40">-->
-  <!--  </el-table-column>-->
-  <!--  <el-table-column-->
-  <!--      prop="owner"-->
-  <!--      label="拥有者" min-width="60">-->
-  <!--  </el-table-column>-->
-  <!--  <el-table-column-->
-  <!--      prop="company"-->
-  <!--      label="单位" min-width="100">-->
-  <!--    <template #default="scope">-->
-  <!--      <span >{{ scope.row.name }}</span>-->
-  <!--    </template>-->
-  <!--  </el-table-column>-->
-  <!--  <el-table-column-->
-  <!--      prop="parkTime"-->
-  <!--      label="停车时间" min-width="50">-->
-  <!--  </el-table-column>-->
-  <!--</el-table>-->
 </template>
 
 <script>
@@ -80,7 +54,9 @@ export default {
   methods: {
     customRow(record, index) {
       return {
-        'background-color': index%2===0 ? '#ffffff' : '#fafafa'
+        style: {
+          'background-color': index%2===0 ? '#ffffff' : '#fafafa'
+        }
       }
     }
   }

+ 49 - 37
src/components/life/parking/components/lifeParkTopTable.vue

@@ -1,59 +1,71 @@
 <template>
-  <el-table
-      :data="tableData"
-      stripe
-      :header-row-style="{fontSize: '12px'}"
-      :cell-style="{fontSize: '12px'}"
-  >
-    <el-table-column
-        prop="url"
-        label="车位" min-width="40">
-    </el-table-column>
-    <el-table-column
-        prop="name"
-        label="单位" min-width="100">
-      <template #default="scope">
-        <span >{{ scope.row.name }}</span>
-      </template>
-    </el-table-column>
-    <el-table-column
-        prop="address"
-        label="占用量长时间" min-width="50">
-    </el-table-column>
-    <el-table-column
-        prop="address1"
-        label="占用量短时间" min-width="50">
-    </el-table-column>
-  </el-table>
+  <a-table :columns="columns" :data-source="tableData" :pagination="false" :customRow="customRow">
+    <a slot="name" slot-scope="text">{{ text }}</a>
+  </a-table>
 </template>
 
 <script>
 export default {
   data() {
     return {
+      columns: [
+        {
+          title: '车位',
+          dataIndex: 'position',
+          key: 'position',
+        },
+        {
+          title: '单位',
+          dataIndex: 'company',
+          key: 'company',
+        },
+        {
+          title: '占用最长时间',
+          key: 'longTime',
+          dataIndex: 'longTime',
+        },
+        {
+          title: '占用最短时间',
+          key: 'shortTime',
+          dataIndex: 'shortTime',
+        },
+      ],
       tableData: [{
-        url: '',
+        position: 'B201',
         name: '北京规划院',
-        address: '2h',
-        address1: '2min'
+        longTime: '2h',
+        shortTime: '2min'
       }, {
-        url: '',
+        position: 'B201',
         name: '北京规划院',
-        address: '2h'
+        longTime: '2h',
+        shortTime: '2min'
       }, {
-        url: '',
+        position: 'B201',
         name: '北京规划院',
-        address: '2h'
+        longTime: '2h',
+        shortTime: '2min'
       }, {
-        url: '',
+        position: 'B201',
         name: '北京规划院',
-        address: '2h'
+        longTime: '2h',
+        shortTime: '2min'
       }, {
-        url: '',
+        position: 'B201',
         name: '北京规划院',
-        address: '2h'
+        longTime: '2h',
+        shortTime: '2min'
       }]
     }
+  },
+  methods: {
+    customRow(record, index) {
+      return {
+        style: {
+          'background-color': index%2===0 ? '#ffffff' : '#fafafa'
+        }
+      }
+    }
   }
 }
 </script>

+ 39 - 34
src/components/life/restaurant/components/lifeRestDailyMenu.vue

@@ -1,53 +1,58 @@
 <template>
-  <el-table
-      :data="tableData"
-      stripe
-      :show-header="false"
-      >
-    <el-table-column
-        prop="url"
-        label="日期" min-width="60">
-    </el-table-column>
-    <el-table-column
-        prop="name"
-        label="姓名" min-width="100">
-      <template #default="scope">
-        <span style="font-size: 12px">{{ scope.row.name }}</span>
-      </template>
-    </el-table-column>
-    <el-table-column
-        prop="address"
-        label="分数" min-width="70">
-    </el-table-column>
-  </el-table>
+  <a-table :columns="columns"
+           :show-header="false"
+           :data-source="tableData"
+           :pagination="false"
+           :customRow="customRow">
+    <a slot="name" slot-scope="text">{{ text }}</a>
+  </a-table>
 </template>
 
 <script>
 export default {
   data() {
     return {
+      columns: [
+        {
+          dataIndex: 'type',
+          key: 'type',
+        },
+        {
+          dataIndex: 'name',
+          key: 'name',
+        },
+        {
+          dataIndex: 'price',
+          key: 'price',
+        },
+      ],
       tableData: [{
-        url: '热菜',
+        type: '热菜',
         name: '铁锅蘑菇炖柴鸡',
-        address: '16大/12小'
+        price: '16大/12小'
       }, {
-        url: '热菜',
+        type: '热菜',
         name: '铁锅蘑菇炖柴鸡',
-        address: '16大/12小'
+        price: '16大/12小'
       }, {
-        url: '凉菜',
+        type: '热菜',
         name: '铁锅蘑菇炖柴鸡',
-        address: '16大/12小'
+        price: '16大/12小'
       }, {
-        url: '主食',
-        name: '铁锅蘑菇炖柴鸡',
-        address: '16大/12小'
-      }, {
-        url: '主食',
-        name: '铁锅蘑菇炖柴鸡',
-        address: '16大/12小'
+        type: '主食',
+        name: '米饭',
+        price: '3'
       }]
     }
+  },
+  methods: {
+    customRow(record, index) {
+      return {
+        style: {
+          'background-color': index%2===0 ? '#ffffff' : '#fafafa'
+        }
+      }
+    }
   }
 }
 </script>

+ 40 - 31
src/components/life/restaurant/components/lifeRestTopMenu.vue

@@ -1,53 +1,62 @@
 <template>
-  <el-table
-      :data="tableData"
-      stripe
-      :show-header="false"
-      >
-    <el-table-column
-        prop="url"
-        label="日期" min-width="60">
-    </el-table-column>
-    <el-table-column
-        prop="name"
-        label="姓名" min-width="100">
-      <template #default="scope">
-        <span style="font-size: 12px">{{ scope.row.name }}</span>
-      </template>
-    </el-table-column>
-    <el-table-column
-        prop="address"
-        label="分数" min-width="70">
-    </el-table-column>
-  </el-table>
+  <a-table :columns="columns"
+           :show-header="false"
+           :data-source="tableData"
+           :pagination="false"
+           :customRow="customRow">
+    <a slot="name" slot-scope="text">{{ text }}</a>
+  </a-table>
 </template>
 
 <script>
 export default {
   data() {
     return {
+      columns: [
+        {
+          dataIndex: 'img',
+          key: 'img',
+        },
+        {
+          dataIndex: 'name',
+          key: 'name',
+        },
+        {
+          dataIndex: 'num',
+          key: 'num',
+        },
+      ],
       tableData: [{
-        url: '',
+        img: '',
         name: '铁锅蘑菇炖柴鸡',
-        address: '200份'
+        num: '200'
       }, {
-        url: '',
+        img: '',
         name: '铁锅蘑菇炖柴鸡',
-        address: '200份'
+        num: '200'
       }, {
-        url: '',
+        img: '',
         name: '铁锅蘑菇炖柴鸡',
-        address: '200份'
+        num: '200'
       }, {
-        url: '',
+        img: '',
         name: '铁锅蘑菇炖柴鸡',
-        address: '200份'
+        num: '200'
       }, {
-        url: '',
+        img: '',
         name: '铁锅蘑菇炖柴鸡',
-        address: '200份'
+        num: '200'
       }]
     }
+  },
+  methods: {
+    customRow(record, index) {
+      return {
+        style: {
+          'background-color': index%2===0 ? '#ffffff' : '#fafafa'
+        }
+      }
+    }
   }
 }
 </script>

+ 16 - 24
src/components/life/supermarket/components/lifeSupermarketTopTable.vue

@@ -1,34 +1,26 @@
 <template>
-  <el-table
-      :data="tableData"
-      stripe
-  >
-    <el-table-column
-        prop="url"
-        label="图片" min-width="60">
-    </el-table-column>
-    <el-table-column
-        prop="name"
-        label="商品名称" min-width="100">
-      <template #default="scope">
-        <span style="font-size: 12px">{{ scope.row.name }}</span>
-      </template>
-    </el-table-column>
-    <el-table-column
-        prop="num"
-        label="销量" min-width="70">
-    </el-table-column>
-    <el-table-column
-        prop="price"
-        label="单价" min-width="70">
-    </el-table-column>
-  </el-table>
+  <a-table :columns="columns" :data-source="data" :pagination="false" :customRow="customRow">
+    <a slot="name" slot-scope="text">{{ text }}</a>
+  </a-table>
 </template>
 
 <script>
 export default {
   data() {
     return {
+      columns: [
+        {
+          title: '图片',
+          dataIndex: 'img',
+          key: 'img',
+        },
+        {
+          title: '名称',
+          dataIndex: 'name',
+          key: 'name',
+        },
+
+      ],
       tableData: [{
         url: '',
         name: '商品1',