xiejun
2023-05-29 3821dc55664384df25b6f7d712b889c17537bf06
Merge remote-tracking branch 'origin/master'
已修改3个文件
110 ■■■■ 文件已修改
Source/UBCS-WEB/src/api/GetItem.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/Crud/Crud.vue 100 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/vue.config.js 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/api/GetItem.js
@@ -12,10 +12,11 @@
export const TableData =(params)=>{
  return request({
    url: 'api/ubcs-code/ubcs-code//mdmEngineController/gridTableDataByClassifyOid',
    url: 'api/ubcs-code/ubcs-code/mdmEngineController/gridTableDataByClassifyOid',
    method: 'get',
    params:{
      ...params
    }
  })
}
Source/UBCS-WEB/src/components/Crud/Crud.vue
@@ -1,6 +1,17 @@
<template>
<basic-container style="height: 750px">
  <avue-crud ref="crud" :data="data" :option="option" style="height: 750px" @sort-change="sortChange"></avue-crud>
<basic-container>
  <avue-crud ref="crud"
             :data="data"
             :option="option"
             @sort-change="sortChange"
             v-loading="loading"
             :page="page"
             @selection-change="selectionChange"
             @on-load="onLoad">
      <template slot="menu">
        <el-button type="text">文字按钮</el-button>
      </template>
  </avue-crud>
</basic-container>
</template>
@@ -10,18 +21,17 @@
  name: "Crud.vue",
  data(){
    return{
      data:[
        {
          zhiliangbz:"111",
        },
        {
          xinghaoguige:"1121",
        },
      ],
      loading:false,
      data:[],
      option:{
        //默认高度,
        align:'center',
        menuAlign:'center',
        addBtn:false,
        editBtn:false,
        selection:true,
        selectionFixed:false,
        index:true,
        column:[]
      },
      List:[],
@@ -30,13 +40,19 @@
        combox: "select",
        truefalse: "switch",
        number: "number",
        datetime: "datetime",
        datetime:"datetime",
      },
      page:{
        total: 0,
        currentPage: 1,
        pageSize: 10,
        pageSizes: [10, 30, 50, 100, 200],
      },
    }
  },
  created() {
   this.CrudHeaderRend();
   this.CrudRend()
      this.CrudHeaderRend();
      this.CrudRend()
  },
  activated() {
    this.doLayout()
@@ -47,11 +63,11 @@
        this.$refs.crud.doLayout();
      });
    },
    //表格头渲染
    CrudHeaderRend(){
      MasterTable({codeClassifyOid:"D9CF223F-317D-71EB-BD11-433A94CAD9F3",functionId: 5,_: 1685067339479}).then(res=>{
        this.List=res.data.tableDefineVO.cols[0];
        this.List.forEach(item=>{
          console.log(item)
          let columnItem={
            label:item.title,
            prop:item.field,
@@ -64,31 +80,57 @@
        })
      })
    },
    //表格数据
    CrudRend(){
      TableData({templateOid: "A12826E4-2B66-6D56-DE30-92BB1D7F607F",
        codeClassifyOid: "D9CF223F-317D-71EB-BD11-433A94CAD9F3",
        page: 1,
        limit: 9,
        page: this.page.currentPage,
        limit: this.page.pageSize,
        _: 1685089123575
      }).then(res=>{
        console.log(res)
        this.data=res.data.data
        this.page.total=res.data.total;
        this.data=res.data.data;
      })
    },
    // 排序
    sortChange(val){
      console.log(val)
      // TableData(  {
      //   templateOid: "A12826E4-2B66-6D56-DE30-92BB1D7F607F",
      //   codeClassifyOid: "D9CF223F-317D-71EB-BD11-433A94CAD9F3",
      //   order:"desc",
      //   sort:val.prop
      // }).then(res=>{
      //   console.log(res.data.data)
      //   this.data=res.data.data
      // })
      this.loading=true;
      let order=""
      if(val.order == "ascending"){
        order="asc";
      }else {
        order="desc";
      }
      TableData(  {
        templateOid: "A12826E4-2B66-6D56-DE30-92BB1D7F607F",
        codeClassifyOid: "D9CF223F-317D-71EB-BD11-433A94CAD9F3",
        order:order,
        sort:val.prop,
        page: this.page.currentPage,
        limit: this.page.pageSize,
      }).then(res=>{
        setTimeout(() => {
          this.data=res.data.data;
          this.loading=false;
        }, 100);
      })
    },
    //分页刷新
    async onLoad(val){
      console.log(val)
     await TableData({templateOid: "A12826E4-2B66-6D56-DE30-92BB1D7F607F",
        codeClassifyOid: "D9CF223F-317D-71EB-BD11-433A94CAD9F3",
        page: val.currentPage,
        limit: val.pageSize,
        _: 1685089123575
      }).then(res=>{
       this.data=res.data.data;
      })
    },
    //多选
    selectionChange(row){
      console.log(row)
    }
  }
}
</script>
Source/UBCS-WEB/vue.config.js
@@ -26,10 +26,17 @@
    proxy: {
      '/api': {
        //本地服务接口地址
<<<<<<< HEAD
        // target: 'http://localhost:37000',
        //target: 'http://192.168.3.7:37000',
        target: 'http://dev.vci-tech.com:37000',
        // target: 'http://192.168.1.51:37000/',
=======
         target: 'http://localhost:37000',
        // target: 'http://192.168.3.7:37000',
        // target: 'http://dev.vci-tech.com:37000',
        //target: 'http://192.168.1.51:37000/',
>>>>>>> 1a5351f560e5833cc10127f8188c627b54146478
        //远程演示服务地址,可用于直接启动项目
        // target: 'https://saber.bladex.vip/api',
        ws: true,