From 4bf10a1ba42ddaeab565c105b376c5732b0f3dab Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期二, 09 四月 2024 11:47:11 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.5.5:10010/r/silk/silk-web

---
 src/views/systemSetting/dataDictionary/index.vue |  307 ++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 301 insertions(+), 6 deletions(-)

diff --git a/src/views/systemSetting/dataDictionary/index.vue b/src/views/systemSetting/dataDictionary/index.vue
index 43c4ab0..4c7b83e 100644
--- a/src/views/systemSetting/dataDictionary/index.vue
+++ b/src/views/systemSetting/dataDictionary/index.vue
@@ -1,21 +1,316 @@
 <template>
-  <div class="container"></div>
+  <div class="silkStandardSetting-container">
+    <div class="filter-card">
+      <CommonSearch :show-add="false" :amount-view="false" placeholder="璇疯緭鍏ュ叧閿瘝" @searchClick="onFilterSearch">
+        <template slot="leftButton">
+          <el-button size="small" type="primary" @click="addBtnClick">鏂板</el-button>
+          <el-button size="small" type="primary" @click="refreshClick">鍒锋柊</el-button>
+        </template>
+      </CommonSearch>
+    </div>
+    <div class="body-card">
+      <div>
+        <div class="bottom-tabs" >
+          <div class="tab-pane" @click="getTab(0)" :style="{
+            background: TabsIndex == 0 ? '#2a78fb' : '#F1F3F8',
+            color: TabsIndex == 0 ? '#fff' : '#666'
+          }">
+            搴勫彛绠$悊
+          </div>
+          <div class="tab-pane" @click="getTab(1)" :style="{
+            background: TabsIndex == 1 ? '#2a78fb' : '#F1F3F8',
+            color: TabsIndex == 1 ? '#fff' : '#666'
+          }">
+            杞﹂棿绠$悊
+          </div>
+          <div class="tab-pane" @click="getTab(2)" :style="{
+            background: TabsIndex == 2 ? '#2a78fb' : '#F1F3F8',
+            color: TabsIndex == 2 ? '#fff' : '#666'
+          }">
+            甯﹀彿棰滆壊
+          </div>
+          <div class="tab-pane" @click="getTab(3)" :style="{
+            background: TabsIndex == 3 ? '#2a78fb' : '#F1F3F8',
+            color: TabsIndex == 3 ? '#fff' : '#666'
+          }">
+            瑙勬牸
+          </div>
+        </div>
+        <div class="list-view">
+          <TableCommonView :loading="loading" :table-list="productTableList" @selTableCol="selBottomTableCol">
+            <template slot="tableButton">
+              <el-table-column label="鎿嶄綔" width="160" fixed="right">
+                <template slot-scope="scope">
+                  <!-- <el-button>{{ scope.row }}</el-button> -->
+                  <el-button @click="rowClick(scope.row,'鏌ョ湅')" type="text" size="small">鏌ョ湅</el-button>
+                  <el-button @click="rowClick(scope.row,'淇敼')" type="text" size="small">淇敼</el-button>
+                  <el-button @click="rowClick(scope.row,'鍒犻櫎')" type="text" size="small">鍒犻櫎</el-button>
+                </template>
+              </el-table-column>
+            </template>
+          </TableCommonView>
+        </div>
+      </div>
+    </div>
+    <AddDataDictionaries 
+      :editDiaConfig="editConfig"
+    />
+  </div>
 </template>
 
 <script>
