Sfoglia il codice sorgente

Merge branch 'master' of http://47.107.53.207:3000/ymy/oms

AlanWong 1 anno fa
parent
commit
d60adc4c34

+ 200 - 0
npminstall-debug.log

@@ -0,0 +1,200 @@
+{
+  root: 'E:\\benyun\\oms',
+  registry: 'https://registry.npmmirror.com',
+  pkgs: [
+    {
+      name: '',
+      version: 'antv/g2',
+      type: 'git',
+      alias: undefined,
+      arg: [Result]
+    }
+  ],
+  production: false,
+  cacheStrict: false,
+  cacheDir: null,
+  env: {
+    npm_config_registry: 'https://registry.npmmirror.com',
+    npm_config_argv: '{"remain":[],"cooked":["--fix-bug-versions","--china","--userconfig=C:\\\\Users\\\\Administrator\\\\.cnpmrc","--disturl=https://cdn.npmmirror.com/binaries/node","--registry=https://registry.npmmirror.com","antv/g2","--save"],"original":["--fix-bug-versions","--china","--userconfig=C:\\\\Users\\\\Administrator\\\\.cnpmrc","--disturl=https://cdn.npmmirror.com/binaries/node","--registry=https://registry.npmmirror.com","antv/g2","--save"]}',
+    npm_config_user_agent: 'npminstall/7.6.0 npm/? node/v18.15.0 win32 x64',
+    NODE: 'D:\\nodejs\\node.exe',
+    npm_node_execpath: 'D:\\nodejs\\node.exe',
+    npm_execpath: 'D:\\nodejs\\node_global\\node_modules\\cnpm\\node_modules\\npminstall\\bin\\install.js',
+    npm_config_userconfig: 'C:\\Users\\Administrator\\.cnpmrc',
+    npm_config_disturl: 'https://cdn.npmmirror.com/binaries/node',
+    npm_config_r: 'https://registry.npmmirror.com',
+    COREPACK_NPM_REGISTRY: 'https://registry.npmmirror.com',
+    NODEJS_ORG_MIRROR: 'https://cdn.npmmirror.com/binaries/node',
+    NVM_NODEJS_ORG_MIRROR: 'https://cdn.npmmirror.com/binaries/node',
+    PHANTOMJS_CDNURL: 'https://cdn.npmmirror.com/binaries/phantomjs',
+    CHROMEDRIVER_CDNURL: 'https://cdn.npmmirror.com/binaries/chromedriver',
+    OPERADRIVER_CDNURL: 'https://cdn.npmmirror.com/binaries/operadriver',
+    CYPRESS_DOWNLOAD_PATH_TEMPLATE: 'https://cdn.npmmirror.com/binaries/cypress/${version}/${platform}-${arch}/cypress.zip',
+    ELECTRON_MIRROR: 'https://cdn.npmmirror.com/binaries/electron/',
+    ELECTRON_BUILDER_BINARIES_MIRROR: 'https://cdn.npmmirror.com/binaries/electron-builder-binaries/',
+    SASS_BINARY_SITE: 'https://cdn.npmmirror.com/binaries/node-sass',
+    SWC_BINARY_SITE: 'https://cdn.npmmirror.com/binaries/node-swc',
+    NWJS_URLBASE: 'https://cdn.npmmirror.com/binaries/nwjs/v',
+    PUPPETEER_DOWNLOAD_HOST: 'https://cdn.npmmirror.com/binaries/chrome-for-testing',
+    PUPPETEER_DOWNLOAD_BASE_URL: 'https://cdn.npmmirror.com/binaries/chrome-for-testing',
+    PLAYWRIGHT_DOWNLOAD_HOST: 'https://cdn.npmmirror.com/binaries/playwright',
+    SENTRYCLI_CDNURL: 'https://cdn.npmmirror.com/binaries/sentry-cli',
+    SAUCECTL_INSTALL_BINARY_MIRROR: 'https://cdn.npmmirror.com/binaries/saucectl',
+    RE2_DOWNLOAD_MIRROR: 'https://cdn.npmmirror.com/binaries/node-re2',
+    RE2_DOWNLOAD_SKIP_PATH: 'true',
+    PRISMA_ENGINES_MIRROR: 'https://cdn.npmmirror.com/binaries/prisma',
+    npm_config_better_sqlite3_binary_host: 'https://cdn.npmmirror.com/binaries/better-sqlite3',
+    npm_config_keytar_binary_host: 'https://cdn.npmmirror.com/binaries/keytar',
+    npm_config_sharp_binary_host: 'https://cdn.npmmirror.com/binaries/sharp',
+    npm_config_sharp_libvips_binary_host: 'https://cdn.npmmirror.com/binaries/sharp-libvips',
+    npm_config_robotjs_binary_host: 'https://cdn.npmmirror.com/binaries/robotjs',
+    npm_rootpath: 'E:\\benyun\\oms',
+    INIT_CWD: 'E:\\benyun\\oms',
+    npm_config_cache: 'C:\\Users\\Administrator\\.npminstall_tarball'
+  },
+  binaryMirrors: {
+    ENVS: {
+      COREPACK_NPM_REGISTRY: 'https://registry.npmmirror.com',
+      NODEJS_ORG_MIRROR: 'https://cdn.npmmirror.com/binaries/node',
+      NVM_NODEJS_ORG_MIRROR: 'https://cdn.npmmirror.com/binaries/node',
+      PHANTOMJS_CDNURL: 'https://cdn.npmmirror.com/binaries/phantomjs',
+      CHROMEDRIVER_CDNURL: 'https://cdn.npmmirror.com/binaries/chromedriver',
+      OPERADRIVER_CDNURL: 'https://cdn.npmmirror.com/binaries/operadriver',
+      CYPRESS_DOWNLOAD_PATH_TEMPLATE: 'https://cdn.npmmirror.com/binaries/cypress/${version}/${platform}-${arch}/cypress.zip',
+      ELECTRON_MIRROR: 'https://cdn.npmmirror.com/binaries/electron/',
+      ELECTRON_BUILDER_BINARIES_MIRROR: 'https://cdn.npmmirror.com/binaries/electron-builder-binaries/',
+      SASS_BINARY_SITE: 'https://cdn.npmmirror.com/binaries/node-sass',
+      SWC_BINARY_SITE: 'https://cdn.npmmirror.com/binaries/node-swc',
+      NWJS_URLBASE: 'https://cdn.npmmirror.com/binaries/nwjs/v',
+      PUPPETEER_DOWNLOAD_HOST: 'https://cdn.npmmirror.com/binaries/chrome-for-testing',
+      PUPPETEER_DOWNLOAD_BASE_URL: 'https://cdn.npmmirror.com/binaries/chrome-for-testing',
+      PLAYWRIGHT_DOWNLOAD_HOST: 'https://cdn.npmmirror.com/binaries/playwright',
+      SENTRYCLI_CDNURL: 'https://cdn.npmmirror.com/binaries/sentry-cli',
+      SAUCECTL_INSTALL_BINARY_MIRROR: 'https://cdn.npmmirror.com/binaries/saucectl',
+      RE2_DOWNLOAD_MIRROR: 'https://cdn.npmmirror.com/binaries/node-re2',
+      RE2_DOWNLOAD_SKIP_PATH: 'true',
+      PRISMA_ENGINES_MIRROR: 'https://cdn.npmmirror.com/binaries/prisma',
+      npm_config_better_sqlite3_binary_host: 'https://cdn.npmmirror.com/binaries/better-sqlite3',
+      npm_config_keytar_binary_host: 'https://cdn.npmmirror.com/binaries/keytar',
+      npm_config_sharp_binary_host: 'https://cdn.npmmirror.com/binaries/sharp',
+      npm_config_sharp_libvips_binary_host: 'https://cdn.npmmirror.com/binaries/sharp-libvips',
+      npm_config_robotjs_binary_host: 'https://cdn.npmmirror.com/binaries/robotjs'
+    },
+    '@ali/s2': { host: 'https://cdn.npmmirror.com/binaries/looksgood-s2' },
+    sharp: { replaceHostFiles: [Array], replaceHostMap: [Object] },
+    '@tensorflow/tfjs-node': {
+      replaceHostFiles: [Array],
+      replaceHostRegExpMap: [Object],
+      replaceHostMap: [Object]
+    },
+    cypress: {
+      host: 'https://cdn.npmmirror.com/binaries/cypress',
+      newPlatforms: [Object]
+    },
+    'utf-8-validate': {
+      host: 'https://cdn.npmmirror.com/binaries/utf-8-validate/v{version}'
+    },
+    xprofiler: {
+      remote_path: './xprofiler/v{version}/',
+      host: 'https://cdn.npmmirror.com/binaries'
+    },
+    leveldown: { host: 'https://cdn.npmmirror.com/binaries/leveldown/v{version}' },
+    couchbase: { host: 'https://cdn.npmmirror.com/binaries/couchbase/v{version}' },
+    gl: { host: 'https://cdn.npmmirror.com/binaries/gl/v{version}' },
+    sqlite3: {
+      host: 'https://cdn.npmmirror.com/binaries/sqlite3',
+      remote_path: 'v{version}'
+    },
+    '@journeyapps/sqlcipher': { host: 'https://cdn.npmmirror.com/binaries' },
+    grpc: {
+      host: 'https://cdn.npmmirror.com/binaries',
+      remote_path: '{name}/v{version}'
+    },
+    'grpc-tools': { host: 'https://cdn.npmmirror.com/binaries' },
+    wrtc: {
+      host: 'https://cdn.npmmirror.com/binaries',
+      remote_path: '{name}/v{version}'
+    },
+    fsevents: { host: 'https://cdn.npmmirror.com/binaries/fsevents' },
+    nodejieba: { host: 'https://cdn.npmmirror.com/binaries/nodejieba' },
+    canvas: { host: 'https://cdn.npmmirror.com/binaries/canvas' },
+    'skia-canvas': { host: 'https://cdn.npmmirror.com/binaries/skia-canvas' },
+    'flow-bin': {
+      replaceHost: 'https://github.com/facebook/flow/releases/download/v',
+      host: 'https://cdn.npmmirror.com/binaries/flow/v'
+    },
+    'jpegtran-bin': {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/jpegtran-bin'
+    },
+    'cwebp-bin': {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/cwebp-bin'
+    },
+    'zopflipng-bin': {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/zopflipng-bin'
+    },
+    'optipng-bin': {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/optipng-bin'
+    },
+    mozjpeg: {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/mozjpeg-bin'
+    },
+    gifsicle: {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/gifsicle-bin'
+    },
+    'pngquant-bin': {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/pngquant-bin',
+      replaceHostMap: [Object]
+    },
+    'pngcrush-bin': {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/pngcrush-bin'
+    },
+    'jpeg-recompress-bin': {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/jpeg-recompress-bin'
+    },
+    'advpng-bin': {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/advpng-bin'
+    },
+    'pngout-bin': {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/pngout-bin'
+    },
+    'jpegoptim-bin': {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/jpegoptim-bin'
+    },
+    argon2: { host: 'https://cdn.npmmirror.com/binaries/argon2' },
+    'ali-zeromq': { host: 'https://cdn.npmmirror.com/binaries/ali-zeromq' },
+    'ali-usb_ctl': { host: 'https://cdn.npmmirror.com/binaries/ali-usb_ctl' },
+    'gdal-async': { host: 'https://cdn.npmmirror.com/binaries/node-gdal-async' }
+  },
+  forbiddenLicenses: null,
+  flatten: false,
+  proxy: undefined,
+  prune: false,
+  disableFallbackStore: false,
+  workspacesMap: Map(0) {},
+  enableWorkspace: false,
+  workspaceRoot: 'E:\\benyun\\oms',
+  isWorkspaceRoot: true,
+  isWorkspacePackage: false,
+  strictSSL: true,
+  ignoreScripts: false,
+  ignoreOptionalDependencies: false,
+  detail: false,
+  forceLinkLatest: false,
+  trace: false,
+  engineStrict: false,
+  registryOnly: false,
+  client: false,
+  autoFixVersion: [Function: autoFixVersion]
+}

