@yqg/permission 1.0.9-beta.0 → 1.0.9

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.
@@ -1,4 +1,4 @@
1
- import { F as Qe, i as Kn, C as ug, T as Gs, d as k, r as Xe, o as Pe, a as Vn, b as MA, w as V, g as st, p as fe, c as D, e as pe, f as G, u as K, s as Y, h as Se, j as Ge, t as gg, k as I, l as qt, m as Ws, n as fg, q as qn, v as Ks, x as Zt, y as Fe, z as dg, A as pg, B as Pi, D as Cg, E as Vs, G as RA, H as qs, I as Bg, J as hg, K as Bt, L as Si, M as co, N as ht, O as He, P as En, Q as nt, R as vn, S as Eg, U as vg } from "./index-WEDWEtKt.js";
1
+ import { F as Qe, i as Kn, C as ug, T as Gs, d as k, r as Xe, o as Pe, a as Vn, b as MA, w as V, g as st, p as fe, c as D, e as pe, f as G, u as K, s as Y, h as Se, j as Ge, t as gg, k as I, l as qt, m as Ws, n as fg, q as qn, v as Ks, x as Zt, y as Fe, z as dg, A as pg, B as Pi, D as Cg, E as Vs, G as RA, H as qs, I as Bg, J as hg, K as Bt, L as Si, M as co, N as ht, O as He, P as En, Q as nt, R as vn, S as Eg, U as vg } from "./index-C8yV-rG_.js";
2
2
  function Mn(e) {
3
3
  "@babel/helpers - typeof";
4
4
  return Mn = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
@@ -16416,7 +16416,7 @@ ne.interceptors.response.use(
16416
16416
  return pt.error(t), Promise.reject(e);
16417
16417
  }
16418
16418
  );
