Browse Source

fix: table dataSource

Sendya 6 năm trước cách đây
mục cha
commit
8b88af4522
3 tập tin đã thay đổi với 63 bổ sung2 xóa
  1. 3 1
      src/components/index.js
  2. 1 1
      src/config/router.config.js
  3. 59 0
      src/views/list/search/Article.vue

+ 3 - 1
src/components/index.js

@@ -24,6 +24,7 @@ import STable from '@/components/Table'
 import MultiTab from '@/components/MultiTab'
 import Result from '@/components/Result'
 import IconSelector from '@/components/IconSelector'
+import TagSelect from '@/components/TagSelect'
 import ExceptionPage from '@/components/Exception'
 
 export {
@@ -52,5 +53,6 @@ export {
   MultiTab,
   Result,
   ExceptionPage,
-  IconSelector
+  IconSelector,
+  TagSelect
 }

+ 1 - 1
src/config/router.config.js

@@ -105,7 +105,7 @@ export const asyncRouterMap = [
               {
                 path: '/list/search/article',
                 name: 'SearchArticles',
-                component: () => import('../views/list/TableList'),
+                component: () => import('../views/list/search/Article'),
                 meta: { title: '搜索列表(文章)', permission: [ 'table' ] }
               },
               {

+ 59 - 0
src/views/list/search/Article.vue

@@ -0,0 +1,59 @@
+<template>
+  <a-card :bordered="false" class="ant-pro-components-tag-select">
+    <a-form layout="inline">
+      <a-form-item label="所属类目">
+        <tag-select>
+          <tag-select-option value="Category1">类目一</tag-select-option>
+          <tag-select-option value="Category2">类目二</tag-select-option>
+          <tag-select-option value="Category3">类目三</tag-select-option>
+          <tag-select-option value="Category4">类目四</tag-select-option>
+          <tag-select-option value="Category5">类目五</tag-select-option>
+          <tag-select-option value="Category6">类目六</tag-select-option>
+          <tag-select-option value="Category7">类目七</tag-select-option>
+          <tag-select-option value="Category8">类目八</tag-select-option>
+          <tag-select-option value="Category9">类目九</tag-select-option>
+          <tag-select-option value="Category10">类目十</tag-select-option>
+        </tag-select>
+      </a-form-item>
+      <a-divider dashed />
+      <a-form-item label="owner">
+        <a-row>
+          <a-col :md="24">
+            <a-select style="max-width: 268px; width: 100%;" mode="multiple" :defaultValue="['a1', 'b2']" @change="handleChange" placeholder="Please select">
+              <a-select-option v-for="i in 25" :key="(i + 9).toString(36) + i">{{ (i + 9).toString(36) + i }}</a-select-option>
+            </a-select>
+            <a>只看自己的</a>
+          </a-col>
+        </a-row>
+      </a-form-item>
+    </a-form>
+
+  </a-card>
+</template>
+
+<script>
+import { TagSelect } from '@/components'
+const TagSelectOption = TagSelect.Option
+
+export default {
+  components: {
+    TagSelect,
+    TagSelectOption
+  },
+  methods: {
+    handleChange (value) {
+      console.log(`selected ${value}`)
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+.ant-pro-components-tag-select {
+  /deep/ .ant-pro-tag-select .ant-tag {
+    margin-right: 24px;
+    padding: 0 8px;
+    font-size: 14px;
+  }
+}
+</style>