bri-components 1.2.17 → 1.2.18

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bri-components",
3
- "version": "1.2.17",
3
+ "version": "1.2.18",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -2,13 +2,13 @@
2
2
  <div class="InfoCascader">
3
3
  <dsh-modal
4
4
  v-model="modalVal"
5
- :propsObj="modalPropsObj"
6
5
  mode="middle"
6
+ :propsObj="modalPropsObj"
7
7
  >
8
8
  <dsh-input
9
9
  class="InfoCascader-search"
10
10
  :value="searchData"
11
- :propsObj="inputPropsObj"
11
+ :propsObj="searchPropsObj"
12
12
  ></dsh-input>
13
13
 
14
14
  <div class="InfoCascader-content">
@@ -19,6 +19,7 @@
19
19
  :data="treeData"
20
20
  ></Tree>
21
21
  </div>
22
+
22
23
  <div class="InfoCascader-content-right">
23
24
  <div class="InfoCascader-content-right-title">
24
25
  {{curName}}说明
@@ -34,7 +35,7 @@
34
35
  <div class="InfoCascader-footer">
35
36
  <dsh-buttons
36
37
  class="InfoCascader-footer-btns"
37
- :list="$getOperationList(['cancel', 'confirm'])"
38
+ :list="$getOperationList(['canCancel', 'canConfirm'])"
38
39
  @click="$dispatchEvent($event)"
39
40
  ></dsh-buttons>
40
41
  </div>