+import AddDataDictionaries from "@/views/systemSetting/dataDictionary/components/addDataDictionaries.vue"
+import {getDict} from "@/api/systemSetting/dataDictionary"
 export default {
   name: "dataDictionary",
   props: {},
-  components: {},
+  components: {AddDataDictionaries},
   mixins: [],
   computed: {},
   data() {
-    return {}
+    return {
+      TabsIndex:0,
+      loading: false,
+      productTableList: {},
+      editConfig:{
+        visible:false,
+        dialogTitleType:"搴勫彛",
+        infomitton:{
+          TabsIndex:0,
+        }
+      },
+      tableColumn: [
+        { label: "搴忓彿", prop: "number",},
+        { label: "搴勫彛鍚嶇О", prop: "name",},
+        { label: "鎻忚堪", prop: "remark" },
+      ],
+      showCol: ["搴忓彿","搴勫彛鍚嶇О", "鎻忚堪",],
+      workshopTableColumn:[
+        { label: "缂栫爜", prop: "number" },
+        { label: "杞﹂棿鍚嶇О", prop: "name" },
+        { label: "鎻忚堪", prop: "remark" },
+      ],
+      showWorkshopCol: ["缂栫爜","杞﹂棿鍚嶇О", "鎻忚堪",],
+      colorTableColumn:[
+        { label: "甯﹀彿棰滆壊", prop: "member_name" },
+        { label: "鎻忚堪", prop: "remark" },
+      ],
+      showColorCol: ["甯﹀彿棰滆壊", "鎻忚堪",],
+      specsTableColumn:[
+        { label: "瑙勬牸", prop: "member_name" },
+        { label: "鎻忚堪", prop: "remark" },
+      ],
+      showSpecsCol: ["瑙勬牸", "鎻忚堪",],
+      getDataParams:{
+        page: 1,
+        pageSize:10,
+        dictType:0,
+      },
+    }
   },
-  created() {},
-  methods: {}
+  created() {
+    this.getProductOrderInfo()
+    // this.setTable()
+    this.getData()
+  },
+  methods: {
+    // 鎼滅储
+    onFilterSearch(searchText) {
+      console.log(searchText)
+    },
+    // 鏂板
+    addBtnClick() {
+      this.editConfig.dialogTitle="鏂板"
+      this.editConfig.visible=true
+    },
+    // 鍒锋柊
+    refreshClick() {
+      console.log("a")
+     },
+    // 鎵撳嵃
+    printClick() { 
+      console.log("a")},
+    //tabs鍒囨崲
+    getTab(tab) {
+      this.TabsIndex = tab
+      this.editConfig.infomitton.TabsIndex=tab
+      // if (this.TabsIndex == 1) {
+      //   this.isRequest = true;
+      // } else {
+      //   this.isRequest = false;
+      // }
+      this.getProductOrderInfo()
+    },
+    // setTable() {
+    //   this.tableBottomColumn = this.tableColumn
+    //   this.showBottomCol = this.showCol
+    //   this.setBottomList()
+    // },
+    selTableCol(val) {
+      this.showcol = val
+      this.tableList.tableColumn = this.setColumnVisible(val, this.tableColumn)
+    },
+    async getProductOrderInfo() {
+        this.getData()
+        if (this.TabsIndex == 0) {
+          // 搴勫彛绠$悊
+          this.editConfig.dialogTitleType="搴勫彛"
+          this.tableBottomColumn = this.tableColumn // 琛ㄥご
+          this.showBottomCol = this.showCol  // 鍔ㄦ�佽〃澶�
+          this.setBottomList()
+        }else if (this.TabsIndex == 1) {
+          // 杞﹂棿绠$悊
+          this.editConfig.dialogTitleType="杞﹂棿"
+          this.tableBottomColumn = this.workshopTableColumn
+          this.showBottomCol = this.showWorkshopCol
+          this.setBottomList()
+        } else if (this.TabsIndex == 2) {
+          // 甯﹀彿棰滆壊
+          this.editConfig.dialogTitleType="甯﹀彿棰滆壊"
+          this.tableBottomColumn = this.colorTableColumn
+          this.showBottomCol = this.showColorCol
+          this.setBottomList()
+
+        } else if (this.TabsIndex == 3) {
+          // 瑙勬牸
+          this.editConfig.dialogTitleType="瑙勬牸"
+          this.tableBottomColumn = this.specsTableColumn
+          this.showBottomCol = this.showSpecsCol
+          this.setBottomList()
+        }
+
+        this.loading = true
+        // this.getProductInventoryInfo(number)
+        // await getProductOrderInfo(number)
+        //   .then((res) => {
+        //     this.productDataBottom = res;
+        //     this.getListValue(this.productDataBottom)
+        //   })
+        //   .catch(() => {
+        //     this.productTableList.tableInfomation = []
+        //   })
+        this.loading = false
+    },
+    setBottomList() {
+      this.productTableList = {
+        selectIndex: true,
+        tableInfomation: [],
+        allcol: [],
+        showcol: this.showBottomCol,
+        tableColumn: this.setColumnVisible(this.showBottomCol, this.tableBottomColumn)
+      }
+      this.setTableList(this.productTableList)
+    },
+    selBottomTableCol(val) {
+      this.showcol = val
+      this.productTableList.tableColumn = this.setColumnVisible(val, this.tableBottomColumn)
+    },
+    setTableList(tableList) {
+      tableList.allcol = tableList.tableColumn.filter((ele) => !ele.default).map((ele) => ele.label)
+      this.searchOptions = []
+      for (let i = 0; i < tableList.tableColumn.length; i++) {
+        const label = tableList.tableColumn[i].label
+        const value = tableList.tableColumn[i].prop
+        this.searchOptions.push({ value: value, label: label })
+      }
+    },
+    setColumnVisible(showCol, tableColumn) {
+      return tableColumn.map((ele) => {
+        return {
+          ...ele,
+          isShowColumn: showCol.includes(ele.label)
+        }
+      })
+    },
+    getData(){
+      getDict({
+        dictType:this.TabsIndex,
+        page:this.getDataParams.page,
+        pageSize:this.getDataParams.pageSize,
+      }).then((res)=>{
+        console.log(res,"res")
+        this.productTableList.tableInfomation=res.data
+      })
+    },
+    rowClick(row,type){
+      if(type==="鏌ョ湅"){
+        this.editConfig.dialogTitle="鏌ョ湅"
+        this.editConfig.visible=true
+      }else if(type==="淇敼"){
+        this.editConfig.dialogTitle="淇敼"
+        this.editConfig.visible=true
+      }else if(type==="鍒犻櫎"){
+        console.log("鍒犻櫎")
+      }
+    }
+  }
 }
 </script>
 
 <!-- Add "scoped" attribute to limit CSS to this component only -->
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+.silkStandardSetting-container {
+  height: 100%;
+
+  .filter-card {
+    margin: 20px 30px;
+    height: 80px;
+    display: flex;
+    align-items: center;
+    padding: 0 20px 0 20px;
+    border-radius: 4px;
+    background-color: #fff;
+  }
+
+  .body-card {
+    margin: 0 30px;
+    background-color: #fff;
+    padding: 10px 15px;
+    height: calc(100% - 180px);
+    border-radius: 4px;
+
+    .edit-save {
+      display: flex;
+      align-items: center;
+      margin-bottom: 10px;
+
+      .edit-save-icon {
+        font-size: 24px;
+        color: #5582f3;
+        cursor: pointer;
+      }
+
+      .edit-sace-label {
+        margin-left: 10px;
+        font-size: 14px;
+        color: #000000d8;
+      }
+    }
+  }
+}
+
+.bottom-tabs {
+  height: 40px;
+  line-height: 40px;
+  // background: #e6ecf2;
+  display: flex;
+
+  .tab-pane {
+    width: 100px;
+    margin-right: 20px;
+    font-size: 14px !important;
+    text-align: center;
+    cursor: pointer;
+    background: #2a78fb;
+    border-top-left-radius: 20px;
+    border-top-right-radius: 20px;
+  }
+}
+
+.bgcGrey {
+  background: #fff;
+}
+
+.bgcWhite {
+  background: #fff !important;
+}</style>

--
Gitblit v1.8.0