@lx-frontend/wrap-element-ui 1.0.0-beta.7 → 1.0.0-beta.8

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": "@lx-frontend/wrap-element-ui",
3
- "version": "1.0.0-beta.7",
3
+ "version": "1.0.0-beta.8",
4
4
  "description": "wrap-element-ui",
5
5
  "author": "",
6
6
  "main": "src/components/index.ts",
@@ -4,37 +4,40 @@
4
4
  :title="title"
5
5
  :with-submit-btn="false"
6
6
  :width="360"
7
- @on-change="handleCloseTechniciansSelectPopup"
7
+ @on-change="handleCloseSelectPopup"
8
8
  >
9
9
  <div
10
10
  slot="form"
11
- class="team-setting__technicians-popover"
11
+ class="team-setting__members-popover"
12
12
  >
13
- <div class="team-setting__technicians-select">
13
+ <div class="team-setting__members-select">
14
14
  <el-input
15
- v-model="techniciansSearchQuery"
15
+ v-model="searchQuery"
16
16
  placeholder="请输入姓名"
17
- @input="handleInputTechniciansSearch"
17
+ @input="handleInputSearch(searchQuery, $attrs.keyId)"
18
18
  />
19
19
  </div>
20
20
  <div
21
- v-if="techniciansSearchQuery && !technicianOptions.length && !fetchTechniciansLoading"
22
- class="team-setting__empty-technicians-options"
21
+ v-if="searchQuery && !options.length && !fetchLoading"
22
+ class="team-setting__empty-members-options"
23
23
  >
24
24
  {{ $attrs.empty || '系统未登记该员工,请先添加员工账号' }}
25
25
  </div>
26
26
  <ul
27
27
  v-else
28
- class="team-setting__technicians-options"
28
+ class="team-setting__members-options"
29
29
  >
30
30
  <li
31
- class="team-setting__technicians-option"
32
- v-for="item in technicianOptions"
31
+ class="team-setting__members-option"
32
+ v-for="item in options"
33
33
  :key="item[$attrs.showConfig.id]"
34
34
  >
35
- <div class="team-setting__technicians-option-left">
35
+ <div class="team-setting__members-option-left" v-if="isShowRoles">
36
36
  {{ `${item[$attrs.showConfig.name]} | ${item.roles}` }}
37
37
  </div>
38
+ <div class="team-setting__members-option-left" v-else>
39
+ {{item[$attrs.showConfig.name]}}
40
+ </div>
38
41
  <el-button
39
42
  v-if="item.is_selected"
40
43
  type="text"
@@ -45,7 +48,7 @@
45
48
  <el-button
46
49
  v-else
47
50
  type="text"
48
- @click="handleAddTechnician($attrs.keyId, item)"
51
+ @click="handleAdd($attrs.keyId, item)"
49
52
  >
50
53
  添加
51
54
  </el-button>
@@ -80,26 +83,31 @@ export default {
80
83
  type: String,
81
84
  default: '添加成员',
82
85
  },
86
+ /** 角色名称展示 */
87
+ isShowRoles: {
88
+ type: Boolean,
89
+ default: true,
90
+ },
83
91
  },
84
92
  data() {
85
93
  return {
86
- techniciansSearchQuery: '',
94
+ searchQuery: '',
87
95
  }
88
96
  },
89
97
  watch: {
90
98
  },
91
99
  methods: {
92
- handleCloseTechniciansSelectPopup(show) {
100
+ handleCloseSelectPopup(show) {
93
101
  if (show) return;
94
- this.techniciansSearchQuery = '';
95
- this.$emit('update:technicianOptions', []);
102
+ this.searchQuery = '';
103
+ this.$emit('update:options', []);
96
104
  },
97
- handleInputTechniciansSearch(query) {
98
- this.$emit('fetchTechniciansMethods', query);
105
+ handleInputSearch(query, keyId) {
106
+ this.$emit('fetchMethods', { query, keyId });
99
107
  },
100
- handleAddTechnician(id, item) {
108
+ handleAdd(id, item) {
101
109
  const query = { id, item };
102
- this.$emit('handleAddTechnician', query);
110
+ this.$emit('handleAdd', query);
103
111
  },
104
112
  },
105
113
  };
@@ -107,25 +115,25 @@ export default {
107
115
 
108
116
  <style lang="less">
109
117
  .team-setting {
110
- &__technicians-popover {
111
- padding: 20px;
118
+ &__members-popover {
119
+ padding: 20px 0;
120
+ margin: 0 20px;
112
121
  height: 350px;
113
122
  overflow-y: auto;
114
123
  }
115
- &__technicians-select {
116
- width: 320px;
117
- }
118
- &__empty-technicians-options {
119
- font-size: 12px;
120
- color: #80838e;
121
- text-align: center;
122
- margin-top: 10px;
124
+ &__empty-members {
125
+ &-options {
126
+ font-size: 12px;
127
+ color: #80838e;
128
+ text-align: center;
129
+ margin-top: 10px;
130
+ }
123
131
  }
124
- &__technicians-options {
132
+ &__members-options {
125
133
  display: flex;
126
134
  flex-direction: column;
127
135
  }
128
- &__technicians-option {
136
+ &__members-option {
129
137
  display: flex;
130
138
  justify-content: space-between;
131
139
  align-items: center;