eoss-ui 0.5.71 → 0.5.72

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/lib/cascader.js +22 -3
  2. package/lib/data-table.js +16 -9
  3. package/lib/dialog.js +2 -3
  4. package/lib/eoss-ui.common.js +324 -88
  5. package/lib/icon.js +3 -2
  6. package/lib/icons.js +1 -1
  7. package/lib/index.js +1 -1
  8. package/lib/login.js +12 -2
  9. package/lib/main.js +74 -17
  10. package/lib/nav.js +158 -13
  11. package/lib/select.js +0 -2
  12. package/lib/theme-chalk/base.css +1 -1
  13. package/lib/theme-chalk/fonts/iconfont.ttf +0 -0
  14. package/lib/theme-chalk/fonts/iconfont.woff +0 -0
  15. package/lib/theme-chalk/icon.css +1 -1
  16. package/lib/theme-chalk/index.css +1 -1
  17. package/lib/theme-chalk/main.css +1 -1
  18. package/lib/theme-chalk/menu.css +1 -1
  19. package/lib/theme-chalk/nav.css +1 -1
  20. package/lib/theme-chalk/sizer.css +1 -1
  21. package/lib/theme-chalk/upload.css +1 -1
  22. package/lib/tree.js +3 -3
  23. package/package.json +1 -1
  24. package/packages/cascader/src/main.vue +22 -3
  25. package/packages/data-table/src/main.vue +14 -6
  26. package/packages/dialog/src/main.vue +0 -1
  27. package/packages/icon/src/main.vue +1 -0
  28. package/packages/icons/src/icon.json +1 -1
  29. package/packages/login/src/main.vue +5 -0
  30. package/packages/main/src/main.vue +21 -12
  31. package/packages/main/src/settings.vue +13 -0
  32. package/packages/nav/src/main.vue +99 -5
  33. package/packages/select/src/main.vue +0 -2
  34. package/packages/theme-chalk/lib/base.css +1 -1
  35. package/packages/theme-chalk/lib/fonts/iconfont.ttf +0 -0
  36. package/packages/theme-chalk/lib/fonts/iconfont.woff +0 -0
  37. package/packages/theme-chalk/lib/icon.css +1 -1
  38. package/packages/theme-chalk/lib/index.css +1 -1
  39. package/packages/theme-chalk/lib/main.css +1 -1
  40. package/packages/theme-chalk/lib/menu.css +1 -1
  41. package/packages/theme-chalk/lib/nav.css +1 -1
  42. package/packages/theme-chalk/lib/sizer.css +1 -1
  43. package/packages/theme-chalk/lib/upload.css +1 -1
  44. package/packages/theme-chalk/src/fonts/iconfont.ttf +0 -0
  45. package/packages/theme-chalk/src/fonts/iconfont.woff +0 -0
  46. package/packages/theme-chalk/src/icon.scss +432 -437
  47. package/packages/theme-chalk/src/main.scss +16 -14
  48. package/packages/theme-chalk/src/nav.scss +31 -2
  49. package/packages/tree/src/main.vue +1 -1
  50. package/src/index.js +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eoss-ui",
3
- "version": "0.5.71",
3
+ "version": "0.5.72",
4
4
  "description": "eoss内部业务组件",
5
5
  "main": "lib/eoss-ui.common.js",