+ 4 - 0
package.json

@@ -8,9 +8,12 @@
     "build:stage": "vue-cli-service build --mode staging"
   },
   "dependencies": {
+    "@antv/data-set": "^0.11.8",
+    "@antv/g2": "^4.2.10",
     "axios": "^1.3.5",
     "clipboard": "^2.0.11",
     "core-js": "^3.8.3",
+    "echarts": "^5.4.2",
     "element-ui": "^2.15.13",
     "file-saver": "^2.0.5",
     "fuse.js": "^6.6.2",
@@ -21,6 +24,7 @@
     "nprogress": "^0.2.0",
     "register-service-worker": "^1.7.2",
     "screenfull": "^5.0.2",
+    "script-ext-html-webpack-plugin": "^2.1.5",
     "svg-sprite-loader": "^6.0.11",
     "uuid": "^9.0.0",
     "vue": "^2.6.14",

+ 1 - 1
src/api/shop.ts

@@ -32,6 +32,6 @@ export function del(data:any) {
 	return request({
 		url: '/omsOrder/omsShop/delete',
 		method: 'POST',
-		data:data
+		params:data
 	})
 }

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

@@ -6,6 +6,7 @@ export default class ModuleViewHandle extends VueViews{
   toolID=this.getUuid(); // 工具栏id
   tableID=this.getUuid(); //表格id
   viewID=this.getUuid();
+  formID=this.getUuid();
   hideSearch=false  // 隐藏/显示搜索
   load=false
   time:any;
@@ -106,6 +107,7 @@ export default class ModuleViewHandle extends VueViews{
 
   //刷新
   onRefresh(){
+    (this.$refs[this.tableID] as any).setPage({pageNo:1,total:0});
 		this.$emit('onRefresh')
   }
   // onRefresh(){

+ 17 - 13
src/benyun/components/byForm/byForm.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="by-form">
+  <div class="by-form" :style="{width:attrs.width}">
     <el-descriptions v-if="attrs.showType=='desc'" :title="attrs.title" :column="attrs.itemCount" :border="attrs.border" :direction="attrs.direction" 
     :size="attrs.size?attrs.size:'medium'" :colon="attrs.colon">
       <template v-for="(itemChild,index) of columns">
@@ -58,6 +58,7 @@
   基础配置
   config:{
     attr:{
+      width:'', //表单宽度
       showType: ''  //展示形式
       title:''  //标题(desc的时候用)
       itemCount:''  //每行展示几列(desc的时候用)
@@ -157,6 +158,9 @@ export default class ByForm extends VueViews {
     this.value = {};
     this.clearChildrenComp();
     this.defaultHandle();
+    setTimeout(()=>{
+      this.clearValidate();
+    },100)
   }
 
   //获取数据
@@ -244,19 +248,18 @@ export default class ByForm extends VueViews {
         resolve(true)
       }
       (this as any).$refs.byForm.validate((valid:any) => {
-          if (valid) {
-            resolve(true)
-          } else {
-            if(!parames || !parames.noMsg){
-              (this as any).$message({
-                message: '验证未通过,请检查!',
-                type: 'warning',
-              })
-            }
-            
-            reject()
+        if (valid) {
+          resolve(true)
+        } else {
+          if(!parames || !parames.noMsg){
+            (this as any).$message({
+              message: '验证未通过,请检查!',
+              type: 'warning',
+            })
           }
-        });
+          reject()
+        }
+      });
     })
   }
   //清除过滤提示
@@ -271,6 +274,7 @@ export default class ByForm extends VueViews {
 <style lang="scss" scoped>
 .by-form{
   width: 100%;
+  margin: 0 auto;
   .form-comp{
     width: 100%;
   }

+ 8 - 2
src/benyun/components/bySwitch/bySwitch.vue

@@ -6,7 +6,7 @@
     :disabled="attrs.disabled"
     :width="attrs.width"
     :active-text="attrs.activeText"
-    :inactive-text="attts.inactiveText"
+    :inactive-text="attrs.inactiveText"
     :active-value="attrs.activeValue"
     :inactive-value="attrs.inactiveValue"
     @change="change"
@@ -20,7 +20,13 @@ import VueViews from '@/benyun/compVue/VueViews';
 
 @Component
 export default class BySwitch extends VueViews {
-  value:any=null
+  value:any=null;
+
+  @Watch('propValue')
+  propValueChange(v:any){
+
+  }
+
   created(){
     if(this.propConfig){
       this.setConfig(this.propConfig)

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

@@ -165,7 +165,8 @@ export default class ByTable extends VueViews {
   }
   recalculate(){
     if(this.$refs.table){
-      (this.$refs.table as any).recalculate();
+      (this.$refs.table as any).recalculate(true);
+      this.$forceUpdate();
     }
   }
   loadTableData(data:Array<any>){
@@ -185,7 +186,6 @@ export default class ByTable extends VueViews {
       this.page.pageSize = this.attrs.pageSize;
     }
     this.recalculate();
-    this.$forceUpdate();
   }
 
   //设置分页

+ 121 - 0
src/benyun/components/chart/columnarChart.vue

@@ -0,0 +1,121 @@
+<template>
+  <div class="box">
+    <div :id="id"></div>
+  </div>
+</template>
+
+<script lang="ts">
+import { Component, Prop, Vue, Watch } from 'vue-property-decorator'
+import { Chart } from "@antv/g2";
+// declare const G2: any
+
+@Component
+export default class ColumnarChart extends Vue {
+  name='columnarChart';
+  @Prop()
+  propConfig:any
+
+  id = '';
+  chart:any = null;
+  created(){
+    this.id = this.randomString();
+  }
+  mounted(){
+    this.setConfig(this.propConfig)
+  }
+  randomString(){
+    const str = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
+    let result = '';
+    for (let i = 10; i > 0; --i) 
+      result += str[Math.floor(Math.random() * str.length)];
+    return result;
+  }
+
+  setConfig(config:any){
+    if(this.chart){
+      this.chart.destroy();
+      this.chart = null;
+    }
+    const w = (document.getElementById(this.id) as any).offsetWidth;
+    const h = (document.getElementById(this.id) as any).offsetHeight;
+    // Step 1: 创建 Chart 对象
+    this.chart = new Chart({
+      container: this.id, // 指定图表容器 ID
+      autoFit: true,
+      padding:config.padding?config.padding:null,
+      width : w, // 指定图表宽度
+      height : h, // 指定图表高度
+      
+    });
+    if(config.tooltip == false){
+      this.chart.tooltip(false);
+    }else if(config.tooltip){
+      this.chart.tooltip(config.tooltip);
+    }
+    if(config.transpose){
+      this.chart.coordinate().transpose()
+    }
+    if(config.legend){
+      this.chart.legend(config.legend)
+    }else{
+      this.chart.legend(false)
+    }
+    // Step 2: 载入数据源
+    this.chart.data(config.data)
+
+    if(config.axis){
+      for(const item of config.axis){
+        this.chart.axis(item.field,item.config)
+      }
+      
+    }
+    if(config.scale){
+      this.chart.scale(config.scale)
+    }
+    if(config.interaction){
+      this.chart.interaction(config.interaction)
+    }
+    // chart.source(config.data);
+    let initChart=this.chart.interval();
+    if(config.position){
+      initChart.position(config.position)
+    }
+    if(config.color){
+      initChart.color(config.color.field,config.color.list)
+    }
+    if(config.sales){
+      this.chart.sales(config.sales.field, config.sales.config);
+    }
+    if(config.label){
+      initChart.label(config.label.field,config.label.config)
+    }
+    if(config.adjust){
+      initChart.adjust(config.adjust)
+    }
+    
+    
+    // Step 4: 渲染图表
+    this.chart.render();
+    
+  }
+
+  setData(data:Array<any>){
+    if(this.chart){
+      this.chart.changeData(data)
+    }
+  }
+
+}
+
+</script>
+
+<style lang="scss" scoped>
+.box{
+  height: 100%;
+  width: 100%;
+  >div{
+    height: 100%;
+    width: 100%;
+  }
+}
+</style>

+ 121 - 0
src/benyun/components/chart/lineChart.vue

@@ -0,0 +1,121 @@
+<template>
+  <div class="box">
+    <div :id="id"></div>
+  </div>
+</template>
+<script lang="ts">
+import { Component, Prop, Vue, Watch } from 'vue-property-decorator'
+import {Chart} from '@antv/g2';
+// import { Chart } from "@antv/g2";
+// declare const G2: any
+
+@Component
+export default class LineChart extends Vue {
+  name='lineChart';
+  @Prop()
+  propConfig:any
+  id = '';
+  chart:any = null;
+  created(){
+    this.id = this.randomString();
+  }
+  mounted(){
+    this.setConfig(this.propConfig)
+  }
+  randomString(){
+    const str = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
+    let result = '';
+    for (let i = 10; i > 0; --i) 
+      result += str[Math.floor(Math.random() * str.length)];
+    return result;
+  }
+  setConfig(config:any){
+    if(this.chart){
+      this.chart.destroy();
+      this.chart = null;
+    }
+    const w = (document.getElementById(this.id) as any).offsetWidth;
+    const h = (document.getElementById(this.id) as any).offsetHeight;
+    if(!this.chart){
+      this.chart = new Chart({
+        container: this.id,
+        height: h,
+        autoFit: true,
+        width:w,
+        padding:config.padding?config.padding:[20, 0, 20, 30]
+      });
+    }
+    if(config.tooltip == false){
+      this.chart.tooltip(false);
+    }else if(config.tooltip){
+      this.chart.tooltip(config.tooltip);
+    }
+    this.chart.legend(config.legend);
+    if(config.axis){
+      for(const item of config.axis){
+        this.chart.axis(item.field,item.config)
+      }
+    }
+    this.chart.data(config.data);
+    if(config.scale){
+      if(config.scale.field){
+        this.chart.scale(this.chart.scale.field,config.scale.config)
+      }else{
+        this.chart.scale(config.scale)
+      }
+    }
+
+    let initchart=this.chart.line();
+    if(config.position){
+      
+      initchart.position(config.position)
+      if(!config.pointClose){
+        this.chart.point().position(config.position);
+      }
+    }
+    if(config.size){
+      initchart.size(config.size)
+    }
+    if(config.shape){
+      initchart.shape(config.shape)
+    }
+    if(config.style){
+      initchart.style(config.style)
+    }
+    if(config.label){
+      initchart.label(config.label.field,config.label.config)
+    }
+    if(config.color){
+      initchart.color(config.color)
+    }
+    if (config.color) {
+      if(config.color.lists){
+        initchart.color(config.color.field, config.color.lists)
+      }else if(config.color.formatter){
+        initchart.color(config.color.field, config.color.formatter)
+      }else{
+        initchart.color(config.color)
+      }
+      
+    }
+    this.chart.render();
+  }
+
+  setData(data:Array<any>){
+    if(this.chart){
+      this.chart.changeData(data)
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.box{
+  height: 100%;
+  width: 100%;
+  >div{
+    height: 100%;
+    width: 100%;
+  }
+}
+</style>

+ 120 - 0
src/benyun/components/chart/pieChart.vue

@@ -0,0 +1,120 @@
+<template>
+  <div class="box">
+    <div :id="id"></div>
+  </div>
+</template>
+<script lang="ts">
+import { Component, Prop, Vue, Watch } from 'vue-property-decorator'
+import { Chart,Util } from '@antv/g2'
+// declare const G2: any
+
+@Component
+export default class PieChart extends Vue {
+  name = 'pieChart'
+  @Prop()
+  propConfig: any
+  id = ''
+  chart:any=null;
+  created() {
+    this.id = this.randomString()
+  }
+  mounted() {
+    this.$nextTick(() => {
+      this.setConfig(this.propConfig)
+    })
+  }
+  randomString() {
+    const str = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
+    let result = ''
+    for (let i = 10; i > 0; --i) result += str[Math.floor(Math.random() * str.length)]
+    return result
+  }
+  setConfig(config:any) {
+    if(this.chart){
+      this.chart.destroy();
+      this.chart = null;
+    }
+    const w = (document.getElementById(this.id) as any).offsetWidth
+    const h = (document.getElementById(this.id) as any).offsetHeight
+    if(!this.chart){
+      this.chart = new Chart({
+        container: this.id,
+        autoFit: true,
+        padding:config.padding?config.padding:null,
+        height: h,
+        width: w
+      })
+    }
+    this.chart.legend(config.legend)
+    
+    this.chart.data(config.data)
+    if(config.guide){
+      this.chart.guide().html(config.guide.html);
+    }
+
+    const interval = this.chart
+      .interval()
+      .adjust('stack')
+      this.chart.interaction('element-single-selected');
+    if (config.coord) {
+      this.chart.coordinate('theta', config.coord.config)
+    } 
+    else {
+      this.chart.coordinate('theta', {
+        radius: 1
+      })
+    }
+
+    if(config.tooltip == false){
+      this.chart.tooltip(false);
+    }else if(config.tooltip){
+      this.chart.tooltip(config.tooltip);
+    }
+
+    if (config.position) {
+      interval.position(config.position)
+    }
+    if (config.color) {
+      if(config.color.lists){
+        interval.color(config.color.field, config.color.lists)
+      }else if(config.color.formatter){
+        interval.color(config.color.field, config.color.formatter)
+      }else{
+        interval.color(config.color.field)
+      }
+    }
+    if (config.label) {
+      if(config.label.formatter){
+        interval.label(config.label.field, config.label.formatter, config.label.config)
+      }else{
+        interval.label(config.label.field, config.label.config)
+      }
+    }
+    if (config.style) {
+      interval.style(config.style)
+    }
+    this.chart.render(true)
+  }
+
+  setData(data:Array<any>){
+    if(this.chart){
+      this.chart.changeData(data)
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.box {
+  height: 100%;
+  width: 100%;
+  > div {
+    height: 100%;
+    width: 100%;
+  }
+}
+</style>
+
+<style lang="scss">
+
+</style>

+ 40 - 13
src/benyun/components/moduleView/moduleView.vue

@@ -10,8 +10,8 @@
     <div class="search" v-if="searchConfig" v-show="!hideSearch">
       <by-form :propConfig="searchConfig" :ref="searchID"></by-form>
       <div class="search-btn">
-        <el-button type="primary" size="mini" icon="el-icon-search" @click="search">搜索</el-button>
-        <el-button size="mini" icon="el-icon-refresh" @click="resert">重置</el-button>
+        <el-button type="primary" size="small" icon="el-icon-search" @click="search">搜索</el-button>
+        <el-button size="small" icon="el-icon-refresh" @click="resert">重置</el-button>
       </div>
     </div>
     <div class="tool-box" v-if="toolConfig">
@@ -26,10 +26,10 @@
     <transition name="el-zoom-in-center" v-if="modalConfig">
       <div class="view-modal" v-show="modalShow">
         <div class="tool-box" v-if="modalConfig.tool">
-          <by-tool :propConfig="modalConfig.tool" @clickHandle="modalHandle" />
+          <by-tool :propConfig="modalConfig.tool" @clickHandle="modalHandle" ref="toolForm" />
         </div>
         <div class="view-form">
-          <by-form :propConfig="modalConfig.form"></by-form>
+          <by-form :propConfig="modalConfig.form" :ref="formID"></by-form>
         </div>
       </div>
     </transition>
@@ -99,8 +99,8 @@ export default class ModuleView extends ModuleViewHandle {
     let fHeight = 0;
     let tHeight = 0;
     let vHeight = (this as any).$el.offsetHeight;
-    if(this.$refs[this.searchID]){
-      fHeight = (this.$refs[this.searchID] as any).$el.offsetHeight + 28 + 8;
+    if(this.$refs[this.searchID] && !this.hideSearch){
+      fHeight = (this.$refs[this.searchID] as any).$el.offsetHeight + 32 + 8;
     }
     if(this.$refs[this.toolID]){
       tHeight = (this.$refs[this.toolID] as any).$el.offsetHeight + 16;
@@ -114,11 +114,16 @@ export default class ModuleView extends ModuleViewHandle {
     }
   }
   search(){
+    (this.$refs[this.tableID] as any).setPage({pageNo:1,total:0});
     this.$emit('search');
     // this.searchHandle()
   }
   detail(row:any){
-    this.$emit('detail',row)
+    this.$emit('detail',row);
+    if(this.$refs[this.formID]){
+      (this.$refs[this.formID] as any).setValue(row);
+      this.modalShow = true;
+    }
   }
   //清除搜索条件
   clearSearch(){
@@ -128,10 +133,7 @@ export default class ModuleView extends ModuleViewHandle {
     this.resertHandle()
   }
   clickHandle(e:string){
-    if(e == 'toggleSearch'){
-      this.calculateCount=0;
-      this.initTable()
-    }
+    
     if(e == 'onAdd'){
       this.modalShow = true;
     }
@@ -140,15 +142,24 @@ export default class ModuleView extends ModuleViewHandle {
     }else{
       this.$emit('clickHandle',e)
     }
+    if(e == 'toggleSearch'){
+      this.calculateCount=0;
+      setTimeout(()=>{
+        this.initTable()
+      },100)
+    }
   }
   //弹窗工具栏
   modalHandle(e:string){
     if(e == 'onReturn'){
       this.modalShow = false;
+      (this.$refs[this.formID] as any).clearValue();
     }else{
       this.$emit('modalHandle',e)
     }
-    
+  }
+  closeModal(){
+    this.modalShow=false;
   }
   getSelectData(){
     let data:Array<any>=[];
@@ -186,7 +197,23 @@ export default class ModuleView extends ModuleViewHandle {
     this.$emit('pagination',page)
     // this.getList();
   }
-
+  getFormValidate(callBack:Function){
+    (this.$refs[this.formID] as any).validate().then(()=>{
+      callBack()
+    })
+  }
+  getFormValue(){
+    if(this.$refs[this.formID]){
+      (this.$refs[this.formID] as any)
+      return (this.$refs[this.formID] as any).getValue();
+    }
+    return null
+  }
+  initFormTool(){
+    if(this.$refs.toolForm){
+      (this.$refs.toolForm as any).initTools();
+    }
+  }
   onChangeRow(row:any){
     this.$emit('onChangeRow',row);
   }

+ 12 - 0
src/benyun/plugins/componentRegister.ts

@@ -51,6 +51,18 @@ const comps: Array<ComBase> = [
     name: "bySwitch",
     component: () => import("@/benyun/components/bySwitch/bySwitch.vue"),
   },
+  {
+    name: "columnarChart",
+    component: () => import("@/benyun/components/chart/columnarChart.vue"),
+  },
+  {
+    name: "lineChart",
+    component: () => import("@/benyun/components/chart/lineChart.vue"),
+  },
+  {
+    name: "pieChart",
+    component: () => import("@/benyun/components/chart/pieChart.vue"),
+  },
 ];
 
 const install = function (Vue: any) {

+ 72 - 0
src/views/components/bar01.vue

@@ -0,0 +1,72 @@
+<template>
+  <div class="chart" :id="id"></div>
+</template>
+
+<script lang="ts">
+import { Component, Prop, Vue, Watch } from 'vue-property-decorator'
+import * as echarts from 'echarts';
+type EChartsOption = echarts.EChartsOption;
+
+@Component
+export default class Bar02 extends Vue {
+  id=this.randomString();
+
+  mounted(){
+    this.init()
+  }
+
+  randomString(){
+    const str = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
+    let result = '';
+    for (let i = 10; i > 0; --i) 
+      result += str[Math.floor(Math.random() * str.length)];
+    return result;
+  }
+
+  init(){
+    let chartDom:any = document.getElementById(this.id);
+    let myChart = echarts.init(chartDom);
+    let option: EChartsOption;
+
+    option = {
+      title: {
+        text: '每月订单量',
+        left: 'center'
+      },
+      xAxis: {
+        type: 'category',
+        data: ['7月', '8月', '9月', '10月', '11月', '12月', '1月','2月','3月','4月','5月','6月']
+      },
+      yAxis: {
+        type: 'value'
+      },
+      series: [
+        {
+          data: [0, 0, 0, 0, 0, 0, 0, 0, 0,100,460,600],
+          type: 'bar',
+          showBackground: true,
+          backgroundStyle: {
+            color: 'rgba(180, 180, 180, 0.2)'
+          },
+          itemStyle: {
+            color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+              { offset: 0, color: '#83bff6' },
+              { offset: 0.5, color: '#188df0' },
+              { offset: 1, color: '#188df0' }
+            ])
+          }
+        }
+      ]
+    };
+
+    option && myChart.setOption(option);
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.chart{
+  height: 100%;
+  width: 100%;
+}
+</style>

+ 82 - 0
src/views/components/pie01.vue

@@ -0,0 +1,82 @@
+<template>
+  <div class="chart" :id="id"></div>
+</template>
+
+<script lang="ts">
+import { Component, Prop, Vue, Watch } from 'vue-property-decorator'
+import * as echarts from 'echarts';
+type EChartsOption = echarts.EChartsOption;
+
+@Component
+export default class Pie01 extends Vue {
+  id=this.randomString();
+
+  mounted(){
+    this.init()
+  }
+
+  randomString(){
+    const str = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
+    let result = '';
+    for (let i = 10; i > 0; --i) 
+      result += str[Math.floor(Math.random() * str.length)];
+    return result;
+  }
+
+  init(){
+    let chartDom:any = document.getElementById(this.id);
+    let myChart = echarts.init(chartDom);
+    let option: EChartsOption;
+
+    option = {
+      title: {
+        text: '月区域订单量',
+        left: 'center'
+      },
+      tooltip: {
+        trigger: 'item'
+      },
+      legend: {
+        orient: 'vertical',
+        left: 'left'
+      },
+      series: [
+        {
+          name: 'Access From',
+          type: 'pie',
+          radius: '50%',
+          data:
+          [
+            {name:'北京市', value:3000},
+            {name:'广西壮族自治区', value:1000},
+            {name:'广东省',value:5500},
+            {name:'湖南省',value:2500},
+            {name:'贵州省',value:1300},
+            {name:'四川省',value:2600},
+            {name:'上海市',value:3600}
+          ],
+          emphasis: {
+            itemStyle: {
+              shadowBlur: 10,
+              shadowOffsetX: 0,
+              shadowColor: 'rgba(0, 0, 0, 0.5)'
+            }
+          },
+          label:{
+            formatter: '{b}: {d}' + '%'
+          }
+        }
+      ]
+    };
+
+    option && myChart.setOption(option);
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.chart{
+  height: 100%;
+  width: 100%;
+}
+</style>

+ 88 - 0
src/views/components/pie02.vue

@@ -0,0 +1,88 @@
+<template>
+  <div class="chart" :id="id"></div>
+</template>
+
+<script lang="ts">
+import { Component, Prop, Vue, Watch } from 'vue-property-decorator'
+import * as echarts from 'echarts';
+type EChartsOption = echarts.EChartsOption;
+
+@Component
+export default class Pie02 extends Vue {
+  id=this.randomString();
+
+  mounted(){
+    this.init()
+  }
+
+  randomString(){
+    const str = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
+    let result = '';
+    for (let i = 10; i > 0; --i) 
+      result += str[Math.floor(Math.random() * str.length)];
+    return result;
+  }
+
+  init(){
+    let chartDom:any = document.getElementById(this.id);
+    let myChart = echarts.init(chartDom);
+    let option: EChartsOption;
+
+    option = {
+      title: {
+        text: '月订单来源',
+        left: 'center'
+      },
+      tooltip: {
+        trigger: 'item'
+      },
+      legend: {
+        orient: 'vertical',
+        right: 'right'
+      },
+      series: [
+        {
+          name: 'Access From',
+          type: 'pie',
+          radius: ['40%', '70%'],
+          avoidLabelOverlap: false,
+          itemStyle: {
+            borderRadius: 10,
+            borderColor: '#fff',
+            borderWidth: 2
+          },
+          label: {
+            formatter: '{b}:\n {d}' + '%',
+            position:'inside'
+          },
+          emphasis: {
+            label: {
+              show: true,
+              fontSize: 20,
+              fontWeight: 'bold'
+            }
+          },
+          labelLine: {
+            show: false
+          },
+          data: [
+            { value: 1048, name: '手工下单' },
+            { value: 735, name: '聚水潭' },
+            { value: 580, name: '其他' }
+          ]
+        }
+      ]
+    };
+
+    option && myChart.setOption(option);
+  }
+
+}
+</script>
+
+<style lang="scss" scoped>
+.chart{
+  height: 100%;
+  width: 100%;
+}
+</style>>

+ 82 - 0
src/views/components/rose.vue

@@ -0,0 +1,82 @@
+<template>
+  <div class="chart" :id="id"></div>
+</template>
+
+<script lang="ts">
+import { Component, Prop, Vue, Watch } from 'vue-property-decorator'
+import * as echarts from 'echarts';
+type EChartsOption = echarts.EChartsOption;
+
+@Component
+export default class Rose extends Vue {
+  id=this.randomString();
+
+  mounted(){
+    this.init()
+  }
+
+  randomString(){
+    const str = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
+    let result = '';
+    for (let i = 10; i > 0; --i) 
+      result += str[Math.floor(Math.random() * str.length)];
+    return result;
+  }
+
+  init(){
+    let chartDom:any = document.getElementById(this.id);
+    let myChart = echarts.init(chartDom);
+    let option: EChartsOption;
+
+    option = {
+      title: {
+        text: '月订单状态',
+        left: 'center'
+      },
+      legend: {
+        top: 'bottom'
+      },
+      toolbox: {
+        show: true,
+        feature: {
+          mark: { show: true },
+          dataView: { show: true, readOnly: false },
+          restore: { show: true },
+          saveAsImage: { show: true }
+        }
+      },
+      series: [
+        {
+          name: 'Nightingale Chart',
+          type: 'pie',
+          radius: [30, 120],
+          center: ['50%', '50%'],
+          roseType: 'area',
+          itemStyle: {
+            borderRadius: 8
+          },
+          data: [
+            { value: 40, name: '待付款' },
+            { value: 38, name: '等待供应商|外仓发货' },
+            { value: 32, name: '已付款待审核' },
+            { value: 30, name: '已客审待财审' },
+            { value: 28, name: '发货中' },
+            { value: 26, name: '已发货' },
+            { value: 22, name: '取消订单' },
+            { value: 18, name: '订单异常' }
+          ]
+        }
+      ]
+    };
+
+    option && myChart.setOption(option);
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.chart{
+  height: 100%;
+  width: 100%;
+}
+</style>

+ 63 - 117
src/views/index.vue

@@ -1,129 +1,75 @@
 <template>
-  <div class="app-container home">
-    <el-row :gutter="20">
-      <el-col :sm="24" :lg="12" style="padding-left: 20px">
-        <h2>SaaS协同平台</h2>
-        <p>
-          <b>当前版本:</b> <span>v{{ version }}</span>
-        </p>
-      </el-col>
-
-      <el-col :sm="24" :lg="12" style="padding-left: 50px">
-        <el-row>
-          <el-col :span="12">
-            <h2>技术选型</h2>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :span="6">
-            <h4>后端技术</h4>
-            <ul>
-              <li>SpringBoot</li>
-              <li>SpringCloud</li>
-              <li>Nacos</li>
-              <li>Sentinel</li>
-              <li>Seata</li>
-              <li>Minio</li>
-              <li>...</li>
-            </ul>
-          </el-col>
-          <el-col :span="6">
-            <h4>前端技术</h4>
-            <ul>
-              <li>Vue</li>
-              <li>Vuex</li>
-              <li>Element-ui</li>
-              <li>Axios</li>
-              <li>Echarts</li>
-              <li>Quill</li>
-              <li>...</li>
-            </ul>
-          </el-col>
-        </el-row>
-      </el-col>
-    </el-row>
-    <el-divider />
+  <div class="index-box">
+    <div class="index-row">
+      <div class="top-box">
+        <pie01 />
+      </div>
+      <div class="top-box">
+        <rose />
+      </div>
+      <div class="top-box">
+        <pie02 />
+      </div>
+    </div>
+    <div class="index-row">
+      <div class="bottom-box">
+        <bar01 />
+      </div>
+    </div>
   </div>
 </template>
 
-<script>
-export default {
-  name: "Index",
-  data() {
-    return {
-      // 版本号
-      version: "3.5.0",
-    };
-  },
-  methods: {
-    goTarget(href) {
-      window.open(href, "_blank");
-    },
-  },
-};
-</script>
-
-<style scoped lang="scss">
-.home {
-  blockquote {
-    padding: 10px 20px;
-    margin: 0 0 20px;
-    font-size: 17.5px;
-    border-left: 5px solid #eee;
-  }
-  hr {
-    margin-top: 20px;
-    margin-bottom: 20px;
-    border: 0;
-    border-top: 1px solid #eee;
-  }
-  .col-item {
-    margin-bottom: 20px;
-  }
-
-  ul {
-    padding: 0;
-    margin: 0;
-  }
-
-  font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
-  font-size: 13px;
-  color: #676a6c;
-  overflow-x: hidden;
-
-  ul {
-    list-style-type: none;
-  }
+<script lang="ts">
+import { Component, Prop, Vue, Watch } from 'vue-property-decorator'
+import pie01 from './components/pie01.vue'
+import rose from './components/rose.vue'
+import pie02 from './components/pie02.vue'
+import bar01 from './components/bar01.vue'
 
-  h4 {
-    margin-top: 0px;
-  }
+@Component({components:{pie01,rose,pie02,bar01}})
+export default class IndexView extends Vue {
 
-  h2 {
-    margin-top: 10px;
-    font-size: 26px;
-    font-weight: 100;
+  mounted(){
+    
   }
+}
+</script>
 
-  p {
-    margin-top: 10px;
-
-    b {
-      font-weight: 700;
+<style lang="scss" scoped>
+.index-box{
+  height: 100%;
+  width: 100%;
+  box-sizing: border-box;
+  padding: 16px;
+  .index-row{
+    height: 50%;
+    width: 100%;
+    display: flex;
+    box-sizing: border-box;
+    .top-box{
+      width: 33.33333%;
+      height: 100%;
+      box-sizing: border-box;
+      padding-right:8px;
     }
-  }
-
-  .update-log {
-    ol {
-      display: block;
-      list-style-type: decimal;
-      margin-block-start: 1em;
-      margin-block-end: 1em;
-      margin-inline-start: 0;
-      margin-inline-end: 0;
-      padding-inline-start: 40px;
+    .top-box:last-child{
+      padding: 0;
     }
+    .bottom-box{
+      width: 50%;
+      height: 100%;
+      box-sizing: border-box;
+      padding-right:8px
+    }
+    .bottom-box:last-child{
+      padding: 0;
+    }
+  }
+  .index-row:first-child{
+    padding-bottom: 8px;
+  }
+  .index-row:last-child{
+    padding-top: 8px;
   }
 }
-</style>
-
+</style>

+ 129 - 0
src/views/index2.vue

@@ -0,0 +1,129 @@
+<template>
+  <div class="app-container home">
+    <el-row :gutter="20">
+      <el-col :sm="24" :lg="12" style="padding-left: 20px">
+        <h2>SaaS协同平台</h2>
+        <p>
+          <b>当前版本:</b> <span>v{{ version }}</span>
+        </p>
+      </el-col>
+
+      <el-col :sm="24" :lg="12" style="padding-left: 50px">
+        <el-row>
+          <el-col :span="12">
+            <h2>技术选型</h2>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="6">
+            <h4>后端技术</h4>
+            <ul>
+              <li>SpringBoot</li>
+              <li>SpringCloud</li>
+              <li>Nacos</li>
+              <li>Sentinel</li>
+              <li>Seata</li>
+              <li>Minio</li>
+              <li>...</li>
+            </ul>
+          </el-col>
+          <el-col :span="6">
+            <h4>前端技术</h4>
+            <ul>
+              <li>Vue</li>
+              <li>Vuex</li>
+              <li>Element-ui</li>
+              <li>Axios</li>
+              <li>Echarts</li>
+              <li>Quill</li>
+              <li>...</li>
+            </ul>
+          </el-col>
+        </el-row>
+      </el-col>
+    </el-row>
+    <el-divider />
+  </div>
+</template>
+
+<script>
+export default {
+  name: "Index",
+  data() {
+    return {
+      // 版本号
+      version: "3.5.0",
+    };
+  },
+  methods: {
+    goTarget(href) {
+      window.open(href, "_blank");
+    },
+  },
+};
+</script>
+
+<style scoped lang="scss">
+.home {
+  blockquote {
+    padding: 10px 20px;
+    margin: 0 0 20px;
+    font-size: 17.5px;
+    border-left: 5px solid #eee;
+  }
+  hr {
+    margin-top: 20px;
+    margin-bottom: 20px;
+    border: 0;
+    border-top: 1px solid #eee;
+  }
+  .col-item {
+    margin-bottom: 20px;
+  }
+
+  ul {
+    padding: 0;
+    margin: 0;
+  }
+
+  font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
+  font-size: 13px;
+  color: #676a6c;
+  overflow-x: hidden;
+
+  ul {
+    list-style-type: none;
+  }
+
+  h4 {
+    margin-top: 0px;
+  }
+
+  h2 {
+    margin-top: 10px;
+    font-size: 26px;
+    font-weight: 100;
+  }
+
+  p {
+    margin-top: 10px;
+
+    b {
+      font-weight: 700;
+    }
+  }
+
+  .update-log {
+    ol {
+      display: block;
+      list-style-type: decimal;
+      margin-block-start: 1em;
+      margin-block-end: 1em;
+      margin-inline-start: 0;
+      margin-inline-end: 0;
+      padding-inline-start: 40px;
+    }
+  }
+}
+</style>
+

+ 14 - 3
src/views/oms/shop/components/tag.vue

@@ -1,7 +1,7 @@
 <template>
-  <el-tag type="success" v-if="value == 'Authorized'">已授权</el-tag>
-  <el-tag type="danger" v-else-if="value == 'Unauthorized'">未授权</el-tag>
-  <el-tag type="info" v-else-if="value == 'Expired'">已过期</el-tag>
+  <el-tag type="success" v-if="value == 'Authorized'" size="mini">已授权</el-tag>
+  <el-tag type="danger" v-else-if="value == 'Unauthorized'" size="mini">未授权</el-tag>
+  <el-tag type="info" v-else-if="value == 'Expired'" size="mini">已过期</el-tag>
   <span v-else></span>
 </template>
 
@@ -20,6 +20,17 @@ export default class ShopTag extends Vue {
   @Prop()
   parentValue:any
 
+  @Watch('propValue')
+  propValueChange(v:any){
+    this.setValue(v);
+  }
+
+  mounted(){
+    if(this.propValue){
+      this.setValue(this.propValue)
+    }
+  }
+
   setValue(v:any){
     this.value = v;
   }

+ 317 - 63
src/views/oms/shop/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="shop">
-    <module-view :propConfig="config" ref="view" v-loading="load" style="height:100%" @pagination="pagination" />
-
+    <module-view :propConfig="config" ref="view" v-loading="load" @pagination="pagination" @modalHandle="modalHandle" @onRefresh="getList" 
+    @resert="queryList" @search="queryList" @clickHandle="clickHandle" @detail="detail" />
   </div>
 </template>
 
@@ -14,6 +14,7 @@ export default class Shop extends Vue {
   load=false;
   time:any;
   timeNum = 0;
+  isSearch=false;
   config:any={
     attr:{
       calculateH:true
@@ -34,15 +35,29 @@ export default class Shop extends Vue {
           component:'by-input',
           compConfig:{}
         },{
-          label:'店铺简称',
-          prop:'shortName',
+          label:'店铺状态',
+          prop:'shopStatus',
           component:'by-input',
           compConfig:{}
         },{
           label:'授权状态',
           prop:'authStatus',
-          component:'by-input',
-          compConfig:{}
+          component:'by-select',
+          compConfig:{
+            attr:{
+              clearable:true,
+              data:[{
+                value:'Authorized',
+                label:'已授权'
+              },{
+                value:'Unauthorized',
+                label:'未授权'
+              },{
+                value:'Expired',
+                label:'已过期'
+              }]
+            }
+          }
         }],
         [{
           label:'授权账号',
@@ -62,15 +77,21 @@ export default class Shop extends Vue {
         },{
           label:'创建时间',
           prop:'createTime',
-          component:'by-input',
-          compConfig:{}
+          component:'by-date-picker',
+          compConfig:{
+            attr:{
+              editable:false,
+              type:'datetimerange',
+              format:'yyyy-MM-dd HH:mm:ss'
+            }
+          }
         }]
       ]
     },
     tool:{
       tools:{
         add:true,
-        delete:true,
+        // delete:true,
         search:true,
         refresh:true
       }
@@ -80,11 +101,12 @@ export default class Shop extends Vue {
         size:'mini',
         seq:true,
         align:'center',
-        checkbox:true
+        // checkbox:true
       },
       columns:[{
         title:'店铺名称',
         field:'shopName',
+        isDetail:true,
         width:150
       },{
         title:'店铺简称',
@@ -121,7 +143,8 @@ export default class Shop extends Vue {
       },{
         title:'授权状态',
         field:'authStatus',
-        width:150
+        width:150,
+        component:shopTag
       },{
         title:'授权开始时间',
         field:'authBegin',
@@ -274,19 +297,48 @@ export default class Shop extends Vue {
         title:'创建时间',
         field:'createTime',
         width:150
+      },{
+        title:'操作',
+        action:true,
+        width:100,
+        plugins:[{
+          name:'删除',
+          event:{
+            click:(item:any) => {
+              this.del(item);
+            }
+          }
+        }]
       }]
     },
     modal:{
       tool:{
         tools:{
           return:true,
-          save:true
+          add:true
         }
       },
       form:{
         attr:{
           size:'small',
-          labelWidth:'130px'
+          labelWidth:'130px',
+          rules:{
+            shopName:[
+              { required: true, message: '请输入店铺名称', trigger: 'blur' }
+            ],
+            shopId:[
+              { required: true, message: '请输入店铺编号', trigger: 'blur' }
+            ],
+            channelName:[
+              {required: true, message: '请输入所属平台', trigger: 'blur'}
+            ],
+            channel:[
+              { required: true, message: '请输入平台类型', trigger: 'blur' }
+            ],
+            authStatus:[
+              { required: true, message: '请选择授权状态', trigger: 'change' }
+            ]
+          }
         },
         columns:[
           [{
@@ -338,7 +390,22 @@ export default class Shop extends Vue {
           },{
             label:'授权状态',
             prop:'authStatus',
-            component:shopTag
+            component:'by-select',
+            compConfig:{
+              attr:{
+                clearable:true,
+                data:[{
+                  value:'Authorized',
+                  label:'已授权'
+                },{
+                  value:'Unauthorized',
+                  label:'未授权'
+                },{
+                  value:'Expired',
+                  label:'已过期'
+                }]
+              }
+            }
           }],
           [{
             label:'APP KEY',
@@ -375,12 +442,12 @@ export default class Shop extends Vue {
             component:'by-date-picker'
           }],
           [{
-            label:'店铺状态',
-            prop:'shopStatus',
+            label:'京东授权状态',
+            prop:'jdAuthStatus',
             component:'by-input'
           },{
-            label:'退款状态',
-            prop:'refundStatus',
+            label:'京东拒绝申请原因',
+            prop:'jdRejectReason',
             component:'by-input'
           },{
             label:'身份证号',
@@ -423,12 +490,12 @@ export default class Shop extends Vue {
             component:'by-input'
           }],
           [{
-            label:'同步发货',
-            prop:'enableSyncSend',
+            label:'支付宝授权状态',
+            prop:'alipayAuthStatus',
             component:'by-input'
           },{
-            label:'揽收轨迹同步发货',
-            prop:'enableTrackSyncSend',
+            label:'菜鸟电子面单',
+            prop:'enableCainiaoElectronicBill',
             component:'by-input'
           },{
             span:12,
@@ -436,23 +503,6 @@ export default class Shop extends Vue {
             prop:'returnAdress',
             component:'by-input'
           }],
-          [{
-            label:'拆分订单整单发货',
-            prop:'enableSplitOrderFullSend',
-            component:'by-input'
-          },{
-            label:'同步库存',
-            prop:'enableSynvStore',
-            component:'by-input'
-          },{
-            label:'订单下载',
-            prop:'enableSyncOrder',
-            component:'by-input'
-          },{
-            label:'天猫物流升级',
-            prop:'enableTmallLogistics',
-            component:'by-input'
-          }],
           [{
             label:'下载截止时间',
             prop:'endPullTime',
@@ -470,62 +520,172 @@ export default class Shop extends Vue {
             prop:'enableTaobaoMessageNotice',
             component:'by-input'
           }],
+          [{
+            label:'拆分订单整单发货',
+            prop:'enableSplitOrderFullSend',
+            component:'by-switch',
+            compConfig:{
+              attr:{
+                activeValue:1,
+                inactiveValue:0
+              }
+            }
+          },{
+            label:'同步库存',
+            prop:'enableSynvStore',
+            component:'by-switch',
+            compConfig:{
+              attr:{
+                activeValue:1,
+                inactiveValue:0
+              }
+            }
+          },{
+            label:'订单下载',
+            prop:'enableSyncOrder',
+            component:'by-switch',
+            compConfig:{
+              attr:{
+                activeValue:1,
+                inactiveValue:0
+              }
+            }
+          },{
+            label:'天猫物流升级',
+            prop:'enableTmallLogistics',
+            component:'by-switch',
+            compConfig:{
+              attr:{
+                activeValue:1,
+                inactiveValue:0
+              }
+            }
+          }],
           [{
             label:'商品下载',
             prop:'enableSkuDownload',
-            component:'by-input'
+            component:'by-switch',
+            compConfig:{
+              attr:{
+                activeValue:1,
+                inactiveValue:0
+              }
+            }
           },{
             label:'开启链接库存同步',
             prop:'enableLinkSync',
-            component:'by-input'
+            component:'by-switch',
+            compConfig:{
+              attr:{
+                activeValue:1,
+                inactiveValue:0
+              }
+            }
           },{
             label:'是否虾皮SIP',
             prop:'shopeeSip',
-            component:'by-input'
+            component:'by-switch',
+            compConfig:{
+              attr:{
+                activeValue:1,
+                inactiveValue:0
+              }
+            }
           },{
-            label:'支付宝授权状态',
-            prop:'alipayAuthStatus',
-            component:'by-input'
+            label:'同步发货',
+            prop:'enableSyncSend',
+            component:'by-switch',
+            compConfig:{
+              attr:{
+                activeValue:1,
+                inactiveValue:0
+              }
+            }
           }],
           [{
-            label:'京东授权状态',
-            prop:'jdAuthStatus',
-            component:'by-input'
+            label:'店铺状态',
+            prop:'shopStatus',
+            component:'by-switch',
+            compConfig:{
+              attr:{
+                activeValue:1,
+                inactiveValue:0
+              }
+            }
           },{
-            label:'京东拒绝申请原因',
-            prop:'jdRejectReason',
-            component:'by-input'
+            label:'退款状态',
+            prop:'refundStatus',
+            component:'by-switch',
+            compConfig:{
+              attr:{
+                activeValue:'1',
+                inactiveValue:'0'
+              }
+            }
           },{
             label:'启用分销',
             prop:'enableDistribution',
-            component:'by-input'
+            component:'by-switch',
+            compConfig:{
+              attr:{
+                activeValue:1,
+                inactiveValue:0
+              }
+            }
           },{
-            label:'菜鸟电子面单',
-            prop:'enableCainiaoElectronicBill',
-            component:'by-input'
+            label:'揽收轨迹同步发货',
+            prop:'enableTrackSyncSend',
+            component:'by-switch',
+            compConfig:{
+              attr:{
+                activeValue:1,
+                inactiveValue:0
+              }
+            }
           }],
           [{
             label:'售后单下载',
             prop:'enableSyncAfterSale',
-            component:'by-input'
+            component:'by-switch',
+            compConfig:{
+              attr:{
+                activeValue:1,
+                inactiveValue:0
+              }
+            }
           },{
             label:'开通AG',
             prop:'enableAg',
-            component:'by-input'
+            component:'by-switch',
+            compConfig:{
+              attr:{
+                activeValue:1,
+                inactiveValue:0
+              }
+            }
           },{
             label:'确认收货自动退款',
             prop:'enableAutoRefund',
-            component:'by-input'
+            component:'by-switch',
+            compConfig:{
+              attr:{
+                activeValue:1,
+                inactiveValue:0
+              }
+            }
           },{
             label:'开启跨境操作',
             prop:'enableCbec',
-            component:'by-input'
+            component:'by-switch',
+            compConfig:{
+              attr:{
+                activeValue:1,
+                inactiveValue:0
+              }
+            }
           }]
         ]
       }
-    },
-    request:{
-      url:'/omsOrder/omsShop/save'
     }
   }
   mounted(){
@@ -533,9 +693,35 @@ export default class Shop extends Vue {
       this.getList()
     })
   }
+  //删除
+  del(item:any){
+    this.$confirm('此操作将永久删除店铺名称为 “'+item.shopName+'” 的数据, 是否继续?', '提示', {
+      confirmButtonText: '确定',
+      cancelButtonText: '取消',
+      type: 'warning'
+    }).then(() => {
+      this.load = true;
+      del({id:item.id}).then(()=>{
+        this.load = false;
+        this.$message({
+          message:'删除成功!',
+          type:'success'
+        })
+        this.pagination();
+      }).catch(()=>{
+        this.load = false;
+      })
+    }).catch(() => {});
+  }
+  //分页
   pagination(){
-    this.getList();
+    if(this.isSearch){
+      this.queryList();
+    }else{
+      this.getList()
+    }
   }
+  //列表请求(只有分页,不包含搜素条件)
   getList(){
     if(!this.$refs.view){
       if(this.timeNum > 5){
@@ -547,7 +733,17 @@ export default class Shop extends Vue {
       this.timeNum ++;
       return
     }
+    this.isSearch = false;
+    let data = (this.$refs.view as any).getPage();
+    this.requestList(data);
+  }
+  //列表请求(包含分页和搜素条件)
+  queryList(){
+    this.isSearch = true;
     let data = (this.$refs.view as any).getQuery();
+    this.requestList(data);
+  }
+  requestList(data:any){
     this.load = true;
     query(data).then((res:any) => {
       this.load = false;
@@ -562,7 +758,64 @@ export default class Shop extends Vue {
     }).catch(()=>{
       this.load = false;
     })
+  }
+  //修改店铺数据
+  onSave(){
+    let data = (this.$refs.view as any).getFormValue();
+    this.load = true;
+    update(data).then((res:any) => {
+      this.$message({
+        message:res.msg,
+        type:'success'
+      });
+      this.load = false;
+      (this.$refs.view as any).closeModal();
+      this.pagination();
+    }).catch(()=>{
+      this.load = false;
+    })
+  }
+  //表单工具栏按钮事件
+  modalHandle(n:string){
+    if(n == 'onAdd'){
+      (this.$refs.view as any).getFormValidate(this.addShop)
+    }
 
+    if(n == 'onSave'){
+      this.onSave();
+    }
+  }
+  //表格工具栏按钮事件
+  clickHandle(n:string){ 
+    if(n == 'onAdd'){
+      this.config.modal.tool.tools.add = true;
+      delete this.config.modal.tool.tools.save;
+      (this.$refs.view as any).initFormTool();
+    }
+  }
+  //添加店铺
+  addShop(){
+    let value = (this.$refs.view as any).getFormValue();
+    if(value){
+      this.load = true;
+      save(value).then((res:any)=>{
+        this.load = false;
+        this.$message({
+          message:res.msg,
+          type:'success'
+        });
+        (this.$refs.view as any).closeModal();
+        this.getList();
+      }).catch(()=>{
+        this.load = false;
+      })
+    }
+  }
+  //点击详情
+  detail(){
+    this.config.modal.tool.tools.save = true;
+    delete this.config.modal.tool.tools.add;
+    (this.$refs.view as any).initFormTool();
   }
 }
 </script>
@@ -571,5 +824,6 @@ export default class Shop extends Vue {
 .shop{
   width: 100%;
   height: 100%;
+  overflow-y: hidden;
 }
 </style>