@@ -46,7 +47,10 @@
46
47
  export default {
47
48
  name: "InfoCascader",
48
49
  props: {
49
- showModal: Boolean,
50
+ showModal: {
51
+ type: Boolean,
52
+ default: false
53
+ },
50
54
 
51
55
  value: {
52
56
  type: Array,
@@ -69,32 +73,34 @@
69
73
  },
70
74
  data () {
71
75
  return {
76
+ searchData: {
77
+ search: ""
78
+ },
79
+ searchPropsObj: {
80
+ _key: "search",
81
+ _name: "关键字搜索"
82
+ },
83
+ curSelect: {},
84
+
85
+ show: true,
86
+ curName: "",
72
87
  description: "",
88
+
73
89
  operationMap: {
74
- cancel: {
90
+ canCancel: {
75
91
  name: "取消",
76
92
  type: "clickCancel",
77
93
  event: "clickCancel",
78
94
  class: "z-default"
79
95
  },
80
- confirm: {
96
+ canConfirm: {
81
97
  name: "确定",
82
98
  btnType: "primary",
83
99
  type: "clickConfirm",
84
100
  event: "clickConfirm",
85
101
  class: "z-primary"
86
102
  }
87
- },
88
- curSelect: {},
89
- curName: "",
90
- searchData: {
91
- search: ""
92
- },
93
- inputPropsObj: {
94
- _key: "search",
95
- _name: "关键字搜索"
96
- },
97
- show: true
103
+ }
98
104
  };
99
105
  },
100
106
  computed: {
@@ -124,7 +124,8 @@
124
124
  created () {},
125
125
  methods: {
126
126
  onSearch (...params) {
127
- this.$emit("search", ...params);
127
+ this.$emit("search");
128
+ this.$emit("inputChange");
128
129
  },
129
130
  // 无参数
130
131
  onFocus () {
@@ -138,12 +139,17 @@
138
139
  }
139
140
  },
140
141
  onEnter (event) {
142
+ this.$emit("enter");
141
143
  this.$emit("inputChange");
142
144
  },
143
145
  // 参数event
144
146
  onChange (event) {
145
- this.$emit("inputChange");
146
147
  this.changeStatus = true;
148
+
149
+ clearTimeout(this.timer);
150
+ this.timer = setTimeout(() => {
151
+ this.$emit("inputChange");
152
+ }, 1000);
147
153
  },
148
154
  onClear () {
149
155
  this.change();
@@ -51,7 +51,6 @@
51
51
  :propsObj="modalPropsObj"
52
52
  >
53
53
  <dsh-cascader-table
54
- v-if="curVal && isEnlarge"
55
54
  useCol
56
55
  :canEdit="finalCanEdit"
57
56
  :treeColumns="treeColumns"
@@ -56,7 +56,6 @@
56
56
  :propsObj="modalPropsObj"
57
57
  >
58
58
  <bri-flat-table
59
- v-if="isEnlarge"
60
59
  :canEdit="finalCanEdit"
61
60
  :columns="columns"
62
61
  :data="curVal.list"
@@ -19,11 +19,36 @@
19
19
  :value="curValList"
20
20
  :inputIcon="inputIcon"
21
21
  :propsObj="selfPropsObj"
22
- @clickDeleteItem="clickDeleteItem"
23
- @clickClear="clickClear"
22
+ @deleteItem="clickDeleteItem"
23
+ @clear="clickClear"
24
24
  ></bri-control-input>
25
25
 
26
- <!-- 查看 -->
26
+ <!-- 表格查看 -->
27
+ <div
28
+ v-else-if="isUnitShow"
29
+ class="selectUsers-unit"
30
+ >
31
+ <template v-if="!$isEmptyData(curValList)">
32
+ <img
33
+ v-for="item in curValList"
34
+ :src="item.avatarurl || $imageSrcMap.system.boy"
35
+ :key="item._key"
36
+ class="selectUsers-unit-img"
37
+ />
38
+ <span
39
+ v-if="curValList[0]"
40
+ class="selectUsers-unit-text"
41
+ >
42
+ {{ curValList[0].name || curValList[0].realname || curValList[0].mobile }}
43
+ </span>
44
+ </template>
45
+
46
+ <template v-else>
47
+ {{ emptyShowVal }}
48
+ </template>
49
+ </div>
50
+
51
+ <!-- 弹窗查看 -->
27
52
  <div
28
53
  v-else
29
54
  :class="{
@@ -50,8 +75,8 @@
50
75
  v-if="finalCanEdit"
51
76
  class="selectUsers-modal"
52
77
  v-model="showModal"
53
- :propsObj="modalPropsObj"
54
78
  mode="custom"
79
+ :propsObj="modalPropsObj"
55
80
  @cancel="clickCancel"
56
81
  >
57
82
  <div class="selectUsers-modal-wrap">
@@ -65,7 +90,7 @@
65
90
  <dsh-input
66
91
  :value="searchData"
67
92
  :propsObj="inputPropsObj"
68
- @change="search"
93
+ @inputChange="search"
69
94
  ></dsh-input>
70
95
  </div>
71
96
 
@@ -76,6 +76,7 @@
76
76
  scrollWidth: "0",
77
77
  borderY: true,
78
78
  fixedHeader: true,
79
+ canClick: false,
79
80
  cellSelectionOption: {
80
81
  enable: false
81
82
  },
@@ -91,11 +92,14 @@
91
92
  return this.propsObj.state || this.state;
92
93
  },
93
94
  selfClassName () {
95
+ let className = "";
96
+ if (this.selfPropsObj.canClick) {
97
+ className += "bri-table-click ";
98
+ }
94
99
  if (this.loading || !this.data.length) {
95
- return "bri-table-onlyhead";
96
- } else {
97
- return "";
100
+ className += "bri-table-onlyhead ";
98
101
  }
102
+ return className;
99
103
  },
100
104
 
101
105
  rowStyleOption () {
@@ -19,12 +19,11 @@
19
19
  <dsh-modal
20
20
  class="BriTree-modal"
21
21
  v-model="treeFormShow"
22
- :propsObj="treeFormPropsObj"
23
22
  mode="custom"
23
+ :propsObj="treeFormPropsObj"
24
24
  >
25
25
  <div class="BriTree-modal-content">
26
26
  <dsh-form
27
- v-if="treeFormShow"
28
27
  ref="treeForm"
29
28
  :formList="treeFormList"
30
29
  :formData="treeFormData"
@@ -1,21 +1,19 @@
1
1
  <template>
2
2
  <div class="DshBtnModal">
3
3
  <dsh-buttons
4
- :list="$getOperationList(['set'])"
4
+ :list="$getOperationList(['canSet'])"
5
5
  @click="$dispatchEvent($event)"
6
6
  ></dsh-buttons>
7
7
 
8
- <div v-if="showModal">
9
- <dsh-modal
10
- v-model="showModal"
11
- :mode="selfModalPropsObj.mode"
12
- :propsObj="selfModalPropsObj"
13
- >
14
- <div style="margin: 10px 30px;">
15
- <slot></slot>
16
- </div>
17
- </dsh-modal>
18
- </div>
8
+ <dsh-modal
9
+ v-model="showModal"
10
+ :mode="selfModalPropsObj.mode"
11
+ :propsObj="selfModalPropsObj"
12
+ >
13
+ <div style="margin: 10px 30px;">
14
+ <slot></slot>
15
+ </div>
16
+ </dsh-modal>
19
17
  </div>
20
18
  </template>
21
19
 
@@ -34,9 +32,9 @@
34
32
  return {
35
33
  showModal: false,
36
34
  operationMap: {
37
- set: {
35
+ canSet: {
38
36
  name: "设置默认内容",
39
- type: "set",
37
+ type: "canSet",
40
38
  btnType: "dashed",
41
39
  size: "default",
42
40
  long: true,
@@ -139,7 +139,7 @@
139
139
  },
140
140
  computed: {
141
141
  showList () {
142
- return this.useSearch
142
+ return this.useSearch && this.searchName
143
143
  ? this.list.filter(item => (item.name || item._name).includes(this.searchName))
144
144
  : this.list;
145
145
  }
@@ -5,6 +5,22 @@
5
5
 
6
6
  &-show {}
7
7
 
8
+ &-unit {
9
+ .dsh-ellipsis();
10
+
11
+ &-img {
12
+ width: 18px;
13
+ height: 18px;
14
+ vertical-align: middle;
15
+ margin-left: -5px;
16
+ border-radius: 50%;
17
+ }
18
+
19
+ &-text {
20
+ vertical-align: middle;
21
+ }
22
+ }
23
+
8
24
  // 弹框部分
9
25
  &-modal {
10
26
  &-wrap {
@@ -9,5 +9,6 @@
9
9
  .ivu-form-item-error-tip {
10
10
  top: 90%;
11
11
  left: 15px;
12
+ font-size: 12px;
12
13
  }
13
14
  }
@@ -52,6 +52,12 @@
52
52
  max-width: calc(100% - 20px);
53
53
  }
54
54
 
55
+ &-click {
56
+ td {
57
+ cursor: pointer;
58
+ }
59
+ }
60
+
55
61
  td {
56
62
  white-space: normal !important;
57
63
  }