16419
- const Wr = "/admin/crane", Gy = {
16419
+ const Wr = "/crane", Gy = {
16420
16420
  getPermissions: (e) => ne.get(`${Wr}/permission/apply`, { params: e }),
16421
16421
  getFlowPreview: (e) => ne.post(`${Wr}/permission/apply/oa/flow/submit/preview`, e),
16422
16422
  submitApply: (e) => ne.post(`${Wr}/permission/apply/oa/flow/submit`, e)
@@ -16426,7 +16426,7 @@ const Wr = "/admin/crane", Gy = {
16426
16426
  applyReason: "申请理由",
16427
16427
  approvalProcess: "审批流程",
16428
16428
  applyReason1: "新入职员工申请",
16429
- applyReason2: "临时项目",
16429
+ applyReason2: "项目需要",
16430
16430
  applyReason3: "数据查询与分析",
16431
16431
  applyReasonPlaceholder: "请尽可能详细描述申请理由",
16432
16432
  cancel: "取消",
@@ -16442,7 +16442,7 @@ const Wr = "/admin/crane", Gy = {
16442
16442
  adaptDepartment: "适用部门",
16443
16443
  noApprovalProcess: "无审批流程",
16444
16444
  excessTips: "一次最多可申请{number}个权限",
16445
- unavailableTips: "您暂无权限查看/操作该页面,请点击按钮进行申请",
16445
+ unavailableTips: "您暂无权限查看/操作该页面,请点击下方按钮进行申请",
16446
16446
  appliedTips: "权限已申请,正在{status}...",
16447
16447
  unapplyTips: "您暂无权限查看/操作该页面,且该页面中没有您可以申请的权限,",
16448
16448
  callManager: "如有需要请联系系统管理员",
@@ -16482,7 +16482,7 @@ const Wr = "/admin/crane", Gy = {
16482
16482
  applyReason: "申请理由",
16483
16483
  approvalProcess: "审批流程",
16484
16484
  applyReason1: "新入职员工申请",
16485
- applyReason2: "临时项目",
16485
+ applyReason2: "项目需要",
16486
16486
  applyReason3: "数据查询与分析",
16487
16487
  applyReasonPlaceholder: "请尽可能详细描述申请理由",
16488
16488
  cancel: "取消",
@@ -16498,7 +16498,7 @@ const Wr = "/admin/crane", Gy = {
16498
16498
  adaptDepartment: "适用部门",
16499
16499
  noApprovalProcess: "无审批流程",
16500
16500
  excessTips: "一次最多可申请{number}个权限",
16501
- unavailableTips: "您暂无权限查看/操作该页面,请点击按钮进行申请",
16501
+ unavailableTips: "您暂无权限查看/操作该页面,请点击下方按钮进行申请",
16502
16502
  appliedTips: "权限已申请,正在{status}...",
16503
16503
  unapplyTips: "您暂无权限查看/操作该页面,且该页面中没有您可以申请的权限,",
16504
16504
  callManager: "如有需要请联系系统管理员",
@@ -16590,7 +16590,7 @@ const Wr = "/admin/crane", Gy = {
16590
16590
  emits: ["onSuccess"],
16591
16591
  setup(e, { emit: t }) {
16592
16592
  const n = vg(
16593
- () => import("./apply-modal-B0Mtpli3.js").then((h) => h.a)
16593
+ () => import("./apply-modal-CAyKTe_X.js").then((h) => h.a)
16594
16594
  ), o = {
16595
16595
  DEFAULT: "DEFAULT",
16596
16596
  PENDING: "PENDING",
@@ -16643,7 +16643,7 @@ const Wr = "/admin/crane", Gy = {
16643
16643
  let v = await Gy.getPermissions(h);
16644
16644
  s.value = u(v.body || []), l.value = g(s.value);
16645
16645
  }, C = () => {
16646
- i.value = !i.value;
16646
+ p(), i.value = !i.value;
16647
16647
  };
16648
16648
  return Se(p), V(() => r.locale, (h, v) => {
16649
16649
  h !== v && localStorage.setItem("permission_locale", r.locale);
@@ -16768,7 +16768,7 @@ const Wr = "/admin/crane", Gy = {
16768
16768
  for (const [o, r] of t)
16769
16769
  n[o] = r;
16770
16770
  return n;
16771
- }, sw = /* @__PURE__ */ aw(iw, [["__scopeId", "data-v-0923d8e1"]]), xw = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
16771
+ }, sw = /* @__PURE__ */ aw(iw, [["__scopeId", "data-v-debef759"]]), xw = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
16772
16772
  __proto__: null,
16773
16773
  default: sw
16774
16774
  }, Symbol.toStringTag, { value: "Module" }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yqg/permission",
3
- "version": "1.0.9-beta.0",
3
+ "version": "1.0.9",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "type": "module",
@@ -13,16 +13,14 @@
13
13
  "dev": "vite",
14
14
  "preview": "vite preview"
15
15
  },
16
- "dependencies": {
17
- "@ant-design/icons-vue": "^7.0.1",
16
+ "devDependencies": {
17
+ "@ant-design/icons-vue": "^7.0.1",
18
18
  "@commitlint/cli": "^19.5.0",
19
19
  "@commitlint/config-conventional": "^19.5.0",
20
20
  "ant-design-vue": "4.x",
21
21
  "axios": "^1.7.7",
22
22
  "vite-plugin-css-injected-by-js": "^3.5.2",
23
- "vue": "^3.5.12"
24
- },
25
- "devDependencies": {
23
+ "vue": "^3.5.12",
26
24
  "@typescript-eslint/parser": "^8.13.0",
27
25
  "@vitejs/plugin-vue": "^5.1.4",
28
26
  "eslint": "^9.14.0",
package/src/App.vue CHANGED
@@ -38,7 +38,7 @@ const changeLocale = () => {
38
38
  <!-- 05184 -->
39
39
  <yqg-permission
40
40
  :permissions="permissions"
41
- workNumber="05181"
41
+ workNumber="05184"
42
42
  businessCode="CRANE"
43
43
  :color="color"
44
44
  :locale="locale"
@@ -1,6 +1,6 @@
1
1
  import axios from './axios';
2
2
 
3
- const urlPrefix = '/admin/crane';
3
+ const urlPrefix = '/crane';
4
4
 
5
5
  type apiType = {
6
6
  [key in string]: (params: any) => Promise<{body: any}>
@@ -172,7 +172,7 @@
172
172
  }
173
173
 
174
174
  const onChangeHandler = throttle(async () => {
175
- if (formState.roleIds.length > 1) {
175
+ if (formState.roleIds.length > 5) {
176
176
  return;
177
177
  }
178
178
 
@@ -188,7 +188,7 @@
188
188
 
189
189
  watch(() => formState.roleIds, (val) => {
190
190
  // 写到watch里避免闪烁
191
- if (val.length > 1) {
191
+ if (val.length > 5) {
192
192
  formState.roleIds.pop();
193
193
  message.warning(t('maxCountTips', {count: 5}));
194
194
  }
@@ -17,7 +17,7 @@
17
17
  </span>
18
18
  <Popover>
19
19
  <template #content>
20
- {{ item.name }}
20
+ <div style="max-width: 400px;">{{ item.name }}</div>
21
21
  </template>
22
22
  <span class="crane-text-overflow">{{ item.name }}</span>
23
23
  </Popover>
@@ -47,16 +47,18 @@
47
47
 
48
48
  <Popover v-if="item.desc">
49
49
  <template #content>
50
- {{ item.desc }}
50
+ <div style="max-width: 400px;">{{ item.desc }}</div>
51
51
  </template>
52
52
  <QuestionCircleOutlined class=" crane-week-color"/>
53
53
  </Popover>
54
54
 
55
55
  <Popover v-if="item.relatedDepartments">
56
56
  <template #content>
57
- {{t('adaptDepartment')}}:{{ item.relatedDepartments.map((item: any) => {
57
+ <div style="max-width: 400px;">
58
+ {{t('adaptDepartment')}}:{{ item.relatedDepartments.map((item: any) => {
58
59
  return item.name;
59
60
  }).join('、') }}
61
+ </div>
60
62
  </template>
61
63
  <span class="crane-flex-center crane-margin-left-4">
62
64
  <img :src="departmentImg" height="14" width="14">
@@ -21,17 +21,17 @@
21
21
  onOk: () => {
22
22
  window.open(url);
23
23
  modal1.destroy();
24
- if (callback) {
25
- callback();
26
- } else {
24
+ callback && callback();
25
+ window.YQG_PERMISSION_CALLBACK && window.YQG_PERMISSION_CALLBACK();
26
+ if (!window.YQG_PERMISSION_CALLBACK && !callback) {
27
27
  location.reload();
28
28
  }
29
29
  },
30
30
  onCancel: () => {
31
31
  modal1.destroy();
32
- if (callback) {
33
- callback();
34
- } else {
32
+ callback && callback();
33
+ window.YQG_PERMISSION_CALLBACK && window.YQG_PERMISSION_CALLBACK();
34
+ if (!window.YQG_PERMISSION_CALLBACK && !callback) {
35
35
  location.reload();
36
36
  }
37
37
  },
@@ -217,6 +217,7 @@
217
217
  };
218
218
 
219
219
  const showModal = () => {
220
+ getPermissions();
220
221
  open.value = !open.value;
221
222
  };
222
223
 
package/src/i18n/en-US.ts CHANGED
@@ -4,7 +4,7 @@ export default {
4
4
  applyReason: '申请理由',
5
5
  approvalProcess: '审批流程',
6
6
  applyReason1: '新入职员工申请',
7
- applyReason2: '临时项目',
7
+ applyReason2: '项目需要',
8
8
  applyReason3: '数据查询与分析',
9
9
  applyReasonPlaceholder: '请尽可能详细描述申请理由',
10
10
  cancel: '取消',
@@ -20,7 +20,7 @@ export default {
20
20
  adaptDepartment: '适用部门',
21
21
  noApprovalProcess: '无审批流程',
22
22
  excessTips: '一次最多可申请{number}个权限',
23
- unavailableTips: '您暂无权限查看/操作该页面,请点击按钮进行申请',
23
+ unavailableTips: '您暂无权限查看/操作该页面,请点击下方按钮进行申请',
24
24
  appliedTips: '权限已申请,正在{status}...',
25
25
  unapplyTips: '您暂无权限查看/操作该页面,且该页面中没有您可以申请的权限,',
26
26
  callManager: '如有需要请联系系统管理员',
package/src/i18n/zh-CH.ts CHANGED
@@ -4,7 +4,7 @@ export default {
4
4
  applyReason: '申请理由',
5
5
  approvalProcess: '审批流程',
6
6
  applyReason1: '新入职员工申请',
7
- applyReason2: '临时项目',
7
+ applyReason2: '项目需要',
8
8
  applyReason3: '数据查询与分析',
9
9
  applyReasonPlaceholder: '请尽可能详细描述申请理由',
10
10
  cancel: '取消',
@@ -20,7 +20,7 @@ export default {
20
20
  adaptDepartment: '适用部门',
21
21
  noApprovalProcess: '无审批流程',
22
22
  excessTips: '一次最多可申请{number}个权限',
23
- unavailableTips: '您暂无权限查看/操作该页面,请点击按钮进行申请',
23
+ unavailableTips: '您暂无权限查看/操作该页面,请点击下方按钮进行申请',
24
24
  appliedTips: '权限已申请,正在{status}...',
25
25
  unapplyTips: '您暂无权限查看/操作该页面,且该页面中没有您可以申请的权限,',
26
26
  callManager: '如有需要请联系系统管理员',
@@ -53,3 +53,6 @@ declare type formStateType = {
53
53
  submitWorkNumber: string,
54
54
 
55
55
  };
56
+ declare interface Window {
57
+ YQG_PERMISSION_CALLBACK?: () => void;
58
+ }
package/src/vite-env.d.ts CHANGED
@@ -1 +1 @@
1
- /// <reference types="vite/client" />
1
+ /// <reference types="vite/client" />
package/vite.config.ts CHANGED
@@ -13,7 +13,7 @@ export default defineConfig({
13
13
  },
14
14
  server: {
15
15
  proxy: {
16
- '/admin': {
16
+ '/crane': {
17
17
  target: 'https://crane-test.yangqianguan.com',
18
18
  changeOrigin: true,
19
19
  },