6
6
  "files": [
@@ -92,7 +92,26 @@ export default {
92
92
  return {};
93
93
  },
94
94
  created() {},
95
- methods: {},
95
+ methods: {
96
+ getLabel(val, data) {
97
+ let label = '';
98
+ for (let i = 0; i < data.length; i++) {
99
+ let item = data[i];
100
+ if (val == item[this.newProps.value]) {
101
+ label = item[this.newProps.label];
102
+ break;
103
+ } else {
104
+ if (item.children && item.children.length) {
105
+ label = this.getLabel(val, item.children);
106
+ if (label) {
107
+ break;
108
+ }
109
+ }
110
+ }
111
+ }
112
+ return label;
113
+ }
114
+ },
96
115
  render(h) {
97
116
  if (!this.hide) {
98
117
  if (this.readonly) {
@@ -105,7 +124,7 @@ export default {
105
124
  return item
106
125
  .map((ele) => {
107
126
  if (typeof ele === 'string') {
108
- return ele;
127
+ return this.getLabel(ele, this.datas);
109
128
  } else {
110
129
  return ele[this.newProps.label];
111
130
  }
@@ -113,7 +132,7 @@ export default {
113
132
  .join(this.separator);
114
133
  } else {
115
134
  if (typeof item === 'string') {
116
- return item;
135
+ return this.getLabel(item, this.datas);
117
136
  } else {
118
137
  return item[this.newProps.label];
119
138
  }
@@ -456,7 +456,7 @@ export default {
456
456
  show: true,
457
457
  sysCodes: [],
458
458
  infiniteDisabled: this.infiniteScroll,
459
- isUpadeData: false
459
+ isReload: false
460
460
  };
461
461
  },
462
462
  computed: {
@@ -673,7 +673,7 @@ export default {
673
673
  param: {
674
674
  deep: true,
675
675
  handler(val) {
676
- this.getTableData(112);
676
+ this.getTableData();
677
677
  }
678
678
  },
679
679
  page: {
@@ -1011,6 +1011,10 @@ export default {
1011
1011
  .then((res) => {
1012
1012
  this.tableLoading = false;
1013
1013
  if (res.rCode === 0 || res.status === 'success') {
1014
+ if (this.isReload) {
1015
+ this.list = [];
1016
+ this.isReload = false;
1017
+ }
1014
1018
  let results =
1015
1019
  this.parseData !== undefined
1016
1020
  ? this.parseData(res.results || res.data || res)
@@ -1021,10 +1025,13 @@ export default {
1021
1025
  );
1022
1026
  this.config.pageNum += 1;
1023
1027
  } else {
1024
- this.list = results.data || results.records || results.list || [];
1025
- this.$refs.oaTable &&
1026
- this.$refs.oaTable.resetScroll &&
1027
- this.$refs.oaTable.resetScroll(0, 0);
1028
+ this.$nextTick(() => {
1029
+ this.list =
1030
+ results.data || results.records || results.list || [];
1031
+ this.$refs.oaTable &&
1032
+ this.$refs.oaTable.resetScroll &&
1033
+ this.$refs.oaTable.resetScroll(0, 0);
1034
+ });
1028
1035
  }
1029
1036
  this.config.totalCount =
1030
1037
  results.count || results.total || results.totalCount;
@@ -1444,6 +1451,7 @@ export default {
1444
1451
  this.config = util.extend({}, this.config, obj.config);
1445
1452
  }
1446
1453
  if (this.url) {
1454
+ this.isReload = true;
1447
1455
  this.getTableData({ where: obj && obj.where ? obj.where : {}, first });
1448
1456
  }
1449
1457
  },
@@ -447,7 +447,6 @@ export default {
447
447
  this.show = false;
448
448
  this.$emit('close', res, this);
449
449
  if (this.closeParent && this.esDialog) {
450
- console.log(12121);
451
450
  this.esDialog.handleClosed(res);
452
451
  }
453
452
  },
@@ -24,6 +24,7 @@ export default {
24
24
  this.code = val;
25
25
  this.className = 'es-icon';
26
26
  } else {
27
+ this.code = '';
27
28
  this.className = val;
28
29
  }
29
30
  } else {
@@ -1 +1 @@
1
- ["zuomian","monitor","maximize","pointer-up","pointer-left","pointer-down","tri-down","retrograde","rainfall","caveat","print","alarm","table","duigouquan","bumen","mm","accelerate","quanping","password","qing","kaifa","daoru","piaochongicon","instructions","notice","wifi","tishicuo","minganciguanli","switch-off","switch-on","narrow","yidongduan","web","upload","message","go-back","close","shujutongji","folder","edit","enter","dian","wendu","shangwu","shenbao","magnifier","project-add","xiexian","caidan","tupian","home","yinyu","wenhao","template","daiban","set","zhengwen","cuowu","chenggong","indent","increase","ziliaoku","tuichu","quit","leaf","refresh","statistic","gengduo","lvyou","mail","user","zhishi","weizhi","jinggao","zuzhijigou","xue","fenxiang","jinrong","shanchu","jianhao","jiahao","yinzhang","renyuanqiehuan","gouxuanzhong1","circle","fuxuankuang1","fangkuang","application","wenjianjia","jiaren","xiugai","duanxinguanli","workbench","rizhi","gongwen","qingshi","shiwu","official","baogao","document","wodeyouxiang","ziliaojiaohuan","denglu","podium","fangkuai","xuewei","duoyun","pm","xiajia","huanbao","dunpai","shu","gongzuozheng","more","fenlei","delete","fengsu","bar","yuanqu","duomeiti","youjian","qiye","zuixinzixun","biaoge","omit","diaotou","jiantou-left","jiantou-right","jiantou-up","roles","jiantou-next","chijiuhuacunchu","zhuanhuan","cloudy","form","wuye","tri-up","pointer-right","bianji","tri-right","tri-left","daimaguanli","jiankong","kaifazhong","fujian","bingtu","zhuzhuangtu","lose","rmb","move","xiazai","yiban","laoshi","clear","jinyong","yunxing","weihu","chakan","pifu","ren","gouwuche","loading2","yulan","ziliao","yidong","fenxiang11","kaoqin","change","shidu","portfolio","info","yanjing","laba","camera","xitongxiaoxi","xitongguanli","webduan","wagnz","group","shengqian","jiantou-prev","attention","look","guanzhu","daikuan","tubiao","duigou","star","dayin","xinzeng","reduce","goup","calendar","tree","yingyong","caution","zhuanfa","add","zongtiqixian","daochu","gongwu","ihouse","chilun","weixiu","chengguo","trophy","duiwu","qiehuanjiaose","door","shebei","fangjian","microscope","huaxue","shiyanshianquan","shiyan","qiyexinxi","yewuxinxi","lab","shiyanguanli","yuqing","big-screen","signal-search","database","star-mark","cng","professor","informatization","code","science","price","xunhuan","savings","administration","aid","biao","line","xietong","jingzheng","enterprise","datatable","toubiao","bingdu","keji2","qiyeku5","touzi5","zijinliu","zhishichanquan3","kejifuwu2","zhishichanquan2","zijinanquan","kejifuwu1","geju","yiqingfangkong","kejifuwu","anquanfangkong","shujufuwu","shujuceng","shujugongxiang","flows","setup","shujulian","caiwujianguan","caiwuliushui","mubiaogeju","juxing","fuwuqi","touzijigou","xiezilou","jianzhu","logo","touzhi","zijin","fintech","touzixiangmu","library","touziguanli","zhongda","ziyuan","shujutai","shujudongtai","bank","shujuzhongxin","zhongyaomubiao","touzishijian","caiwuguanli","mingzhong","touzishenpi","jingzhenggeju","property","keji","qiyeku","zhongyaojihui","touzilicai","zhishichanquan","touzi","tzz","menu","xiangmushu","pdf","jiazai","gongsi","rise","jbxx","zwxx","jypx","jcgl","ndkh","grjl","shgx","gou","shijian","fukuan","guoji","shoukuan","down","gongzuotai","gaigedongtai","xitongshezhi","relation","zuzhirenshi","kaohepingjia","caiwujiandu","sanzhongyida","mima","xianshi","zhanghao","bangongshi","checked","checke","help","kuoda","banli","xiaoxi","shouqicaidan","shouqicaidan-right","smile","tongzhi","guanji","shuaxin","guiji","tianjiawenjianjia","yunxiazai","del","touzifangan","zongheguanli","sanzhongyida_mian","gongwenguanli1","heguiguanli","jingyingfenxi","txl","diannao","renliziyuan","caiwuxitong","shiwuguanli","shouye","bangongyongpin","sidebar","zhidulashi","log","fawenguanli","huiyiguanli","zuzhishishi","gongwenqianshou","jinxiupeixun","gongwenbao","jiaohuan","daibanshixiang","richeng","tongxunlu","yongche","yanzheng","daibanxinxi","shuben","fanfu","guangbo","shuzhuangtu","bengqiye","tongguo","dengdai","cross","daichuli","zhenggai","shouli","shujuhecha","guanli","paper-file","wenjian","dakaiwenjian","yewu","jiance","jiheguanli","jinru","arrow-right","lingdao","rencai","prev","next","jianpan","qrcode","bohui","homepage","download","gantanhao","dingding","weixin","pad","ios","android","txt","doc","audioo","video","zip","shuru","duanxin","saoma","youxiang","word","excel","fileword","picture","ppt","ca","usb-key","wenjianjiadakai"]
1
+ ["zuomian","monitor","maximize","pointer-up","pointer-left","pointer-down","tri-down","retrograde","rainfall","caveat","print","alarm","table","duigouquan","bumen","mm","accelerate","quanping","password","qing","kaifa","daoru","piaochongicon","instructions","notice","wifi","tishicuo","minganciguanli","switch-off","switch-on","narrow","yidongduan","web","upload","message","go-back","close","shujutongji","folder","edit","enter","dian","wendu","shangwu","shenbao","magnifier","project-add","xiexian","caidan","tupian","home","yinyu","wenhao","template","daiban","set","zhengwen","cuowu","chenggong","indent","increase","ziliaoku","tuichu","quit","leaf","refresh","statistic","gengduo","lvyou","mail","user","zhishi","weizhi","jinggao","zuzhijigou","xue","fenxiang","jinrong","shanchu","jianhao","jiahao","yinzhang","renyuanqiehuan","gouxuanzhong1","circle","fuxuankuang1","fangkuang","application","wenjianjia","jiaren","xiugai","duanxinguanli","workbench","rizhi","gongwen","qingshi","shiwu","official","baogao","document","wodeyouxiang","ziliaojiaohuan","denglu","podium","fangkuai","xuewei","duoyun","pm","xiajia","huanbao","dunpai","shu","gongzuozheng","more","fenlei","delete","fengsu","bar","yuanqu","duomeiti","youjian","qiye","zuixinzixun","biaoge","omit","diaotou","jiantou-left","jiantou-right","jiantou-up","roles","jiantou-next","chijiuhuacunchu","zhuanhuan","cloudy","form","wuye","tri-up","pointer-right","bianji","tri-right","tri-left","daimaguanli","jiankong","kaifazhong","fujian","bingtu","zhuzhuangtu","lose","rmb","move","xiazai","yiban","laoshi","clear","jinyong","yunxing","weihu","chakan","pifu","ren","gouwuche","loading2","yulan","ziliao","yidong","fenxiang11","kaoqin","change","shidu","portfolio","info","yanjing","laba","camera","xitongxiaoxi","xitongguanli","webduan","wagnz","group","shengqian","jiantou-prev","attention","look","guanzhu","daikuan","tubiao","duigou","star","dayin","xinzeng","reduce","goup","calendar","tree","yingyong","caution","zhuanfa","add","zongtiqixian","daochu","gongwu","ihouse","chilun","weixiu","chengguo","trophy","duiwu","qiehuanjiaose","door","shebei","fangjian","microscope","huaxue","shiyanshianquan","shiyan","qiyexinxi","yewuxinxi","lab","shiyanguanli","yuqing","big-screen","signal-search","database","star-mark","cng","professor","informatization","code","science","price","xunhuan","savings","administration","aid","biao","line","xietong","jingzheng","enterprise","datatable","toubiao","bingdu","keji2","qiyeku5","touzi5","zijinliu","zhishichanquan3","kejifuwu2","zhishichanquan2","zijinanquan","kejifuwu1","geju","yiqingfangkong","kejifuwu","anquanfangkong","shujufuwu","shujuceng","shujugongxiang","flows","setup","shujulian","caiwujianguan","caiwuliushui","mubiaogeju","juxing","fuwuqi","touzijigou","xiezilou","jianzhu","logo","touzhi","zijin","fintech","touzixiangmu","library","touziguanli","zhongda","ziyuan","shujutai","shujudongtai","bank","shujuzhongxin","zhongyaomubiao","touzishijian","caiwuguanli","mingzhong","touzishenpi","jingzhenggeju","property","keji","qiyeku","zhongyaojihui","touzilicai","zhishichanquan","touzi","tzz","menu","xiangmushu","pdf","jiazai","gongsi","rise","jbxx","zwxx","jypx","jcgl","ndkh","grjl","shgx","gou","shijian","fukuan","guoji","shoukuan","down","gongzuotai","gaigedongtai","xitongshezhi","relation","zuzhirenshi","kaohepingjia","caiwujiandu","sanzhongyida","mima","xianshi","zhanghao","bangongshi","checked","checke","help","kuoda","banli","xiaoxi","shouqicaidan","shouqicaidan-right","smile","tongzhi","guanji","shuaxin","guiji","tianjiawenjianjia","yunxiazai","del","touzifangan","zongheguanli","sanzhongyida_mian","gongwenguanli1","heguiguanli","jingyingfenxi","txl","diannao","renliziyuan","caiwuxitong","shiwuguanli","shouye","bangongyongpin","sidebar","zhidulashi","log","fawenguanli","huiyiguanli","zuzhishishi","gongwenqianshou","jinxiupeixun","gongwenbao","jiaohuan","daibanshixiang","richeng","tongxunlu","yongche","yanzheng","daibanxinxi","shuben","fanfu","guangbo","shuzhuangtu","bengqiye","tongguo","dengdai","cross","daichuli","zhenggai","shouli","shujuhecha","guanli","paper-file","wenjian","dakaiwenjian","yewu","jiance","jiheguanli","jinru","arrow-right","lingdao","rencai","prev","next","jianpan","qrcode","bohui","homepage","download","gantanhao","dingding","weixin","pad","ios","android","txt","doc","audioo","video","zip","shuru","duanxin","saoma","youxiang","word","excel","fileword","picture","ppt","ca","usb-key","wenjianjiadakai","yingyonglan"]
@@ -60,6 +60,7 @@
60
60
  size="large"
61
61
  type="text"
62
62
  name="username"
63
+ tabindex="1"
63
64
  exclude
64
65
  :placeholder="username.placeholder"
65
66
  :focusShow="focusShow"
@@ -81,6 +82,7 @@
81
82
  v-model="formData.password"
82
83
  size="large"
83
84
  name="password"
85
+ tabindex="2"
84
86
  type="password"
85
87
  :placeholder="password.placeholder"
86
88
  autocomplete="off"
@@ -106,6 +108,7 @@
106
108
  <el-input
107
109
  size="large"
108
110
  name="identifyingCode"
111
+ tabindex="3"
109
112
  type="text"
110
113
  v-model="formData.identifyingCode"
111
114
  placeholder="请输入验证码"
@@ -222,6 +225,7 @@
222
225
  size="large"
223
226
  type="text"
224
227
  name="target"
228
+ tabindex="4"
225
229
  :placeholder="
226
230
  active == 6 ? phone.placeholder : email.placeholder
227
231
  "
@@ -245,6 +249,7 @@
245
249
  placeholder="请输入验证码"
246
250
  autocomplete="off"
247
251
  class="es-label-image-code"
252
+ tabindex="5"
248
253
  >
249
254
  <template slot="prefix">
250
255
  <i class="es-icon-yanzheng es-label-code-image"></i>
@@ -78,7 +78,10 @@
78
78
  </div>
79
79
  <div class="es-main-box" v-if="reset">
80
80
  <div class="es-main-left" v-if="layout !== 'topnav' && showSide">
81
- <div class="es-main-side" v-if="layout === 'topside'">
81
+ <div
82
+ class="es-main-side"
83
+ v-if="layout === 'topside' || layout === 'side'"
84
+ >
82
85
  <div class="es-main-side-logo">
83
86
  <img class="es-main-logo" :src="logoUrl" v-if="logoUrl" />
84
87
  </div>
@@ -116,10 +119,11 @@
116
119
  <es-nav
117
120
  v-if="showMenu && showDefault"
118
121
  :is-top="layout == 'topside'"
122
+ :overlap="layout == 'side'"
119
123
  :data="menu"
120
124
  :default-active="active"
121
125
  :width="navsWidth"
122
- :nav-width="navWidth"
126
+ :nav-width="_navWidth"
123
127
  :icons="icons"
124
128
  :menu-icon="menuIcon"
125
129
  :sub-icon="subIcon"
@@ -220,13 +224,6 @@
220
224
  </div>
221
225
  </div>
222
226
  </div>
223
- <!-- <div v-show="set" ref="box" class="es-sets-button">
224
- <el-button
225
- type="primary"
226
- class="es-icon-xitongguanli"
227
- ref="area"
228
- ></el-button>
229
- </div> -->
230
227
  <settings
231
228
  v-bind="$attrs"
232
229
  :theme="color"
@@ -431,6 +428,10 @@ export default {
431
428
  appCode: String,
432
429
  //菜单左边距
433
430
  navPaddingLeft: Number,
431
+ navBoxWidth: {
432
+ type: String,
433
+ default: '230px'
434
+ },
434
435
  navWidth: String
435
436
  },
436
437
  computed: {
@@ -463,10 +464,17 @@ export default {
463
464
  return true;
464
465
  },
465
466
  navsWidth() {
466
- return this.layout === 'topside' ? '230px' : undefined;
467
+ return this.layout === 'topside' ? this.navBoxWidth : undefined;
468
+ },
469
+ _navWidth() {
470
+ return this.layout === 'side'
471
+ ? this.navBoxWidth
472
+ : this.layout === 'subsystem' || this.layout === 'topside'
473
+ ? '0'
474
+ : this.navWidth;
467
475
  },
468
476
  showNavTitle() {
469
- return this.layout !== 'topside';
477
+ return this.layout !== 'topside' && this.layout !== 'side';
470
478
  },
471
479
  //tabs菜单
472
480
  fourthTabs() {
@@ -518,7 +526,7 @@ export default {
518
526
  } else {
519
527
  return { set: !this.set, system: false };
520
528
  }
521
- } else if (this.layout === 'topside') {
529
+ } else if (this.layout === 'topside' || this.layout === 'side') {
522
530
  if (this.hides && Object.keys(this.hides).length) {
523
531
  return {
524
532
  ...this.hides,
@@ -1368,6 +1376,7 @@ export default {
1368
1376
  }
1369
1377
  }
1370
1378
  } else {
1379
+ this.tabs = [];
1371
1380
  this.handleJump(obj.url, obj.urlopenmode, obj);
1372
1381
  }
1373
1382
  return obj;
@@ -89,6 +89,19 @@
89
89
  <i class="es-icon-gou" v-show="activeName == 'topside'"></i>
90
90
  </div>
91
91
  </el-tooltip>
92
+ <el-tooltip
93
+ class="es-setting-navs-item"
94
+ effect="dark"
95
+ content="侧边菜单布局"
96
+ placement="bottom"
97
+ >
98
+ <div
99
+ class="es-setting-navs es-setting-side-navs"
100
+ @click.stop="handleLayout('side')"
101
+ >
102
+ <i class="es-icon-gou" v-show="activeName == 'side'"></i>
103
+ </div>
104
+ </el-tooltip>
92
105
  </div>
93
106
  </div>
94
107
  </el-drawer>
@@ -5,8 +5,21 @@
5
5
  :class="biserial ? 'es-nav-biserial' : ''"
6
6
  :style="{ width: boxWidth, height: height }"
7
7
  >
8
- <div class="es-nav-initial" v-if="biserial">
8
+ <div
9
+ class="es-nav-initial"
10
+ v-if="biserial"
11
+ :style="{
12
+ width: _navWidth,
13
+ left:
14
+ this.overlap && !this.subMenu.length
15
+ ? '15px'
16
+ : show
17
+ ? '-' + boxWidth
18
+ : ''
19
+ }"
20
+ >
9
21
  <es-menu
22
+ :class="{ 'es-nav-overlap': overlap }"
10
23
  v-bind="$attrs"
11
24
  sub-nav
12
25
  :data="menu"
@@ -22,8 +35,12 @@
22
35
  </div>
23
36
  <div
24
37
  class="es-nav-main"
38
+ :class="{ 'es-nav-overlap': overlap }"
25
39
  :biserial="biserial"
26
- :style="{ width: biserial ? width : boxWidth }"
40
+ :style="{
41
+ width: biserial ? width : boxWidth,
42
+ left: show ? '15px' : navWidth
43
+ }"
27
44
  v-show="biserial ? subMenu.length : menu.length"
28
45
  >
29
46
  <div class="es-nav-title" v-if="showTitle">
@@ -60,6 +77,15 @@
60
77
  @close="handleClose"
61
78
  ></es-menu>
62
79
  </div>
80
+
81
+ <div v-show="show" ref="box" class="es-sets-button">
82
+ <el-button
83
+ round
84
+ type="primary"
85
+ class="es-icon-yingyonglan"
86
+ ref="area"
87
+ ></el-button>
88
+ </div>
63
89
  </div>
64
90
  </template>
65
91
  <script>
@@ -103,9 +129,13 @@ export default {
103
129
  subIcon: {
104
130
  type: Boolean,
105
131
  default: true
106
- }
132
+ },
133
+ overlap: Boolean
107
134
  },
108
135
  computed: {
136
+ show() {
137
+ return this.overlap && this.subMenu.length;
138
+ },
109
139
  menu() {
110
140
  return this.data;
111
141
  },
@@ -135,15 +165,23 @@ export default {
135
165
  },
136
166
  boxWidth() {
137
167
  if (!this.biserial) {
168
+ if (this.overlap) {
169
+ return this.navWidth;
170
+ }
138
171
  if (this.isShow) {
139
172
  return this.width;
140
173
  } else {
141
174
  return this.navWidth;
142
175
  }
143
176
  }
144
- return this.subMenu && this.subMenu.length && this.isShow
177
+ return this.subMenu && this.subMenu.length && this.isShow && !this.overlap
145
178
  ? parseInt(this.width, 10) + parseInt(this.navWidth, 10) + 'px'
146
179
  : this.navWidth;
180
+ },
181
+ _navWidth() {
182
+ return this.overlap
183
+ ? parseInt(this.navWidth, 10) - 30 + 'px'
184
+ : this.navWidth;
147
185
  }
148
186
  },
149
187
  watch: {
@@ -224,8 +262,61 @@ export default {
224
262
  },
225
263
  mounted() {
226
264
  this.resetHeight();
265
+ this.move();
227
266
  },
228
267
  methods: {
268
+ //设置按钮拖动
269
+ move() {
270
+ let area = this.$refs.area.$el;
271
+ let box = this.$refs.box;
272
+ let [sTime, eTime] = [0, 0];
273
+ area.addEventListener('mousedown', (e) => {
274
+ sTime = new Date().getTime();
275
+ let { y: downY, x: downX } = e;
276
+ let { height: winH, width: winW } =
277
+ document.body.getBoundingClientRect();
278
+ //防止拖动期间选中和复制网页文本
279
+ document.body.onselectstart = document.body.oncontextmenu = () => {
280
+ return false;
281
+ };
282
+ document.onmousemove = (eve) => {
283
+ let size = 40;
284
+ let { y: moveY, x: moveX } = eve;
285
+ let { top: boxTop, left: boxLeft } = box.getBoundingClientRect();
286
+ boxTop += moveY - downY;
287
+ boxLeft += moveX - downX;
288
+ boxTop >= winH - size && (boxTop = winH - size);
289
+ boxTop <= -size && (boxTop = -size);
290
+ boxLeft >= winW - size && (boxLeft = winW - size);
291
+ boxLeft <= -size && (boxLeft = -size);
292
+ if (boxTop < 0) {
293
+ boxTop = 0;
294
+ }
295
+ if (boxLeft < 0) {
296
+ boxLeft = 0;
297
+ }
298
+ box.style.top = boxTop + 'px';
299
+ box.style.left = boxLeft + 'px';
300
+ downY = moveY;
301
+ downX = moveX;
302
+ };
303
+ document.onmouseup = () => {
304
+ eTime = new Date().getTime();
305
+ let isClick = eTime - sTime < 200;
306
+ if (isClick) {
307
+ let onArea = () => {
308
+ this.subMenu = [];
309
+ area.removeEventListener('click', onArea);
310
+ };
311
+ area.addEventListener('click', onArea);
312
+ }
313
+ document.onmousemove = null;
314
+ document.body.onselectstart = document.body.oncontextmenu = () => {
315
+ return true;
316
+ };
317
+ };
318
+ });
319
+ },
229
320
  handleChange() {
230
321
  if (this.biserial) {
231
322
  this.isShow = !this.isShow;
@@ -233,7 +324,7 @@ export default {
233
324
  this.isCollapse = !this.isCollapse;
234
325
  if (this.isCollapse) {
235
326
  this.isShow = false;
236
- this.menuWidth = '70px';
327
+ this.menuWidth = this.navWidth;
237
328
  } else {
238
329
  this.isShow = true;
239
330
  this.menuWidth = this.width;
@@ -270,6 +361,9 @@ export default {
270
361
  height -= item.offsetHeight + mt + mb;
271
362
  }
272
363
  });
364
+ if (this.overlap) {
365
+ height -= 15;
366
+ }
273
367
  this.height = height + 'px';
274
368
  this.menuHeight = this.showTitle ? height - 49 + 'px' : height + 'px';
275
369
  });
@@ -200,7 +200,6 @@ export default {
200
200
  immediate: true,
201
201
  handler(val, old) {
202
202
  if (val && val !== old) {
203
- console.log(1);
204
203
  this.label = this.service ? 'label' : 'shortName';
205
204
  this.valKey = this.service ? 'value' : 'cciValue';
206
205
  const options = store.get(val);
@@ -222,7 +221,6 @@ export default {
222
221
  param: {
223
222
  deep: true,
224
223
  handler(val, old) {
225
- console.log(3);
226
224
  if (this.url && JSON.stringify(val) !== JSON.stringify(old)) {
227
225
  this.options = [];
228
226
  this.getData(this.sysCode);