@yqg/permission 1.0.11-alpha.4 → 1.0.11-alpha.6

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": "@yqg/permission",
3
- "version": "1.0.11-alpha.4",
3
+ "version": "1.0.11-alpha.6",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "type": "module",
package/src/App.vue CHANGED
@@ -50,7 +50,7 @@ const changeLocale = () => {
50
50
  <data class="case-card">
51
51
  <div>2:文字组件</div>
52
52
  <yqg-permission
53
- :permissions="[]"
53
+ :permissions="['ddd']"
54
54
  :color="color"
55
55
  workNumber="02124"
56
56
  type="floatButton"
@@ -47,9 +47,8 @@
47
47
  }]">
48
48
  <Textarea
49
49
  v-model:value.trim="formState.applyReason"
50
- show-count
51
50
  :maxlength="300"
52
- :placeholder="t('applyReasonPlaceholder')"
51
+ :placeholder="t('applyReasonPlaceholder', {number: 300})"
53
52
  :auto-size="{ minRows: 2, maxRows: 5 }">
54
53
  </Textarea>
55
54
  </FormItem>
@@ -14,7 +14,7 @@
14
14
  type="primary"
15
15
  :tooltip="t('clickToApply')"
16
16
  :style="{
17
- right,
17
+ right: RIGHT_DEFAULT,
18
18
  top: currentTop,
19
19
  }"
20
20
  >
@@ -115,6 +115,7 @@
115
115
  DEFAULT: 'default',
116
116
  CUSTOM: 'custom',
117
117
  };
118
+ const RIGHT_DEFAULT = '10px';
118
119
 
119
120
  // 重置 message 类名,避免被全局样式覆盖
120
121
  message.config({prefixCls: 'yqg-permission-message'});
@@ -144,34 +145,26 @@
144
145
  type: String,
145
146
  default: 'default'
146
147
  },
147
- right: {
148
- type: String,
149
- default: '100px'
150
- },
151
148
  top: {
152
149
  type: String,
153
150
  default: '100px'
154
151
  }
155
152
  });
156
153
 
157
-
158
154
  const open = ref(false);
159
155
  const curApproving = ref<PermissionType>();
160
156
  let permissionList = ref<PermissionListType>([]);
161
-
162
-
163
-
164
157
  let curStatus = ref<Record<string, any>>({
165
158
  imageUrl: noauthority,
166
159
  status: '',
167
160
  })
168
161
 
169
162
  const allPermissions = computed(() => {
163
+ permissionList.value = [];
170
164
  if (Array.isArray(props.permissions)) {
171
- return props.permissions.map((item) => item.trim());
165
+ return props.permissions.filter((item) => item.trim());
172
166
  }
173
-
174
- return props.permissions?.split(',')?.map((item) => item.trim()) || [];
167
+ return props.permissions?.split(',')?.filter((item) => item.trim()) || [];
175
168
  });
176
169
 
177
170
  const businessCode = computed(() => {
@@ -185,7 +178,6 @@
185
178
  const arr:PermissionListType = [];
186
179
  const flattenData = (list: PermissionListType) => {
187
180
  list.forEach((item) => {
188
- // 去掉名字中第一个.前面的字符串,会有多个.
189
181
  item.name = item.name.replace(/^[^.]+\./, '');
190
182
  if (item.children) {
191
183
  flattenData(item.children);
@@ -256,7 +248,6 @@
256
248
  const getPermissions = async () => {
257
249
  const { workNumber } = props;
258
250
  const permissions = allPermissions.value;
259
-
260
251
  if (!permissions?.length || !workNumber) return;
261
252
 
262
253
  const params = {
package/src/i18n/zh-CH.ts CHANGED
@@ -3,7 +3,7 @@ export default {
3
3
  applyPermission: '申请权限',
4
4
  applyReason: '申请理由',
5
5
  approvalProcess: '审批流程',
6
- applyReasonPlaceholder: '请尽可能详细描述申请理由',
6
+ applyReasonPlaceholder: '请尽可能详细描述申请理由({number}字以内)',
7
7
  cancel: '取消',
8
8
  submit: '确定',
9
9
  close: '关闭',
@@ -29,7 +29,7 @@ export default {
29
29
  maxLengthTips: '最多{length}个字符',
30
30
  lastDays: '{count}天后到期',
31
31
  taday: '今天到期',
32
- clickToApply: '点击申请菜单',
32
+ clickToApply: '点击申请权限',
33
33
  noPermissionTips: '该菜单下暂无权限点',
34
34
  availiables: {
35
35
  SEVEN_DAYS: '7天',