diff --git a/.gitignore b/.gitignore index 95d65ce2b9a71f4bb29af2f1f9c13231bc69e3b2..12bc2b3ee3e90884a6db97506c55488fbcb98dc4 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,6 @@ .history/ .vscode/ -web/package-lock.json \ No newline at end of file +web/package-lock.json + +*.bat \ No newline at end of file diff --git a/backend/dvadmin/system/fixtures/init_menu.json b/backend/dvadmin/system/fixtures/init_menu.json index 835a41e2bb214bea6bce6d2097b20e538fe43195..ec9742aa7ee793dfef84736611f102781cba0610 100644 --- a/backend/dvadmin/system/fixtures/init_menu.json +++ b/backend/dvadmin/system/fixtures/init_menu.json @@ -11,12 +11,164 @@ "status": true, "cache": false, "visible": true, - "parent": null, "children": [ + { + "name": "用户管理", + "icon": "iconfont icon-icon-", + "sort": 1, + "is_link": false, + "is_catalog": false, + "web_path": "/user", + "component": "system/user/index", + "component_name": "user", + "status": true, + "cache": false, + "visible": true, + "children": [], + "menu_button": [ + { + "name": "查询", + "value": "user:Search", + "api": "/api/system/user/", + "method": 0 + }, + { + "name": "新增", + "value": "user:Create", + "api": "/api/system/user/", + "method": 1 + }, + { + "name": "编辑", + "value": "user:Update", + "api": "/api/system/user/{id}/", + "method": 2 + }, + { + "name": "删除", + "value": "user:Delete", + "api": "/api/system/user/{id}/", + "method": 3 + }, + { + "name": "导出", + "value": "user:Export", + "api": "/api/system/user/export/", + "method": 1 + }, + { + "name": "导入", + "value": "user:Import", + "api": "/api/system/user/import/", + "method": 1 + }, + { + "name": "获取导入模板", + "value": "user:ImportTemplate", + "api": "/api/system/user/import/", + "method": 0 + }, + { + "name": "批量更新模板", + "value": "user:BatchUpdateTemplate", + "api": "/api/system/user/update_template/", + "method": 0 + }, + { + "name": "重设密码", + "value": "user:ResetPassword", + "api": "/api/system/user/{id}/reset_password/", + "method": 2 + }, + { + "name": "重置密码", + "value": "user:ResetDefaultPassword", + "api": "/api/system/user/{id}/reset_to_default_password/", + "method": 2 + } + ], + "menu_field": [ + { + "field_name": "avatar", + "title": "头像", + "model": "Users" + }, + { + "field_name": "create_datetime", + "title": "创建时间", + "model": "Users" + }, + { + "field_name": "creator", + "title": "创建人", + "model": "Users" + }, + { + "field_name": "dept", + "title": "所属部门", + "model": "Users" + }, + { + "field_name": "dept_belong_id", + "title": "数据归属部门", + "model": "Users" + }, + { + "field_name": "description", + "title": "描述", + "model": "Users" + }, + { + "field_name": "email", + "title": "邮箱", + "model": "Users" + }, + { + "field_name": "gender", + "title": "性别", + "model": "Users" + }, + { + "field_name": "id", + "title": "Id", + "model": "Users" + }, + { + "field_name": "mobile", + "title": "电话", + "model": "Users" + }, + { + "field_name": "modifier", + "title": "修改人", + "model": "Users" + }, + { + "field_name": "name", + "title": "姓名", + "model": "Users" + }, + { + "field_name": "update_datetime", + "title": "修改时间", + "model": "Users" + }, + { + "field_name": "username", + "title": "用户账号", + "model": "Users" + }, + { + "field_name": "user_type", + "title": "用户类型", + "model": "Users" + } + ] + }, { "name": "菜单管理", "icon": "iconfont icon-caidan", - "sort": 1, + "sort": 2, "is_link": false, "is_catalog": false, "web_path": "/menu", @@ -25,7 +177,6 @@ "status": true, "cache": false, "visible": true, - "parent": 1, "children": [], "menu_button": [ { @@ -35,11 +186,29 @@ "method": 0 }, { - "name": "详情", + "name": "单例", "value": "menu:Retrieve", "api": "/api/system/menu/{id}/", "method": 0 }, + { + "name": "新增", + "value": "menu:Create", + "api": "/api/system/menu/", + "method": 1 + }, + { + "name": "编辑", + "value": "menu:Update", + "api": "/api/system/menu/{id}/", + "method": 2 + }, + { + "name": "删除", + "value": "menu:Delete", + "api": "/api/system/menu/{id}/", + "method": 3 + }, { "name": "查询所有", "value": "menu:SearchAll", @@ -53,22 +222,28 @@ "method": 0 }, { - "name": "查询按钮权限", - "value": "btn:Search", + "name": "查询按钮", + "value": "menu:SearchButton", "api": "/api/system/menu_button/", "method": 0 }, { - "name": "查询列权限", - "value": "column:Search", - "api": "/api/system/column/", - "method": 0 + "name": "新增按钮", + "value": "menu:CreateButton", + "api": "/api/system/menu_button/", + "method": 1 }, { - "name": "新增", - "value": "menu:Create", - "api": "/api/system/menu/", - "method": 1 + "name": "编辑按钮", + "value": "menu:UpdateButton", + "api": "/api/system/menu_button/{id}/", + "method": 2 + }, + { + "name": "删除按钮", + "value": "menu:DeleteButton", + "api": "/api/system/menu_button/{id}/", + "method": 3 }, { "name": "上移", @@ -83,10 +258,10 @@ "method": 1 }, { - "name": "新增按钮权限", - "value": "btn:Create", - "api": "/api/system/menu_button/", - "method": 1 + "name": "查询列权限", + "value": "column:Search", + "api": "/api/system/column/", + "method": 0 }, { "name": "新增列权限", @@ -94,47 +269,23 @@ "api": "/api/system/column/", "method": 1 }, - { - "name": "自动匹配列权限", - "value": "column:Match", - "api": "/api/system/column/auto_match_fields/", - "method": 1 - }, - { - "name": "编辑", - "value": "menu:Update", - "api": "/api/system/menu/{id}/", - "method": 2 - }, - { - "name": "修改按钮权限", - "value": "btn:Update", - "api": "/api/system/menu_button/{id}/", - "method": 2 - }, { "name": "编辑列权限", "value": "column:Update", "api": "/api/system/column/{id}/", "method": 2 }, - { - "name": "删除", - "value": "menu:Delete", - "api": "/api/system/menu/{id}/", - "method": 3 - }, - { - "name": "删除按钮权限", - "value": "btn:Delete", - "api": "/api/system/menu_button/{id}/", - "method": 3 - }, { "name": "删除列权限", "value": "column:Delete", "api": "/api/system/column/{id}/", "method": 3 + }, + { + "name": "自动匹配列权限", + "value": "column:Match", + "api": "/api/system/column/auto_match_fields/", + "method": 1 } ], "menu_field": [] @@ -151,7 +302,6 @@ "status": true, "cache": false, "visible": true, - "parent": 1, "children": [], "menu_button": [ { @@ -223,7 +373,6 @@ "status": true, "cache": false, "visible": true, - "parent": 1, "children": [], "menu_button": [ { @@ -233,17 +382,11 @@ "method": 0 }, { - "name": "详情", + "name": "单例", "value": "role:Retrieve", "api": "/api/system/role/{id}/", "method": 0 }, - { - "name": "权限配置", - "value": "role:Permission", - "api": "/api/system/role/{id}/", - "method": 0 - }, { "name": "新增", "value": "role:Create", @@ -256,222 +399,122 @@ "api": "/api/system/role/{id}/", "method": 2 }, - { - "name": "保存", - "value": "role:Save", - "api": "/api/system/role/{id}/", - "method": 2 - }, { "name": "删除", "value": "role:Delete", "api": "/api/system/role/{id}/", "method": 3 - } - ], - "menu_field": [ - { - "field_name": "create_datetime", - "title": "创建时间", - "model": "Role" - }, - { - "field_name": "creator", - "title": "创建人", - "model": "Role" - }, - { - "field_name": "dept_belong_id", - "title": "数据归属部门", - "model": "Role" - }, - { - "field_name": "description", - "title": "描述", - "model": "Role" - }, - { - "field_name": "id", - "title": "Id", - "model": "Role" - }, - { - "field_name": "key", - "title": "权限字符", - "model": "Role" - }, - { - "field_name": "modifier", - "title": "修改人", - "model": "Role" }, { - "field_name": "name", - "title": "角色名称", - "model": "Role" - }, - { - "field_name": "sort", - "title": "角色顺序", - "model": "Role" - }, - { - "field_name": "status", - "title": "角色状态", - "model": "Role" - }, - { - "field_name": "update_datetime", - "title": "修改时间", - "model": "Role" - } - ] - }, - { - "name": "用户管理", - "icon": "iconfont icon-icon-", - "sort": 6, - "is_link": false, - "is_catalog": false, - "web_path": "/user", - "component": "system/user/index", - "component_name": "user", - "status": true, - "cache": false, - "visible": true, - "parent": 1, - "children": [], - "menu_button": [ - { - "name": "查询", - "value": "user:Search", - "api": "/api/system/user/", + "name": "获取所有可授权数据范围的部门", + "value": "role:AllDataRangeDept", + "api": "/api/system/role_menu_button_permision/role_to_dept_all/", "method": 0 }, { - "name": "详情", - "value": "user:Retrieve", - "api": "/api/system/user/{id}/", + "name": "获取所有可授权菜单", + "value": "role:AllCanMenu", + "api": "/api/system/role_menu_button_permision/get_role_menu/", "method": 0 }, { - "name": "新增", - "value": "user:Create", - "api": "/api/system/user/", - "method": 1 + "name": "获取所有已授权用户", + "value": "role:AllAuthorizedUser", + "api": "/api/system/role/get_role_users/", + "method": 0 }, { - "name": "导出", - "value": "user:Export", - "api": "/api/system/user/export/", - "method": 1 + "name": "获取菜单所有可授权按钮", + "value": "role:AllMenuButton", + "api": "/api/system/role_menu_button_permision/get_role_menu_btn_field/", + "method": 0 }, { - "name": "导入", - "value": "user:Import", - "api": "/api/system/user/import/", - "method": 1 + "name": "授权菜单", + "value": "role:SetMenu", + "api": "/api/system/role_menu_button_permision/set_role_menu/", + "method": 2 }, { - "name": "编辑", - "value": "user:Update", - "api": "/api/system/user/{id}/", + "name": "授权菜单按钮", + "value": "role:SetMenuButton", + "api": "/api/system/role_menu_button_permision/set_role_menu_btn/", "method": 2 }, { - "name": "重设密码", - "value": "user:ResetPassword", - "api": "/api/system/user/{id}/reset_password/", + "name": "授权数据范围", + "value": "role:SetDataRange", + "api": "/api/system/role_menu_button_permision/set_role_menu_btn_data_range/", "method": 2 }, { - "name": "重置密码", - "value": "user:DefaultPassword", - "api": "/api/system/user/{id}/reset_to_default_password/", - "method": 2 + "name": "获取所有用户", + "value": "role:AllUser", + "api": "/api/system/user/", + "method": 0 }, { - "name": "删除", - "value": "user:Delete", - "api": "/api/system/user/{id}/", - "method": 3 + "name": "授权用户予角色", + "value": "role:SetUserRole", + "api": "/api/system/role/{id}/set_role_users/", + "method": 2 } ], "menu_field": [ - { - "field_name": "avatar", - "title": "头像", - "model": "Users" - }, { "field_name": "create_datetime", "title": "创建时间", - "model": "Users" + "model": "Role" }, { "field_name": "creator", "title": "创建人", - "model": "Users" - }, - { - "field_name": "dept", - "title": "所属部门", - "model": "Users" + "model": "Role" }, { "field_name": "dept_belong_id", "title": "数据归属部门", - "model": "Users" + "model": "Role" }, { "field_name": "description", "title": "描述", - "model": "Users" - }, - { - "field_name": "email", - "title": "邮箱", - "model": "Users" - }, - { - "field_name": "gender", - "title": "性别", - "model": "Users" + "model": "Role" }, { "field_name": "id", "title": "Id", - "model": "Users" + "model": "Role" }, { - "field_name": "mobile", - "title": "电话", - "model": "Users" + "field_name": "key", + "title": "权限字符", + "model": "Role" }, { "field_name": "modifier", "title": "修改人", - "model": "Users" + "model": "Role" }, { "field_name": "name", - "title": "姓名", - "model": "Users" + "title": "角色名称", + "model": "Role" }, { - "field_name": "update_datetime", - "title": "修改时间", - "model": "Users" + "field_name": "sort", + "title": "角色顺序", + "model": "Role" }, { - "field_name": "username", - "title": "用户账号", - "model": "Users" + "field_name": "status", + "title": "角色状态", + "model": "Role" }, { - "field_name": "user_type", - "title": "用户类型", - "model": "Users" + "field_name": "update_datetime", + "title": "修改时间", + "model": "Role" } ] }, @@ -690,35 +733,11 @@ "menu_button": [ { "name": "查询", - "value": "Search", - "api": "/api/system/downloadCenter/", - "method": 0 - }, - { - "name": "详情", - "value": "Retrieve", - "api": "/api/system/downloadCenter/{id}/", - "method": 0 - }, - { - "name": "新增", - "value": "Create", - "api": "/api/system/downloadCenter/", - "method": 1 - }, - { - "name": "编辑", - "value": "Update", - "api": "/api/system/downloadCenter/{id}/", - "method": 2 - }, - { - "name": "删除", - "value": "Delete", - "api": "/api/system/downloadCenter/{id}/", - "method": 3 + "value": "downloadCenter:Search", + "api": "/api/system/download_center/" } - ] + ], + "menu_field": [] } ], "menu_button": [], diff --git a/backend/dvadmin/utils/viewset.py b/backend/dvadmin/utils/viewset.py index 42948b1afb7a80fbe6fd1e8175a6345157365598..89de67a28f9cf83012e0a3c143bfdecb1a20ea39 100644 --- a/backend/dvadmin/utils/viewset.py +++ b/backend/dvadmin/utils/viewset.py @@ -152,3 +152,13 @@ class CustomModelViewSet(ModelViewSet, ImportSerializerMixin, ExportSerializerMi return SuccessResponse(data=[], msg="删除成功") else: return ErrorResponse(msg="未获取到keys字段") + + @action(methods=['post'], detail=False) + def get_by_ids(self, request): + """通过IDS列表获取数据""" + ids = request.data.get('ids', []) + if ids and ids != ['']: + queryset = self.get_queryset().filter(id__in=ids) + serializer = self.get_serializer(queryset, many=True) + return DetailResponse(data=serializer.data) + return DetailResponse(data=None) diff --git a/backend/templates/terms_service.html b/backend/templates/terms_service.html index cef7e386f498364ef67303a1b64ac2803b4c4b5a..566cd8663a1fe3c9e419c30040e2102146cd6448 100644 --- a/backend/templates/terms_service.html +++ b/backend/templates/terms_service.html @@ -82,7 +82,7 @@

五、巨梦科技企业客户服务说明

- 1、巨梦科技平台提供给多家企业客户使用,企业客户通过巨梦科技平台进行发布用户活动等。如果功夫企火星企业用户违反了隐私政策或发生其它侵犯用户权益的行为,用户可要求巨梦科技提供必要的配合与巨梦科技企业用户进行沟通和维权,维权过程中产生的费用由用户自行承担。

+ 1、巨梦科技平台提供给多家企业客户使用,企业客户通过巨梦科技平台进行发布用户活动等。如果企业用户违反了隐私政策或发生其它侵犯用户权益的行为,用户可要求巨梦科技提供必要的配合与巨梦科技企业用户进行沟通和维权,维权过程中产生的费用由用户自行承担。

六、其他事宜

diff --git a/backend/util/currency.py b/backend/util/currency.py new file mode 100644 index 0000000000000000000000000000000000000000..9c5436edd6ae8eb182ba056aad7969b61200f5db --- /dev/null +++ b/backend/util/currency.py @@ -0,0 +1,78 @@ +from uuid import uuid4 +from datetime import datetime + +from django.db import connection +from django.db.models import Model +from django.core.cache import cache + + +def create_code(model,prefix): + current_date = datetime.now().strftime('%Y%m%d%H%M%S') + code = f"{prefix}{current_date}" + str(uuid4().int)[:6] + return code + +def lock(key): + if callable(key): # @lock + def inner(*args, **kwargs): + with cache.lock(key='lock'): + return key(*args, **kwargs) + inner.__name__ = key.__name__ + else: # @lock(key='aaa') + def inner(func): + def _inner(*args, **kwargs): + with cache.lock(key=key): + return func(*args, **kwargs) + _inner.__name__ = func.__name__ + return _inner + return inner + +def recursion_down_fast(instance:Model, parent='parent', key='id') -> list[int]: + """向下递归instance的所有子级,且返回一维列表,使用sql优化,速度非常快""" + if not instance: + return [] + sql = f""" + WITH RECURSIVE children AS ( + SELECT id, {key} AS param_{key} FROM {instance.__class__._meta.db_table} WHERE {parent}_id = %s UNION ALL + SELECT a.id, a.{key} AS param_{key} FROM {instance.__class__._meta.db_table} a + INNER JOIN children b ON a.{parent}_id = b.id + ) SELECT param_{key} FROM children; + """ + with connection.cursor() as cursor: + cursor.execute(sql, [getattr(instance, key)]) + data = cursor.fetchall() + return [getattr(instance, key), *[i[0] for i in data]] + +def recursion_up_fast(instance: Model, parent='parent', key='id') -> list[int]: + """向上递归instance的所有父级,使用sql优化,速度非常快""" + if not instance: + return [] + sql = f""" + WITH RECURSIVE parents AS ( + SELECT id, {key} as param_{key}, {parent}_id FROM {instance.__class__._meta.db_table} WHERE id = %s UNION ALL + SELECT a.id, a.{key} as param_{key}, a.{parent}_id FROM {instance.__class__._meta.db_table} a + INNER JOIN parents b ON a.id = b.{parent}_id + ) SELECT param_{key} FROM parents; + """ + with connection.cursor() as cursor: + cursor.execute(sql, [getattr(instance, key)]) + data = cursor.fetchall() + return [getattr(instance, key), *[i[0] for i in data]] + +def recursion_up_joint(instance: Model, parent='parent', key='name', joint='/') -> str: + """向上递归instance所有父级并拼接需要的值,返回完整路径,使用sql优化,速度非常快""" + if instance is None: + return '' + sql = f""" + WITH RECURSIVE parents AS ( + SELECT id, {parent}_id, {key}::TEXT AS path FROM {instance.__class__._meta.db_table} WHERE {key} = %s AND id = %s UNION ALL + SELECT a.id, a.{parent}_id, (a.{key} || '{joint}' || b.path)::TEXT FROM {instance.__class__._meta.db_table} a + INNER JOIN parents b ON a.id = b.{parent}_id + ) SELECT path FROM parents where {parent}_id IS NULL; + """ + with connection.cursor() as cursor: + cursor.execute(sql, [getattr(instance, key), instance.pk]) + data = cursor.fetchall() + try: + return data[0][0] + except IndexError: + raise Exception('找不到初始数据') \ No newline at end of file diff --git a/web/package.json b/web/package.json index 73981a4e18f4820125fb072a265e6fc740f6fcb9..2a57a86c02822559e4bc734052f2e61533f52495 100644 --- a/web/package.json +++ b/web/package.json @@ -8,7 +8,8 @@ "build:dev": "vite build --mode development", "build": "vite build", "build:local": "vite build --mode local_prod", - "lint-fix": "eslint --fix --ext .js --ext .jsx --ext .vue src/" + "lint-fix": "eslint --fix --ext .js --ext .jsx --ext .vue src/", + "build:flowH5": "vite build --config flowH5.config.ts" }, "dependencies": { "@element-plus/icons-vue": "^2.3.1", @@ -18,6 +19,7 @@ "@fast-crud/ui-interface": "^1.21.2", "@great-dream/dvadmin3-celery-web": "^3.1.3", "@iconify/vue": "^4.1.2", + "@meetjs/vant4-kit": "^1.0.1", "@types/lodash": "^4.17.7", "@vitejs/plugin-vue-jsx": "^4.0.1", "@wangeditor/editor": "^5.1.23", @@ -48,6 +50,8 @@ "print-js": "^1.6.0", "qrcodejs2-fixes": "^0.0.2", "qs": "^6.11.0", + "rollup-plugin-postcss": "^4.0.2", + "rollup-plugin-terser": "^7.0.2", "screenfull": "^6.0.2", "sortablejs": "^1.15.0", "splitpanes": "^3.1.5", @@ -62,6 +66,7 @@ "vue-draggable-plus": "^0.6.0", "vue-grid-layout": "^3.0.0-beta1", "vue-i18n": "^9.14.0", + "vue-qr": "^4.0.9", "vue-router": "^4.4.3", "vxe-table": "^4.6.18", "xe-utils": "^3.5.30" diff --git a/web/src/views/system/menu/components/MenuButtonCom/crud.tsx b/web/src/views/system/menu/components/MenuButtonCom/crud.tsx index 79675fba30975199db2fc467e36ccfa9e1e27a44..3bc42102722c19aaecf6e75678a469f462bf45b9 100644 --- a/web/src/views/system/menu/components/MenuButtonCom/crud.tsx +++ b/web/src/views/system/menu/components/MenuButtonCom/crud.tsx @@ -77,7 +77,7 @@ export const createCrudOptions = function ({crudExpose, context}: CreateCrudOpti actionbar: { buttons: { add: { - show: auth('btn:Create') + show: auth('menu:CreateButton') }, batchAdd: { show: true, @@ -108,10 +108,10 @@ export const createCrudOptions = function ({crudExpose, context}: CreateCrudOpti edit: { icon: '', type: 'primary', - show: auth('btn:Update') + show: auth('menu:UpdateButton') }, remove: { - show: auth('btn:Delete') + show: auth('menu:DeleteButton') }, }, }, diff --git a/web/src/views/system/role/components/searchUsers/crud.tsx b/web/src/views/system/role/components/searchUsers/crud.tsx index 56fed066a55a62ea561bc91dc579c698615e9c9d..29d52c96f9b0e536b6cb6a3098c801455fcb59c2 100644 --- a/web/src/views/system/role/components/searchUsers/crud.tsx +++ b/web/src/views/system/role/components/searchUsers/crud.tsx @@ -75,7 +75,7 @@ export const createCrudOptions = function ({ crudExpose, context }: CreateCrudOp actionbar: { buttons: { add: { - show: auth('role:AuthorizedAdd'), + show: auth('role:SetMenu'), click: (ctx: any) => { context!.subUserRef.value.dialog = true; nextTick(() => { @@ -91,7 +91,7 @@ export const createCrudOptions = function ({ crudExpose, context }: CreateCrudOp //固定右侧 fixed: 'left', width: 120, - show: auth('role:AuthorizedDel'), + show: auth('role:SetMenu'), buttons: { view: { show: false, @@ -115,7 +115,7 @@ export const createCrudOptions = function ({ crudExpose, context }: CreateCrudOp title: "选择", form: { show: false}, column: { - show: auth('role:AuthorizedDel'), + show: auth('role:SetMenu'), type: "selection", align: "center", width: "55px", diff --git a/web/src/views/system/role/components/searchUsers/index.vue b/web/src/views/system/role/components/searchUsers/index.vue index f2e8d0b97a8d63c34dc150b0e06f4cfabc188f59..89b46e2d3ae8ef239d989730564a1448e7be5c68 100644 --- a/web/src/views/system/role/components/searchUsers/index.vue +++ b/web/src/views/system/role/components/searchUsers/index.vue @@ -25,7 +25,7 @@ diff --git a/web/src/views/system/user/crud.tsx b/web/src/views/system/user/crud.tsx index b93511f5cd4529d1a483d8d78cffc9b978c8dae2..e5d4ea9e6b77338bf8953ab739f73476ac0684e4 100644 --- a/web/src/views/system/user/crud.tsx +++ b/web/src/views/system/user/crud.tsx @@ -19,7 +19,7 @@ import { computed } from "vue"; import { Md5 } from 'ts-md5'; import { commonCrudConfig } from "/@/utils/commonCrud"; import { ElMessageBox } from 'element-plus'; -import {exportData} from "./api"; +import { exportData } from "./api"; export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOptionsRet { const pageRequest = async (query: UserPageQuery) => { return await api.GetList(query); @@ -106,19 +106,15 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp type: 'text', show: auth('user:Delete'), }, - custom: { - text: '重设密码', + resetDefaultPwd: { + text: '重置密码', type: 'text', - show: auth('user:ResetPassword'), - tooltip: { - placement: 'top', - content: '重设密码', - }, - //@ts-ignore - click: (ctx: any) => { - const { row } = ctx; - resetToDefaultPasswordRequest(row) - }, + iconRight: 'Setting', + show: auth('user:ResetDefaultPassword'), + click: (ctx: any) => ElMessageBox.confirm( + '确定重置为系统默认密码吗?', '提示', + { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' } + ).then(() => resetToDefaultPasswordRequest(ctx.row)) }, }, },