@yqg/permission 1.3.2 → 1.3.3

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.2",
3
+ "version": "1.3.3",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "type": "module",
@@ -1,58 +1,65 @@
1
1
  <template>
2
- <Modal v-model:open="open" width="1100px" :maskClosable="false" :zIndex="zIndex">
3
- <template #footer>
4
- <Button @click="open = false" v-show="!isAllChecked && permissionList.length">{{ t('cancel') }}</Button>
5
- <Button type="primary" @click="handleOk" :loading="loading">{{ t('submit') }}</Button>
6
- </template>
7
- <template #title>
8
- <span>{{ t('permissionApply') }}</span>
9
- <span v-show="isAllChecked && permissionList.length" class="crane-permission-title-tips">{{
10
- t('isAllOwnTips') }}</span>
11
- </template>
12
- <Form ref="formRef" :model="formState" :labelCol="{ span: 4 }" :wrapperCol="{ span: 19 }">
13
- <FormItem :label="t('applyPermission')" name="features"
14
- :rules="[{ required: true, message: t('selectPlaceholder') }]">
15
- <Spin :spinning="spining">
16
- <span v-if="!permissionList.length">
17
- {{ t('noPermissionTips') }}
18
- </span>
19
-
20
- <Tree checkable :default-expand-all="true" :tree-data="permissionList" :height="200"
21
- :expandedKeys="expandedKeys" :checkedKeys="formState.features" class="crane-permission-tree"
22
- @check="onCheck" @expand="expandedKeys = $event">
23
- <template #title="item: PermissionType">
24
- <div v-if="item.children && item.children.length">
25
- {{ item.shortName }}
26
- </div>
27
- <PermissionItem v-else :checkedKeys="formState.features" :item="item"
28
- @onChangeTime="onChangeTime" @updateTime="setDefaultTime"
29
- :validTimeOptions="validTimeOptions" />
30
- </template>
31
- </Tree>
32
- <CategorySelector v-if="categoryList.length" :categoryList="categoryList" ref="categoryRef" />
33
- </Spin>
34
- </FormItem>
35
- <FormItem name="applyReason" :label="t('applyReason')" :rules="[{
36
- required: true, message: t('reasonPlaceholder'), trigger: ['change']
37
- }, {
38
- max: 300, message: t('maxLengthTips', { length: 300 }), trigger: ['change', 'blur']
39
- }]">
40
- <Textarea v-model:value.trim="formState.applyReason" :placeholder="t('applyReasonPlaceholder')"
41
- :auto-size="{ minRows: 4, maxRows: 4 }" :disabled="isAllChecked || !permissionList.length">
42
- </Textarea>
43
- <span class="reason-tips" style="font-size: 12px">
44
- {{ t('applyReasonTips') }}
45
- </span>
46
- </FormItem>
47
-
48
- <FormItem :label="t('approvalProcess')">
49
- <ApprovalSteps :stepNodes="stepNodes" />
50
- </FormItem>
51
- </Form>
52
-
53
- <SuccessModal ref="successModal" />
54
-
55
- </Modal>
2
+ <Modal
3
+ v-model:open="open"
4
+ width="1100px"
5
+ :maskClosable="false"
6
+ :zIndex="zIndex"
7
+ >
8
+ <template #footer>
9
+ <Button @click="open = false" v-show="!isAllChecked && permissionList.length">{{ t('cancel') }}</Button>
10
+ <Button type="primary" @click="handleOk" :loading="loading">{{ t('submit') }}</Button>
11
+ </template>
12
+ <template #title>
13
+ <span>{{ t('permissionApply') }}</span>
14
+ <span v-show="isAllChecked && permissionList.length" class="crane-permission-title-tips">{{
15
+ t('isAllOwnTips') }}</span>
16
+ </template>
17
+ <ConfigProvider :getPopupContainer="getPopupContainer">
18
+ <Form ref="formRef" :model="formState" :labelCol="{ span: 4 }" :wrapperCol="{ span: 19 }">
19
+ <FormItem :label="t('applyPermission')" name="features"
20
+ :rules="[{ required: true, message: t('selectPlaceholder') }]">
21
+ <Spin :spinning="spining">
22
+ <span v-if="!permissionList.length">
23
+ {{ t('noPermissionTips') }}
24
+ </span>
25
+
26
+ <Tree checkable :default-expand-all="true" :tree-data="permissionList" :height="200"
27
+ :expandedKeys="expandedKeys" :checkedKeys="formState.features" class="crane-permission-tree"
28
+ @check="onCheck" @expand="expandedKeys = $event">
29
+ <template #title="item: PermissionType">
30
+ <div v-if="item.children && item.children.length">
31
+ {{ item.shortName }}
32
+ </div>
33
+ <PermissionItem
34
+ v-else :checkedKeys="formState.features" :item="item"
35
+ @onChangeTime="onChangeTime" @updateTime="setDefaultTime"
36
+ :validTimeOptions="validTimeOptions" />
37
+ </template>
38
+ </Tree>
39
+ <CategorySelector v-if="categoryList.length" :categoryList="categoryList" ref="categoryRef" />
40
+ </Spin>
41
+ </FormItem>
42
+ <FormItem name="applyReason" :label="t('applyReason')" :rules="[{
43
+ required: true, message: t('reasonPlaceholder'), trigger: ['change']
44
+ }, {
45
+ max: 300, message: t('maxLengthTips', { length: 300 }), trigger: ['change', 'blur']
46
+ }]">
47
+ <Textarea v-model:value.trim="formState.applyReason" :placeholder="t('applyReasonPlaceholder')"
48
+ :auto-size="{ minRows: 4, maxRows: 4 }" :disabled="isAllChecked || !permissionList.length">
49
+ </Textarea>
50
+ <span class="reason-tips" style="font-size: 12px">
51
+ {{ t('applyReasonTips') }}
52
+ </span>
53
+ </FormItem>
54
+
55
+ <FormItem :label="t('approvalProcess')">
56
+ <ApprovalSteps :stepNodes="stepNodes" />
57
+ </FormItem>
58
+ </Form>
59
+
60
+ <SuccessModal ref="successModal" />
61
+ </ConfigProvider>
62
+ </Modal>
56
63
  </template>
