|
|
@@ -1,1087 +0,0 @@
|
|
|
-import me from './ContentContainer-BF98H707.js';
|
|
|
-import { _ as _e, B as fe } from './Modal-5FpMAvV9.js';
|
|
|
-import { A as ve, D as he } from './Action-DFCdvvh6.js';
|
|
|
-import { _ as Z } from './_plugin-vue_export-helper-DlAUqK2U.js';
|
|
|
-import {
|
|
|
- ab as Y,
|
|
|
- c as p,
|
|
|
- o as c,
|
|
|
- g as I,
|
|
|
- w as s,
|
|
|
- f as t,
|
|
|
- j as f,
|
|
|
- h as se,
|
|
|
- e as F,
|
|
|
- i as x,
|
|
|
- t as C,
|
|
|
- d as Q,
|
|
|
- F as j,
|
|
|
- q as K,
|
|
|
- Z as ae,
|
|
|
- r as h,
|
|
|
- $ as ge,
|
|
|
- A as E,
|
|
|
- b as we,
|
|
|
- m as ke,
|
|
|
- ac as ye,
|
|
|
- B as q,
|
|
|
- a1 as be,
|
|
|
- s as H,
|
|
|
- M as Ie
|
|
|
-} from './index-Q0E3WkDV.js';
|
|
|
-import { Q as $e, a as Ne } from './common-C2h3Dl9G.js';
|
|
|
-const Ce = {
|
|
|
- __name: 'AccountForm',
|
|
|
- props: { edit_form: Object, is_edit_mode: Boolean, role_list: Array },
|
|
|
- setup(d) {
|
|
|
- const z = d,
|
|
|
- { edit_form: m, is_edit_mode: V, role_list: P } = Y(z),
|
|
|
- R = (w) => {
|
|
|
- m.role = w;
|
|
|
- };
|
|
|
- return (w, r) => {
|
|
|
- const g = p('a-input'),
|
|
|
- a = p('a-form-item'),
|
|
|
- _ = p('a-col'),
|
|
|
- D = p('a-row'),
|
|
|
- O = p('a-select'),
|
|
|
- A = p('a-form');
|
|
|
- return (
|
|
|
- c(),
|
|
|
- I(
|
|
|
- A,
|
|
|
- { model: f(m), 'auto-label-width': '' },
|
|
|
- {
|
|
|
- default: s(() => [
|
|
|
- t(
|
|
|
- D,
|
|
|
- { gutter: 24, class: 'flex-row' },
|
|
|
- {
|
|
|
- default: s(() => [
|
|
|
- f(V)
|
|
|
- ? se('', !0)
|
|
|
- : (c(),
|
|
|
- I(
|
|
|
- _,
|
|
|
- { key: 0, span: 12, class: 'flex-col' },
|
|
|
- {
|
|
|
- default: s(() => [
|
|
|
- t(
|
|
|
- a,
|
|
|
- {
|
|
|
- field: 'userName',
|
|
|
- label: w.$t('permission.account.username'),
|
|
|
- rules: [
|
|
|
- { required: !0, message: '用户名必填' },
|
|
|
- { maxLength: 50, message: '长度不超过50' }
|
|
|
- ]
|
|
|
- },
|
|
|
- {
|
|
|
- default: s(() => [
|
|
|
- t(
|
|
|
- g,
|
|
|
- {
|
|
|
- modelValue: f(m).userName,
|
|
|
- 'onUpdate:modelValue': r[0] || (r[0] = (v) => (f(m).userName = v))
|
|
|
- },
|
|
|
- null,
|
|
|
- 8,
|
|
|
- ['modelValue']
|
|
|
- )
|
|
|
- ]),
|
|
|
- _: 1
|
|
|
- },
|
|
|
- 8,
|
|
|
- ['label']
|
|
|
- )
|
|
|
- ]),
|
|
|
- _: 1
|
|
|
- }
|
|
|
- )),
|
|
|
- t(
|
|
|
- _,
|
|
|
- { span: 12, class: 'flex-col' },
|
|
|
- {
|
|
|
- default: s(() => [
|
|
|
- t(
|
|
|
- a,
|
|
|
- { field: 'loginName', label: w.$t('permission.account.name') },
|
|
|
- {
|
|
|
- default: s(() => [
|
|
|
- t(
|
|
|
- g,
|
|
|
- {
|
|
|
- modelValue: f(m).loginName,
|
|
|
- 'onUpdate:modelValue': r[1] || (r[1] = (v) => (f(m).loginName = v))
|
|
|
- },
|
|
|
- null,
|
|
|
- 8,
|
|
|
- ['modelValue']
|
|
|
- )
|
|
|
- ]),
|
|
|
- _: 1
|
|
|
- },
|
|
|
- 8,
|
|
|
- ['label']
|
|
|
- )
|
|
|
- ]),
|
|
|
- _: 1
|
|
|
- }
|
|
|
- )
|
|
|
- ]),
|
|
|
- _: 1
|
|
|
- }
|
|
|
- ),
|
|
|
- t(
|
|
|
- D,
|
|
|
- { gutter: 24, class: 'flex-row' },
|
|
|
- {
|
|
|
- default: s(() => [
|
|
|
- t(
|
|
|
- _,
|
|
|
- { span: 12, class: 'flex-col' },
|
|
|
- {
|
|
|
- default: s(() => [
|
|
|
- t(
|
|
|
- a,
|
|
|
- { field: 'phone', label: w.$t('permission.account.phone') },
|
|
|
- {
|
|
|
- default: s(() => [
|
|
|
- t(
|
|
|
- g,
|
|
|
- {
|
|
|
- modelValue: f(m).phone,
|
|
|
- 'onUpdate:modelValue': r[2] || (r[2] = (v) => (f(m).phone = v))
|
|
|
- },
|
|
|
- null,
|
|
|
- 8,
|
|
|
- ['modelValue']
|
|
|
- )
|
|
|
- ]),
|
|
|
- _: 1
|
|
|
- },
|
|
|
- 8,
|
|
|
- ['label']
|
|
|
- )
|
|
|
- ]),
|
|
|
- _: 1
|
|
|
- }
|
|
|
- ),
|
|
|
- t(
|
|
|
- _,
|
|
|
- { span: 12, class: 'flex-col' },
|
|
|
- {
|
|
|
- default: s(() => [
|
|
|
- t(
|
|
|
- a,
|
|
|
- {
|
|
|
- required: '',
|
|
|
- field: 'email',
|
|
|
- label: w.$t('permission.account.email'),
|
|
|
- rules: [
|
|
|
- { required: !0, message: '邮箱必填' },
|
|
|
- { maxLength: 50, message: '长度不超过50' }
|
|
|
- ]
|
|
|
- },
|
|
|
- {
|
|
|
- default: s(() => [
|
|
|
- t(
|
|
|
- g,
|
|
|
- {
|
|
|
- modelValue: f(m).email,
|
|
|
- 'onUpdate:modelValue': r[3] || (r[3] = (v) => (f(m).email = v))
|
|
|
- },
|
|
|
- null,
|
|
|
- 8,
|
|
|
- ['modelValue']
|
|
|
- )
|
|
|
- ]),
|
|
|
- _: 1
|
|
|
- },
|
|
|
- 8,
|
|
|
- ['label']
|
|
|
- )
|
|
|
- ]),
|
|
|
- _: 1
|
|
|
- }
|
|
|
- )
|
|
|
- ]),
|
|
|
- _: 1
|
|
|
- }
|
|
|
- ),
|
|
|
- t(
|
|
|
- D,
|
|
|
- { gutter: 24, class: 'flex-row' },
|
|
|
- {
|
|
|
- default: s(() => [
|
|
|
- f(V)
|
|
|
- ? se('', !0)
|
|
|
- : (c(),
|
|
|
- I(
|
|
|
- _,
|
|
|
- { key: 0, span: 12, class: 'flex-col' },
|
|
|
- {
|
|
|
- default: s(() => [
|
|
|
- t(
|
|
|
- a,
|
|
|
- { field: 'pwd', label: w.$t('permission.account.password') },
|
|
|
- {
|
|
|
- default: s(() => [
|
|
|
- t(
|
|
|
- g,
|
|
|
- {
|
|
|
- modelValue: f(m).pwd,
|
|
|
- 'onUpdate:modelValue': r[4] || (r[4] = (v) => (f(m).pwd = v)),
|
|
|
- type: 'password'
|
|
|
- },
|
|
|
- null,
|
|
|
- 8,
|
|
|
- ['modelValue']
|
|
|
- )
|
|
|
- ]),
|
|
|
- _: 1
|
|
|
- },
|
|
|
- 8,
|
|
|
- ['label']
|
|
|
- )
|
|
|
- ]),
|
|
|
- _: 1
|
|
|
- }
|
|
|
- )),
|
|
|
- t(
|
|
|
- _,
|
|
|
- { span: 12, class: 'flex-col' },
|
|
|
- {
|
|
|
- default: s(() => [
|
|
|
- t(
|
|
|
- a,
|
|
|
- { field: 'roles', label: w.$t('permission.account.roles') },
|
|
|
- {
|
|
|
- default: s(() => [
|
|
|
- t(
|
|
|
- O,
|
|
|
- {
|
|
|
- multiple: '',
|
|
|
- modelValue: f(m).roles,
|
|
|
- 'onUpdate:modelValue': r[5] || (r[5] = (v) => (f(m).roles = v)),
|
|
|
- options: f(P),
|
|
|
- 'field-names': { value: 'roleId', label: 'roleName' },
|
|
|
- onChange: R
|
|
|
- },
|
|
|
- null,
|
|
|
- 8,
|
|
|
- ['modelValue', 'options']
|
|
|
- )
|
|
|
- ]),
|
|
|
- _: 1
|
|
|
- },
|
|
|
- 8,
|
|
|
- ['label']
|
|
|
- )
|
|
|
- ]),
|
|
|
- _: 1
|
|
|
- }
|
|
|
- )
|
|
|
- ]),
|
|
|
- _: 1
|
|
|
- }
|
|
|
- )
|
|
|
- ]),
|
|
|
- _: 1
|
|
|
- },
|
|
|
- 8,
|
|
|
- ['model']
|
|
|
- )
|
|
|
- );
|
|
|
- };
|
|
|
- }
|
|
|
- },
|
|
|
- xe = Z(Ce, [['__scopeId', 'data-v-88d8c30f']]),
|
|
|
- Ve = { style: { display: 'flex', 'flex-direction': 'column' } },
|
|
|
- Ue = { class: 'title-box' },
|
|
|
- Se = { class: 'title-box' },
|
|
|
- De = { class: 'title-box' },
|
|
|
- Ae = {
|
|
|
- __name: 'ViewPermission',
|
|
|
- props: {
|
|
|
- visible: Boolean,
|
|
|
- menu_permissions_list: { type: Array },
|
|
|
- knowledge_permissions_list: { type: Array },
|
|
|
- dialog_permissions_list: { type: Array },
|
|
|
- agent_permissions_list: { type: Array }
|
|
|
- },
|
|
|
- emits: ['close'],
|
|
|
- setup(d, { emit: z }) {
|
|
|
- const m = d,
|
|
|
- {
|
|
|
- visible: V,
|
|
|
- menu_permissions_list: P,
|
|
|
- knowledge_permissions_list: R,
|
|
|
- dialog_permissions_list: w,
|
|
|
- agent_permissions_list: r
|
|
|
- } = Y(m),
|
|
|
- g = z,
|
|
|
- a = () => {
|
|
|
- g('close');
|
|
|
- };
|
|
|
- return (_, D) => {
|
|
|
- const O = p('icon-menu'),
|
|
|
- A = p('a-tag'),
|
|
|
- v = p('a-space'),
|
|
|
- k = p('a-divider'),
|
|
|
- l = p('icon-bookmark'),
|
|
|
- $ = p('icon-relation'),
|
|
|
- y = p('a-card'),
|
|
|
- b = p('a-modal');
|
|
|
- return (
|
|
|
- c(),
|
|
|
- I(
|
|
|
- b,
|
|
|
- {
|
|
|
- width: '50%',
|
|
|
- visible: f(V),
|
|
|
- 'onUpdate:visible': D[0] || (D[0] = (u) => (ae(V) ? (V.value = u) : null)),
|
|
|
- title: _.$t('permission.account.user_permission'),
|
|
|
- okText: '关闭',
|
|
|
- 'hide-cancel': 'true',
|
|
|
- onOk: a
|
|
|
- },
|
|
|
- {
|
|
|
- default: s(() => [
|
|
|
- F('div', Ve, [
|
|
|
- t(
|
|
|
- y,
|
|
|
- { class: 'card-body', hoverable: '' },
|
|
|
- {
|
|
|
- default: s(() => [
|
|
|
- F('div', Ue, [t(O, { size: '18' }), x(C(_.$t('permission.account.menu_function')) + ':', 1)]),
|
|
|
- t(
|
|
|
- v,
|
|
|
- { wrap: '' },
|
|
|
- {
|
|
|
- default: s(() => [
|
|
|
- (c(!0),
|
|
|
- Q(
|
|
|
- j,
|
|
|
- null,
|
|
|
- K(
|
|
|
- f(P),
|
|
|
- (u) => (c(), I(A, { key: u.id }, { default: s(() => [x(C(u.name), 1)]), _: 2 }, 1024))
|
|
|
- ),
|
|
|
- 128
|
|
|
- ))
|
|
|
- ]),
|
|
|
- _: 1
|
|
|
- }
|
|
|
- ),
|
|
|
- t(k),
|
|
|
- F('div', Se, [t(l, { size: '18' }), x(C(_.$t('permission.account.knowledge_base')) + ':', 1)]),
|
|
|
- t(
|
|
|
- v,
|
|
|
- { wrap: '' },
|
|
|
- {
|
|
|
- default: s(() => [
|
|
|
- (c(!0),
|
|
|
- Q(
|
|
|
- j,
|
|
|
- null,
|
|
|
- K(
|
|
|
- f(R),
|
|
|
- (u) => (
|
|
|
- c(),
|
|
|
- I(
|
|
|
- A,
|
|
|
- { color: 'arcoblue', key: u.id },
|
|
|
- { default: s(() => [x(C(u.name), 1)]), _: 2 },
|
|
|
- 1024
|
|
|
- )
|
|
|
- )
|
|
|
- ),
|
|
|
- 128
|
|
|
- ))
|
|
|
- ]),
|
|
|
- _: 1
|
|
|
- }
|
|
|
- ),
|
|
|
- t(k),
|
|
|
- F('div', De, [t($, { size: '18' }), x(' ' + C(_.$t('permission.account.agent')) + ':', 1)]),
|
|
|
- t(
|
|
|
- v,
|
|
|
- { wrap: '' },
|
|
|
- {
|
|
|
- default: s(() => [
|
|
|
- (c(!0),
|
|
|
- Q(
|
|
|
- j,
|
|
|
- null,
|
|
|
- K(
|
|
|
- f(w),
|
|
|
- (u) => (
|
|
|
- c(),
|
|
|
- I(
|
|
|
- A,
|
|
|
- { color: 'green', key: u.id },
|
|
|
- { default: s(() => [x(C(u.name), 1)]), _: 2 },
|
|
|
- 1024
|
|
|
- )
|
|
|
- )
|
|
|
- ),
|
|
|
- 128
|
|
|
- )),
|
|
|
- (c(!0),
|
|
|
- Q(
|
|
|
- j,
|
|
|
- null,
|
|
|
- K(
|
|
|
- f(r),
|
|
|
- (u) => (
|
|
|
- c(),
|
|
|
- I(
|
|
|
- A,
|
|
|
- { color: 'green', key: u.id },
|
|
|
- { default: s(() => [x(C(u.name), 1)]), _: 2 },
|
|
|
- 1024
|
|
|
- )
|
|
|
- )
|
|
|
- ),
|
|
|
- 128
|
|
|
- ))
|
|
|
- ]),
|
|
|
- _: 1
|
|
|
- }
|
|
|
- )
|
|
|
- ]),
|
|
|
- _: 1
|
|
|
- }
|
|
|
- )
|
|
|
- ])
|
|
|
- ]),
|
|
|
- _: 1
|
|
|
- },
|
|
|
- 8,
|
|
|
- ['visible', 'title']
|
|
|
- )
|
|
|
- );
|
|
|
- };
|
|
|
- }
|
|
|
- },
|
|
|
- Pe = Z(Ae, [['__scopeId', 'data-v-f866d898']]),
|
|
|
- ze = { style: { display: 'flex' } },
|
|
|
- Oe = { style: { 'margin-bottom': '8px' } },
|
|
|
- Be = {
|
|
|
- __name: 'DeptConfigModal',
|
|
|
- props: {
|
|
|
- visible: Boolean,
|
|
|
- dept_list: { type: Array, default: () => [] },
|
|
|
- dept_detail: { type: Object, default: () => [] }
|
|
|
- },
|
|
|
- emits: ['close', 'ok'],
|
|
|
- setup(d, { emit: z }) {
|
|
|
- const m = d,
|
|
|
- { visible: V, dept_list: P, dept_detail: R } = Y(m),
|
|
|
- w = z,
|
|
|
- r = h([]),
|
|
|
- g = h(['0']),
|
|
|
- a = h([]),
|
|
|
- _ = h([]),
|
|
|
- D = (k, l) => {
|
|
|
- k.children &&
|
|
|
- k.children.length > 0 &&
|
|
|
- k.children.forEach(($) => {
|
|
|
- const y = l.findIndex((b) => b.deptId === $.deptId);
|
|
|
- y !== -1 && (l.splice(y, 1), D($, l));
|
|
|
- });
|
|
|
- },
|
|
|
- O = (k, l) => {
|
|
|
- const $ = { deptId: l.node.deptId, deptName: l.node.deptName };
|
|
|
- if (l.checked)
|
|
|
- l.node.roles.forEach((y) => {
|
|
|
- _.value.some((u) => u.roleId === y.roleId) || _.value.push(y);
|
|
|
- }),
|
|
|
- a.value.push($);
|
|
|
- else {
|
|
|
- const y = a.value.findIndex((u) => u.deptId === l.node.deptId);
|
|
|
- a.value.splice(y, 1);
|
|
|
- const b = _.value.findIndex((u) => u.deptId === l.node.deptId);
|
|
|
- _.value.splice(b, 1), D(l.node, a.value);
|
|
|
- }
|
|
|
- },
|
|
|
- A = () => {
|
|
|
- (V.value = !1), w('close');
|
|
|
- },
|
|
|
- v = () => {
|
|
|
- w('ok', r.value);
|
|
|
- };
|
|
|
- return (
|
|
|
- ge(
|
|
|
- () => m.dept_detail,
|
|
|
- (k) => {
|
|
|
- k.length > 0
|
|
|
- ? k.forEach((l) => {
|
|
|
- r.value.includes(l.deptId) ||
|
|
|
- (a.value.push({ deptId: l.deptId, deptName: l.deptName }),
|
|
|
- r.value.push(l.deptId),
|
|
|
- g.value.push(l.deptId)),
|
|
|
- l.roles.forEach(($) => {
|
|
|
- _.value.some((y) => y.roleId === $.roleId) ||
|
|
|
- _.value.push({ roleId: $.roleId, roleName: $.roleName, deptId: l.deptId });
|
|
|
- });
|
|
|
- })
|
|
|
- : ((r.value = []), (g.value = []), (a.value = []), (_.value = []));
|
|
|
- }
|
|
|
- ),
|
|
|
- (k, l) => {
|
|
|
- const $ = p('a-tree'),
|
|
|
- y = p('a-card'),
|
|
|
- b = p('a-tag'),
|
|
|
- u = p('a-space'),
|
|
|
- G = p('a-divider'),
|
|
|
- J = p('a-modal');
|
|
|
- return (
|
|
|
- c(),
|
|
|
- I(
|
|
|
- J,
|
|
|
- {
|
|
|
- width: '50%',
|
|
|
- visible: f(V),
|
|
|
- 'onUpdate:visible': l[2] || (l[2] = (U) => (ae(V) ? (V.value = U) : null)),
|
|
|
- title: k.$t('permission.account.dept_config'),
|
|
|
- onCancel: A,
|
|
|
- onOk: v
|
|
|
- },
|
|
|
- {
|
|
|
- default: s(() => [
|
|
|
- F('div', ze, [
|
|
|
- t(
|
|
|
- y,
|
|
|
- { class: 'card-body', title: k.$t('permission.account.organization'), hoverable: '' },
|
|
|
- {
|
|
|
- default: s(() => [
|
|
|
- t(
|
|
|
- $,
|
|
|
- {
|
|
|
- data: f(P),
|
|
|
- 'checked-keys': r.value,
|
|
|
- 'onUpdate:checkedKeys': l[0] || (l[0] = (U) => (r.value = U)),
|
|
|
- 'expanded-keys': g.value,
|
|
|
- 'onUpdate:expandedKeys': l[1] || (l[1] = (U) => (g.value = U)),
|
|
|
- checkable: !0,
|
|
|
- 'check-strictly': !0,
|
|
|
- 'show-line': !0,
|
|
|
- onCheck: O,
|
|
|
- fieldNames: { key: 'deptId', title: 'deptName', children: 'children' }
|
|
|
- },
|
|
|
- null,
|
|
|
- 8,
|
|
|
- ['data', 'checked-keys', 'expanded-keys']
|
|
|
- )
|
|
|
- ]),
|
|
|
- _: 1
|
|
|
- },
|
|
|
- 8,
|
|
|
- ['title']
|
|
|
- ),
|
|
|
- t(
|
|
|
- y,
|
|
|
- { class: 'card-body', title: k.$t('permission.account.user_department') },
|
|
|
- {
|
|
|
- default: s(() => [
|
|
|
- t(
|
|
|
- u,
|
|
|
- { wrap: '' },
|
|
|
- {
|
|
|
- default: s(() => [
|
|
|
- (c(!0),
|
|
|
- Q(
|
|
|
- j,
|
|
|
- null,
|
|
|
- K(
|
|
|
- a.value,
|
|
|
- (U) => (
|
|
|
- c(),
|
|
|
- I(b, { key: U.deptId }, { default: s(() => [x(C(U.deptName), 1)]), _: 2 }, 1024)
|
|
|
- )
|
|
|
- ),
|
|
|
- 128
|
|
|
- ))
|
|
|
- ]),
|
|
|
- _: 1
|
|
|
- }
|
|
|
- ),
|
|
|
- t(G),
|
|
|
- F('div', Oe, C(k.$t('permission.account.department_roles')) + ':', 1),
|
|
|
- t(
|
|
|
- u,
|
|
|
- { wrap: '' },
|
|
|
- {
|
|
|
- default: s(() => [
|
|
|
- (c(!0),
|
|
|
- Q(
|
|
|
- j,
|
|
|
- null,
|
|
|
- K(
|
|
|
- _.value,
|
|
|
- (U) => (
|
|
|
- c(),
|
|
|
- I(
|
|
|
- b,
|
|
|
- { key: U.roleId, color: 'arcoblue' },
|
|
|
- { default: s(() => [x(C(U.roleName), 1)]), _: 2 },
|
|
|
- 1024
|
|
|
- )
|
|
|
- )
|
|
|
- ),
|
|
|
- 128
|
|
|
- ))
|
|
|
- ]),
|
|
|
- _: 1
|
|
|
- }
|
|
|
- )
|
|
|
- ]),
|
|
|
- _: 1
|
|
|
- },
|
|
|
- 8,
|
|
|
- ['title']
|
|
|
- )
|
|
|
- ])
|
|
|
- ]),
|
|
|
- _: 1
|
|
|
- },
|
|
|
- 8,
|
|
|
- ['visible', 'title']
|
|
|
- )
|
|
|
- );
|
|
|
- }
|
|
|
- );
|
|
|
- }
|
|
|
- },
|
|
|
- Me = Z(Be, [['__scopeId', 'data-v-c1954a73']]),
|
|
|
- T = '/api/user';
|
|
|
-function Ee(d) {
|
|
|
- return E({ url: `${T}/list`, method: 'get', params: d });
|
|
|
-}
|
|
|
-function Te(d) {
|
|
|
- return E({ url: `${T}/dept`, method: 'get', params: { userId: d } });
|
|
|
-}
|
|
|
-function Re(d) {
|
|
|
- return E({ url: `${T}/dept`, method: 'put', data: d });
|
|
|
-}
|
|
|
-function Le(d) {
|
|
|
- return E({ url: `${T}/add_user`, method: 'post', data: d });
|
|
|
-}
|
|
|
-function Qe(d) {
|
|
|
- return E({ url: `${T}/edit_user`, method: 'put', data: d });
|
|
|
-}
|
|
|
-function je(d) {
|
|
|
- return E({ url: `${T}/change_status`, method: 'put', data: d });
|
|
|
-}
|
|
|
-function qe(d) {
|
|
|
- return E({ url: `${T}/reset_pwd`, method: 'put', data: { userId: d } });
|
|
|
-}
|
|
|
-function Fe(d) {
|
|
|
- return E({ url: `${T}/permission`, method: 'get', params: { userId: d } });
|
|
|
-}
|
|
|
-function Ke(d) {
|
|
|
- return E({ url: `${T}/delete_user/${d}`, method: 'delete' });
|
|
|
-}
|
|
|
-const He = {
|
|
|
- __name: 'index',
|
|
|
- setup(d) {
|
|
|
- const z = h(''),
|
|
|
- m = h([]),
|
|
|
- V = h([
|
|
|
- { title: '序号', width: 80, fixed: 'left', slotName: 'index' },
|
|
|
- { title: '用户名', dataIndex: 'userName', width: 150, titleSlotName: 'userName' },
|
|
|
- { title: '姓名', dataIndex: 'loginName', titleSlotName: 'loginName' },
|
|
|
- {
|
|
|
- title: '角色',
|
|
|
- dataIndex: 'roleName',
|
|
|
- width: 300,
|
|
|
- ellipsis: !0,
|
|
|
- tooltip: { position: 'top' },
|
|
|
- titleSlotName: 'roleName'
|
|
|
- },
|
|
|
- {
|
|
|
- title: '所属部门',
|
|
|
- dataIndex: 'deptName',
|
|
|
- width: 400,
|
|
|
- ellipsis: !0,
|
|
|
- tooltip: { position: 'top' },
|
|
|
- titleSlotName: 'deptName'
|
|
|
- },
|
|
|
- { title: '手机号', dataIndex: 'phone', width: 150, titleSlotName: 'phone' },
|
|
|
- { title: '邮箱', dataIndex: 'email', width: 150, titleSlotName: 'email' },
|
|
|
- { title: '状态', dataIndex: 'status', width: 100, slotName: 'status' },
|
|
|
- { title: '操作', dataIndex: 'operation', width: 500, fixed: 'right', slotName: 'operationSlot' }
|
|
|
- ]),
|
|
|
- P = h({ total: 10, current: 1, pageSize: 12 }),
|
|
|
- R = h('medium'),
|
|
|
- w = h(!1),
|
|
|
- r = h(!1),
|
|
|
- g = h(!1),
|
|
|
- a = we({ userName: '', userName: '', phone: '', email: '', pwd: '', roles: [] }),
|
|
|
- _ = h([]),
|
|
|
- D = h(!1),
|
|
|
- O = h([]),
|
|
|
- A = h([]),
|
|
|
- v = h([]),
|
|
|
- k = h([]),
|
|
|
- l = h(!1),
|
|
|
- $ = h([]),
|
|
|
- y = h([]),
|
|
|
- b = async () => {
|
|
|
- const e = { keyword: z.value, current: P.value.current, pageSize: P.value.pageSize };
|
|
|
- w.value = !0;
|
|
|
- const { code: o, data: n } = await Ee(e);
|
|
|
- if (o === 200) {
|
|
|
- for (const i of n.rows) {
|
|
|
- if (((i.deptName = ''), (i.roleName = ''), i.depts))
|
|
|
- for (let N = 0; N < i.depts.length; N++) {
|
|
|
- const B = i.depts[N];
|
|
|
- i.deptName += B.deptName + (N < i.depts.length - 1 ? ', ' : '');
|
|
|
- }
|
|
|
- if (i.roles)
|
|
|
- for (let N = 0; N < i.roles.length; N++) {
|
|
|
- const B = i.roles[N];
|
|
|
- i.roleName += B.roleName + (N < i.roles.length - 1 ? ', ' : '');
|
|
|
- }
|
|
|
- }
|
|
|
- (P.value.total = n.total), (m.value = n.rows), (w.value = !1);
|
|
|
- } else w.value = !1;
|
|
|
- },
|
|
|
- u = (e) => {
|
|
|
- (z.value = e), b();
|
|
|
- },
|
|
|
- G = () => {
|
|
|
- (z.value = ''), b();
|
|
|
- },
|
|
|
- J = () => {
|
|
|
- (a.userId = ''),
|
|
|
- (a.userName = ''),
|
|
|
- (a.loginName = ''),
|
|
|
- (a.phone = ''),
|
|
|
- (a.email = ''),
|
|
|
- (a.pwd = ''),
|
|
|
- (a.roles = []),
|
|
|
- (g.value = !1),
|
|
|
- W(null, !0);
|
|
|
- },
|
|
|
- U = () => {
|
|
|
- console.log('刷新');
|
|
|
- },
|
|
|
- oe = (e) => {
|
|
|
- (P.value.current = e), b();
|
|
|
- },
|
|
|
- le = async (e) => {
|
|
|
- const o = { userId: e.userId, status: e.status },
|
|
|
- { code: n } = await je(o);
|
|
|
- n === 200 && q.success({ title: '成功', content: '状态切换成功' });
|
|
|
- },
|
|
|
- ne = async (e) => {
|
|
|
- const { code: o } = await qe(e.userId);
|
|
|
- o === 200 && q.success({ title: '重置密码', content: '该用户密码重置为000000' });
|
|
|
- },
|
|
|
- W = async (e, o) => {
|
|
|
- if (o) {
|
|
|
- const { code: n, data: i } = await $e();
|
|
|
- n === 200 && (_.value = i.rows);
|
|
|
- }
|
|
|
- e &&
|
|
|
- ((a.userId = e.userId),
|
|
|
- (a.userName = e.userName),
|
|
|
- (a.loginName = e.loginName),
|
|
|
- (a.phone = e.phone),
|
|
|
- (a.email = e.email),
|
|
|
- (a.pwd = e.pwd),
|
|
|
- (a.roles = e.roles.map((n) => n.roleId)),
|
|
|
- (g.value = !0)),
|
|
|
- (r.value = o);
|
|
|
- },
|
|
|
- X = async (e, o) => {
|
|
|
- if (e) {
|
|
|
- (v.value = []), (A.value = []), (O.value = []);
|
|
|
- const { code: n, data: i } = await Fe(e.userId);
|
|
|
- if (n === 200) {
|
|
|
- const { knowledge: N, menus: B, dialog: M } = i;
|
|
|
- M && M.length > 0 && (v.value = M),
|
|
|
- N && N.length > 0 && (A.value = N),
|
|
|
- B && B.length > 0 && (O.value = te(B));
|
|
|
- }
|
|
|
- }
|
|
|
- D.value = o;
|
|
|
- },
|
|
|
- ee = async (e, o) => {
|
|
|
- if (e) {
|
|
|
- a.userId = e.userId;
|
|
|
- const {
|
|
|
- code: n,
|
|
|
- data: { rows: i }
|
|
|
- } = await Te(e.userId);
|
|
|
- n === 200 && ($.value = i);
|
|
|
- }
|
|
|
- l.value = o;
|
|
|
- },
|
|
|
- ie = async (e) => {
|
|
|
- l.value = !1;
|
|
|
- const o = { userId: a.userId, depts: e },
|
|
|
- { code: n } = await Re(o);
|
|
|
- n === 200 && (q.success({ title: '部门配置', content: '部门配置成功' }), b());
|
|
|
- },
|
|
|
- de = async (e) => {
|
|
|
- const { code: o } = await Ke(e);
|
|
|
- o === 200 && (q.success({ title: '删除用户', content: '删除成功' }), b());
|
|
|
- },
|
|
|
- re = async () => {
|
|
|
- r.value = !1;
|
|
|
- const e = { userId: g.value ? a.userId : void 0, ...a },
|
|
|
- o = g.value ? Qe : Le,
|
|
|
- { code: n } = await o(e);
|
|
|
- if (n === 200) {
|
|
|
- const i = g.value ? '编辑' : '新增';
|
|
|
- q.success({ title: `${i}用户`, content: `${i}成功` }), b();
|
|
|
- }
|
|
|
- },
|
|
|
- ue = (e) => {
|
|
|
- R.value = e;
|
|
|
- },
|
|
|
- te = (e, o = []) => (
|
|
|
- e.forEach((n) => {
|
|
|
- n.id && n.meta.title && o.push({ id: n.id, name: n.meta.title }),
|
|
|
- n.children && n.children.length > 0 && te(n.children, o);
|
|
|
- }),
|
|
|
- o
|
|
|
- ),
|
|
|
- ce = async () => {
|
|
|
- const {
|
|
|
- code: e,
|
|
|
- data: { rows: o }
|
|
|
- } = await Ne();
|
|
|
- e == 200 && (y.value = o);
|
|
|
- },
|
|
|
- pe = (e, o) => {
|
|
|
- Ie.warning({
|
|
|
- title: o,
|
|
|
- okText: '确定',
|
|
|
- cancelText: '取消',
|
|
|
- hideCancel: !1,
|
|
|
- onOk() {
|
|
|
- de(e);
|
|
|
- }
|
|
|
- });
|
|
|
- };
|
|
|
- return (
|
|
|
- ke(() => {
|
|
|
- ye('system:user:list')
|
|
|
- ? (b(), ce())
|
|
|
- : q.error({ title: '权限不足', content: '抱歉,您没有权限查看用户列表' });
|
|
|
- }),
|
|
|
- (e, o) => {
|
|
|
- const n = p('a-switch'),
|
|
|
- i = p('a-button'),
|
|
|
- N = p('a-popconfirm'),
|
|
|
- B = p('a-card'),
|
|
|
- M = be('hasPermi');
|
|
|
- return (
|
|
|
- c(),
|
|
|
- Q(
|
|
|
- j,
|
|
|
- null,
|
|
|
- [
|
|
|
- t(
|
|
|
- B,
|
|
|
- { class: 'account-page-card' },
|
|
|
- {
|
|
|
- default: s(() => [
|
|
|
- t(
|
|
|
- ve,
|
|
|
- {
|
|
|
- btn_text: e.$t('permission.account.new_user'),
|
|
|
- btn_permission: 'system:user:add',
|
|
|
- onSearchClick: u,
|
|
|
- onResetClick: G,
|
|
|
- onCreateClick: J,
|
|
|
- onSizeChange: ue,
|
|
|
- onRefreshClick: U
|
|
|
- },
|
|
|
- null,
|
|
|
- 8,
|
|
|
- ['btn_text']
|
|
|
- ),
|
|
|
- t(
|
|
|
- he,
|
|
|
- {
|
|
|
- data: m.value,
|
|
|
- columns: V.value,
|
|
|
- 'row-key': 'userId',
|
|
|
- scroll: { x: 2e3 },
|
|
|
- size: R.value,
|
|
|
- loading: w.value,
|
|
|
- pagination: P.value,
|
|
|
- onPageChange: oe
|
|
|
- },
|
|
|
- {
|
|
|
- status: s(({ record: S }) => [
|
|
|
- t(
|
|
|
- n,
|
|
|
- {
|
|
|
- modelValue: S.status,
|
|
|
- 'onUpdate:modelValue': (L) => (S.status = L),
|
|
|
- onChange: (L) => le(S),
|
|
|
- 'checked-value': '1',
|
|
|
- 'unchecked-value': '0'
|
|
|
- },
|
|
|
- null,
|
|
|
- 8,
|
|
|
- ['modelValue', 'onUpdate:modelValue', 'onChange']
|
|
|
- )
|
|
|
- ]),
|
|
|
- operationSlot: s(({ record: S }) => [
|
|
|
- t(
|
|
|
- N,
|
|
|
- { content: e.$t('permission.account.reset_password'), onOk: (L) => ne(S) },
|
|
|
- {
|
|
|
- default: s(() => [
|
|
|
- H(
|
|
|
- (c(),
|
|
|
- I(
|
|
|
- i,
|
|
|
- { type: 'text' },
|
|
|
- { default: s(() => [x(C(e.$t('permission.account.reset_password')), 1)]), _: 1 }
|
|
|
- )),
|
|
|
- [[M, 'system:role:resetPassword']]
|
|
|
- )
|
|
|
- ]),
|
|
|
- _: 2
|
|
|
- },
|
|
|
- 1032,
|
|
|
- ['content', 'onOk']
|
|
|
- ),
|
|
|
- H(
|
|
|
- (c(),
|
|
|
- I(
|
|
|
- i,
|
|
|
- { type: 'text', onClick: (L) => W(S, !0) },
|
|
|
- { default: s(() => [x(C(e.$t('permission.account.edit')), 1)]), _: 2 },
|
|
|
- 1032,
|
|
|
- ['onClick']
|
|
|
- )),
|
|
|
- [[M, 'system:user:edit']]
|
|
|
- ),
|
|
|
- H(
|
|
|
- (c(),
|
|
|
- I(
|
|
|
- i,
|
|
|
- { type: 'text', onClick: (L) => X(S, !0) },
|
|
|
- { default: s(() => [x(C(e.$t('permission.account.view_permission')), 1)]), _: 2 },
|
|
|
- 1032,
|
|
|
- ['onClick']
|
|
|
- )),
|
|
|
- [[M, 'system:user:viewPermission']]
|
|
|
- ),
|
|
|
- H(
|
|
|
- (c(),
|
|
|
- I(
|
|
|
- i,
|
|
|
- { type: 'text', onClick: (L) => ee(S, !0) },
|
|
|
- { default: s(() => [x(C(e.$t('permission.account.dept_config')), 1)]), _: 2 },
|
|
|
- 1032,
|
|
|
- ['onClick']
|
|
|
- )),
|
|
|
- [[M, 'system:user:deptEdit']]
|
|
|
- ),
|
|
|
- H(
|
|
|
- (c(),
|
|
|
- I(
|
|
|
- i,
|
|
|
- {
|
|
|
- onClick: (L) => pe(S.userId, e.$t('permission.delete_confirm')),
|
|
|
- type: 'text',
|
|
|
- status: 'warning'
|
|
|
- },
|
|
|
- { default: s(() => [x(C(e.$t('permission.account.delete')), 1)]), _: 2 },
|
|
|
- 1032,
|
|
|
- ['onClick']
|
|
|
- )),
|
|
|
- [[M, 'system:user:delete']]
|
|
|
- )
|
|
|
- ]),
|
|
|
- _: 1
|
|
|
- },
|
|
|
- 8,
|
|
|
- ['data', 'columns', 'size', 'loading', 'pagination']
|
|
|
- )
|
|
|
- ]),
|
|
|
- _: 1
|
|
|
- }
|
|
|
- ),
|
|
|
- t(
|
|
|
- _e,
|
|
|
- {
|
|
|
- visible: r.value,
|
|
|
- onOk: re,
|
|
|
- onCancel: o[0] || (o[0] = (S) => W(null, !1)),
|
|
|
- title: g.value ? e.$t('permission.account.edit') : e.$t('permission.account.new_user')
|
|
|
- },
|
|
|
- {
|
|
|
- default: s(() => [
|
|
|
- t(xe, { edit_form: a, is_edit_mode: g.value, role_list: _.value }, null, 8, [
|
|
|
- 'edit_form',
|
|
|
- 'is_edit_mode',
|
|
|
- 'role_list'
|
|
|
- ])
|
|
|
- ]),
|
|
|
- _: 1
|
|
|
- },
|
|
|
- 8,
|
|
|
- ['visible', 'title']
|
|
|
- ),
|
|
|
- t(
|
|
|
- Pe,
|
|
|
- {
|
|
|
- visible: D.value,
|
|
|
- onCancel: o[1] || (o[1] = (S) => X(null, !1)),
|
|
|
- onClose: o[2] || (o[2] = (S) => X(null, !1)),
|
|
|
- menu_permissions_list: O.value,
|
|
|
- knowledge_permissions_list: A.value,
|
|
|
- dialog_permissions_list: v.value,
|
|
|
- agent_permissions_list: k.value
|
|
|
- },
|
|
|
- null,
|
|
|
- 8,
|
|
|
- [
|
|
|
- 'visible',
|
|
|
- 'menu_permissions_list',
|
|
|
- 'knowledge_permissions_list',
|
|
|
- 'dialog_permissions_list',
|
|
|
- 'agent_permissions_list'
|
|
|
- ]
|
|
|
- ),
|
|
|
- t(
|
|
|
- Me,
|
|
|
- {
|
|
|
- visible: l.value,
|
|
|
- dept_list: y.value,
|
|
|
- dept_detail: $.value,
|
|
|
- onOk: ie,
|
|
|
- onCancel: o[3] || (o[3] = (S) => ee(null, !1))
|
|
|
- },
|
|
|
- null,
|
|
|
- 8,
|
|
|
- ['visible', 'dept_list', 'dept_detail']
|
|
|
- )
|
|
|
- ],
|
|
|
- 64
|
|
|
- )
|
|
|
- );
|
|
|
- }
|
|
|
- );
|
|
|
- }
|
|
|
- },
|
|
|
- Ze = Z(He, [['__scopeId', 'data-v-a0e43208']]),
|
|
|
- tt = {
|
|
|
- __name: 'PermissionAccount',
|
|
|
- setup(d) {
|
|
|
- return (z, m) => (c(), I(me, null, { default: s(() => [t(fe, { current_label: '用户' }), t(Ze)]), _: 1 }));
|
|
|
- }
|
|
|
- };
|
|
|
-export { tt as default };
|