@yqg/permission 1.0.3-beta.0 → 1.0.4-beta.0

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.3-beta.0",
3
+ "version": "1.0.4-beta.0",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "type": "module",
@@ -2,6 +2,7 @@
2
2
  <ConfigProvider
3
3
  v-if="allPermissions.length"
4
4
  prefixCls="yqg-permission"
5
+ iconPrefixCls="yqg-permission"
5
6
  :theme="{
6
7
  token: {
7
8
  colorPrimary: props.color,
@@ -23,7 +24,7 @@
23
24
  style="margin-top: calc(50vh - 273px)" />
24
25
  <!-- 可申请 -->
25
26
  <template v-if="curStatus.status === statusMap.DEFAULT">
26
- <div style="margin: 10px">
27
+ <div class="crane-margin10">
27
28
  {{ t('unavailableTips') }}
28
29
  </div>
29
30
  <div>
@@ -32,7 +33,7 @@
32
33
  </template>
33
34
  <!-- 审批中 -->
34
35
  <template v-if="curStatus.status === statusMap.PENDING">
35
- <div style="margin: 10px">
36
+ <div class="crane-margin10">
36
37
  <span
37
38
  class="crane-unapply"
38
39
  v-html="t('appliedTips', {
@@ -41,12 +42,12 @@
41
42
  </span>
42
43
  </div>
43
44
  <div>
44
- <Button style="margin-right: 10px;">{{t('viewApprovalDetail')}}</Button>
45
+ <Button class="crane-margin-right10" @click="goViewApproval">{{t('viewApprovalDetail')}}</Button>
45
46
  <Button type="primary" @click="showModal">+ {{t('applyMore')}}</Button>
46
47
  </div>
47
48
  </template>
48
49
  <!-- 不可申请 -->
49
- <div v-if="curStatus.status === statusMap.NO" style="margin: 10px">
50
+ <div v-if="curStatus.status === statusMap.NO" class="crane-margin10">
50
51
  {{ t('unapplyTips') }}
51
52
  <Popover>
52
53
  <template #content>
@@ -113,6 +114,7 @@
113
114
  const emit = defineEmits(['onSuccess']);
114
115
 
115
116
  const open = ref(false);
117
+ const curApproving = ref<PermissionType>();
116
118
  let permissionList = ref<PermissionListType>([]);
117
119
  let curStatus = ref<Record<string, any>>({
118
120
  imageUrl: noauthority,
@@ -158,6 +160,7 @@
158
160
  const current = data.find((per) => per.businessApplyType === statusMap.PENDING);
159
161
  const cannotApply = data.every((per) => per.businessApplyType === statusMap.NO);
160
162
  if (current) {
163
+ curApproving.value = current;
161
164
  return {
162
165
  imageUrl: applyUrl,
163
166
  status: statusMap.PENDING,
@@ -179,6 +182,12 @@
179
182
  }
180
183
  };
181
184
 
185
+ const goViewApproval = () => {
186
+ if (curApproving.value?.oaFlowUrl) {
187
+ window.open(curApproving.value.oaFlowUrl);
188
+ }
189
+ };
190
+
182
191
  const getPermissions = async () => {
183
192
  if (!allPermissions.value.length || !props.businessCode || !props.workNumber) return;
184
193
 
@@ -213,5 +222,11 @@
213
222
  font-size: 14px;
214
223
  white-space: nowrap;
215
224
  }
225
+ .crane-margin10 {
226
+ margin: 10px;
227
+ }
228
+ .crane-margin-right10 {
229
+ margin-right: 10px;
230
+ }
216
231
  </style>
217
232