57
64
  <script lang="ts" setup>
58
65
  import {
@@ -73,7 +80,8 @@ import {
73
80
  message,
74
81
  Tree,
75
82
  Spin,
76
- Button
83
+ Button,
84
+ ConfigProvider,
77
85
  } from 'ant-design-vue';
78
86
  import SuccessModal from './success-modal.vue';
79
87
  import ApprovalSteps from './approval-steps.vue';
@@ -295,6 +303,12 @@ watch(() => open.value, (cur) => {
295
303
  stepNodes.value = [];
296
304
  }
297
305
  })
306
+
307
+ const getPopupContainer = ():HTMLElement => {
308
+ const modalRoot = document.querySelector('.yqg-permission-modal-content');
309
+
310
+ return (modalRoot || document.body) as HTMLElement;
311
+ }
298
312
  </script>
299
313
 
300
314
  <style scoped>
@@ -8,7 +8,7 @@
8
8
  v-show="categoryValuesMap[item.id]?.length"
9
9
  :rules="[{ required: true, message: t('pleaseChoose'), trigger: ['change', 'blur'] }]">
10
10
  <TreeSelect treeCheckable treeDefaultExpandAll :tree-data="categoryValuesMap[item.id]" showSearch
11
- :getPopupContainer="() => $el" allowClear v-model:value="item.attributeValueIds_view"
11
+ allowClear v-model:value="item.attributeValueIds_view"
12
12
  treeNodeFilterProp="attributeName" v-model:searchValue="searchValue"
13
13
  :fieldNames="{ label: 'attributeName', value: 'id' }" treeNodeLabelProp="attributeName"
14
14
  :show-checked-strategy="SHOW_PARENT">