瀏覽代碼

更新url配置

ymy 2 年之前
父節點
當前提交
94cdbf51cb

+ 1 - 1
.env.development

@@ -5,7 +5,7 @@ VUE_APP_TITLE = SaaS协同平台
 ENV = 'development'
 
 # SaaS协同平台/开发环境
-VUE_APP_BASE_API = '/dev-api'
+VUE_APP_BASE_API = '/prod-api'
 
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 3 - 0
src/benyun/compVue/ModuleViewHandle.ts

@@ -34,6 +34,9 @@ export default class ModuleViewHandle extends VueViews{
 
   //获取数据列表
   getList(){
+    if(!this.requestConfig || !this.requestConfig.url){
+      return
+    }
     if(!this.$refs[this.tableID]){
       if(this.timeNum > 4){
         clearInterval(this.time)

+ 1 - 1
src/benyun/compVue/VueViews.ts

@@ -18,7 +18,7 @@ export default class VueViews extends Vue{
   propConfig: any
 
   @Prop()
-  propValue:any
+  propValue?:any
 
   constructor() {
     super()

+ 1 - 1
src/benyun/components/byTable/byTable.vue

@@ -4,7 +4,7 @@
       ref="table"
       :data="value"
       row-id="key_Id"
-      :size="attrs.size"
+      :size="attrs.size?attrs.size:'small'"
       resizable
       :height="attrs.height"
       :max-height="attrs.maxHeight"

+ 102 - 0
src/components/productDialog/productDialog.vue

@@ -0,0 +1,102 @@
+<template>
+  <vxe-modal v-model="value" id="myModa" :width="width?width+'px':'80%'" :height="height?height+'px':'80%'" min-width="460" min-height="320" show-zoom resize storage transfer>
+    <template #title>
+      <span>选择商品</span>
+    </template>
+    <template #default>
+      <module-view :propConfig="config" ref="view" />
+    </template>
+  </vxe-modal>
+</template>
+
+<script lang="ts">
+import { Component, Prop, Vue, Watch } from "vue-property-decorator";
+@Component
+export default class ProductDialog extends Vue {
+  value=false
+
+  @Prop()
+  width?:number
+
+  @Prop()
+  height?:number
+
+  config:any={
+    search:{
+      attr:{
+        size:'mini'
+      },
+      columns:[
+        [{
+          span:6,
+          label:'创建时间',
+          prop:'created',
+          component:'by-date-picker',
+          compConfig:{
+            format:'yyyy-MM-dd',
+            type:'datetime'
+          }
+        }]
+      ]
+    },
+    tool:{
+      tools:{
+        search:true,
+        refresh:true
+      }
+    },
+    table:{
+      attr:{
+        size:'mini',
+        seq:true,
+        align:'center',
+        checkbox:true
+      },
+      columns:[{
+        title:'物料名称',
+        field:'name',
+        width:150
+      },{
+        title:'简称',
+        field:'short_name',
+        width:100
+      },{
+        title:'财务编号',
+        field:'accounting_code'
+      },{
+        title:'国际码',
+        field:'ns_code'
+      },{
+        title:'基本售价',
+        field:'base_price'
+      },{
+        title:'市场价格(统一售价)',
+        field:'mark_price'
+      }]
+    },
+    // request:{
+    //   url:'/system/maindataMaterial/page'
+    // }
+  }
+
+  setShow(v:boolean){
+    this.value = v;
+  }
+
+  created(){
+    this.getList();
+  }
+
+  getList(){
+    (this as any).$request({
+      url: '/maindata/maindataMaterial/page',
+      method: 'get',
+    }).then((res:any) => {
+      console.log('/maindataMaterial/page',res);
+    })
+  }
+} 
+</script>
+<style lang="scss" scoped>
+
+</style>

+ 79 - 0
src/components/storeDialog/storeDialog.vue

@@ -0,0 +1,79 @@
+<template>
+  <vxe-modal v-model="value" id="myModa" :width="width?width+'px':'80%'" :height="height?height+'px':'80%'" min-width="460" min-height="320" show-zoom resize transfer>
+    <template #title>
+      <span>选择仓库</span>
+    </template>
+    <template #default>
+      <module-view :propConfig="config" ref="view" />
+    </template>
+  </vxe-modal>
+</template>
+
+<script lang="ts">
+import { Component, Prop, Vue, Watch } from "vue-property-decorator";
+@Component
+export default class ProductDialog extends Vue {
+  value=false
+
+  @Prop()
+  width?:number
+
+  @Prop()
+  height?:number
+
+  config:any={
+    search:{
+      attr:{
+        size:'mini'
+      },
+      columns:[
+        [{
+          span:6,
+          label:'名称',
+          prop:'created',
+          component:'by-input',
+          compConfig:{
+            placeholder:'请输入名称'
+          }
+        }]
+      ]
+    },
+    tool:{
+      tools:{
+        search:true,
+        refresh:true
+      }
+    },
+    table:{
+      attr:{
+        size:'mini',
+        seq:true,
+        align:'center',
+        checkbox:true
+      },
+      columns:[{
+        title:'名称',
+        field:'name',
+        width:150
+      },{
+        title:'地址',
+        field:'address',
+        width:100
+      },{
+        title:'作坐标',
+        field:'coordinate'
+      }]
+    },
+    // request:{
+    //   url:'/system/maindataMaterial/page'
+    // }
+  }
+
+  setShow(v:boolean){
+    this.value = v;
+  }
+} 
+</script>
+<style lang="scss" scoped>
+
+</style>

+ 8 - 2
src/main.ts

@@ -22,7 +22,7 @@ import './assets/styles/element-variables.scss'
 // import VXETable from 'vxe-table'
 import XEUtils from 'xe-utils'
 import 'vxe-table/lib/style.css'
-import { VXETable, Column,Table } from 'vxe-table'
+import { VXETable, Column,Table,Modal } from 'vxe-table'
 import zhCN from 'vxe-table/lib/locale/lang/zh-CN'
  // 按需加载的方式默认是不带国际化的,自定义国际化需要自行解析占位符 '{0}',例如:
 VXETable.setup({
@@ -31,11 +31,16 @@ VXETable.setup({
 
 import gmComponent from './benyun/plugins/componentRegister'
 
+//组件注册
+import productDialog from './components/productDialog/productDialog.vue'
+Vue.component('productDialog', productDialog);
+
+
 Vue.use(Element, {
   size: Cookies.get('size') || 'medium' // set element-ui default size
 })
 
-Vue.use(Column).use(Table);
+Vue.use(Column).use(Table).use(Modal);
 Vue.use(gmComponent);
 Vue.use(plugins);
 Vue.use(directive);
@@ -46,6 +51,7 @@ Vue.config.productionTip = false
 Vue.prototype.$request = request;
 Vue.prototype.$lodash = lodash;
 Vue.prototype.$download = download; //下载
+Vue.prototype.$XModal = VXETable.modal
 
 new Vue({
   router,

+ 8 - 0
src/router/index.ts

@@ -82,6 +82,14 @@ export const constantRoutes: Array<any> = [
         meta: {
           title: '单据'
         }
+      },
+      {
+        path:'dialog',
+        component:()=> import('@/views/demo/dialogDemo.vue'),
+        name:'Dialog',
+        meta: {
+          title: '弹窗'
+        }
       }
     ]
   }

+ 1 - 0
src/views/demo/bill.vue

@@ -3,6 +3,7 @@
     <by-bill :propConfig="config" @search="search" @onSmt="onSmt" ref="bill" @onAdd="onAdd">
       <template v-slot:cus>我是插槽</template>
     </by-bill>
+    <div style="clear: both;"></div>
     <div>
       <el-button type="primary" plain @click="setSmtValue">设置已提交数据</el-button><br/>
       <el-button type="primary" plain @click="setdraftsBoxValue">设置草稿箱数据</el-button>

+ 21 - 0
src/views/demo/dialogDemo.vue

@@ -0,0 +1,21 @@
+<template>
+  <div>
+    <el-button @click="showProduct">商品弹窗</el-button>
+    <productDialog ref="product" />
+  </div>
+</template>
+
+<script lang="ts">
+import { Component, Prop, Vue, Watch } from "vue-property-decorator";
+@Component
+export default class DialogDemo extends Vue {
+
+  showProduct(){
+    (this.$refs.product as any).setShow(true)
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 5 - 0
src/views/demo/index.vue

@@ -35,6 +35,11 @@ export default class DemoIndex extends Vue {
     click:()=>{
       (this as any).$router.push('/demo/bill')
     }
+  },{
+    name:'弹窗',
+    click:()=>{
+      (this as any).$router.push('/demo/dialog')
+    }
   }]
 }
 </script>