@yqg/permission 1.3.0-alpha.3 → 1.3.0-alpha.4

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.3.0-alpha.3",
3
+ "version": "1.3.0-alpha.4",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "type": "module",
package/src/App.vue CHANGED
@@ -9,7 +9,11 @@ const color = ref<string>('#1677ff');
9
9
  const locale = ref<LocaleType>('zh-CN');
10
10
 
11
11
  const permissions = reactive([
12
- 'yewei0313.REAQS22.DEPAWED_ANQ22.QUERY22',
12
+ 'CRANE.EMPLOYEE.QUERY',
13
+ 'CRANE.EMPLOYEE.DETAIL_QUERY',
14
+ 'CRANE.EMPLOYEE.ATTRIBUTE_CREATE',
15
+ 'CRANE.EMPLOYEE.ROLE_ASSIGN',
16
+ 'CRANE.EMPLOYEE.DEPARTMENT_ROLE.ATTRIBUTE_ROLE_CREATE',
13
17
  ]);
14
18
  // const permissions = reactive(['CRANE.BUSINESS.QUERY', 'RANE.BUSINESS.CREATE', 'CRANE.BUSINESS.UPDATE', 'CRANE.BUSINESS.DELETE']);
15
19
  const changeColor = () => {
@@ -33,7 +37,7 @@ const changeLocale = () => {
33
37
  <!-- 05184 -->
34
38
  <yqg-permission
35
39
  :permissions="permissions"
36
- workNumber="05184"
40
+ workNumber="04701"
37
41
  :color="color"
38
42
  :locale="locale"
39
43
  @onSuccess="() => {console.log('成功')}"
@@ -9,8 +9,8 @@
9
9
  {{t('noPermissionTips')}}
10
10
  </span>
11
11
 
12
- <Tree checkable :default-expand-all="true" :tree-data="permissionList" :height="200"
13
- :checkedKeys="formState.features" class="crane-permission-tree" @check="onCheck">
12
+ <Tree checkable :default-expand-all="true" :tree-data="permissionList" :height="200" :expandedKeys="expandedKeys"
13
+ :checkedKeys="formState.features" class="crane-permission-tree" @check="onCheck" @expand="expandedKeys = $event">
14
14
  <template #title="item: PermissionType">
15
15
  <div v-if="item.children && item.children.length">
16
16
  {{ item.shortName }}
@@ -107,6 +107,7 @@ const categoryRef = ref();
107
107
  let stepNodes = ref([]);
108
108
  const categoryList = ref<CategoryType[]>([]);
109
109
  const validTimeOptions = ref([]);
110
+ const expandedKeys = ref<any[]>([]);
110
111
  const formState = reactive<formStateType>({
111
112
  features: [],
112
113
  roleVoList: [],
@@ -236,6 +237,15 @@ const onCheck = (checkedIds:any, info:any) => {
236
237
  // 预览审批流程
237
238
  }
238
239
 
240
+ watch(() => props.permissionList, (cur) => {
241
+ expandedKeys.value = [];
242
+ deepTree(cur, (item: any) => {
243
+ if (item.children && item.children.length) {
244
+ expandedKeys.value.push(item.feature);
245
+ }
246
+ })
247
+ })
248
+
239
249
  watch(() => open.value, (cur) => {
240
250
  if (cur) {
241
251
  formRef.value?.resetFields();