Showing
10 changed files
with
33 additions
and
32 deletions
| ... | ... | @@ -8,12 +8,12 @@ VITE_PUBLIC_PATH = / |
| 8 | 8 | # Please note that no line breaks |
| 9 | 9 | |
| 10 | 10 | # 本地 |
| 11 | -# VITE_PROXY = [["/api","http://192.168.10.113:8080/api"]] | |
| 11 | +VITE_PROXY = [["/api","http://192.168.10.113:8080/api"]] | |
| 12 | 12 | |
| 13 | 13 | # 线上演示环境 |
| 14 | 14 | # VITE_PROXY = [["/api","http://101.133.234.90:8080/api"]] |
| 15 | 15 | # 线上测试环境 |
| 16 | -VITE_PROXY = [["/api","http://47.99.141.212:8080/api"]] | |
| 16 | +# VITE_PROXY = [["/api","http://47.99.141.212:8080/api"]] | |
| 17 | 17 | |
| 18 | 18 | # 实时数据的ws地址 |
| 19 | 19 | VITE_WEB_SOCKET = ws://47.99.141.212:8080/api/ws/plugins/telemetry?token= | ... | ... |
| ... | ... | @@ -36,9 +36,7 @@ export const useBatchDelete = ( |
| 36 | 36 | await deleteFn([record.id]); |
| 37 | 37 | createMessage.success('删除成功'); |
| 38 | 38 | handleSuccess(); |
| 39 | - } catch (e) { | |
| 40 | - createMessage.error('删除失败'); | |
| 41 | - } | |
| 39 | + } catch (e) {} | |
| 42 | 40 | } else { |
| 43 | 41 | try { |
| 44 | 42 | await deleteFn(selectedRowIds.value); |
| ... | ... | @@ -46,7 +44,6 @@ export const useBatchDelete = ( |
| 46 | 44 | selectedRowIds.value = []; |
| 47 | 45 | handleSuccess(); |
| 48 | 46 | } catch (e) { |
| 49 | - createMessage.error('删除失败'); | |
| 50 | 47 | selectedRowIds.value = []; |
| 51 | 48 | } |
| 52 | 49 | } | ... | ... |
| ... | ... | @@ -57,27 +57,22 @@ |
| 57 | 57 | }); |
| 58 | 58 | // 发布通知 |
| 59 | 59 | const handleSend = async () => { |
| 60 | - await validate(); | |
| 60 | + const valid = await validate(); | |
| 61 | + if (!valid) return; | |
| 61 | 62 | const field = getFieldsValue(); |
| 62 | 63 | const pointId = field.receiverType === '1' ? field.organizationId + '' : null; |
| 63 | 64 | // 新增情况 |
| 64 | - if (!unref(isUpdate)) { | |
| 65 | - const addNotice = { | |
| 66 | - ...field, | |
| 67 | - pointId, | |
| 68 | - }; | |
| 69 | - await notifyAddLeaseApi(addNotice); | |
| 70 | - } else { | |
| 65 | + try { | |
| 71 | 66 | const editNotice = { |
| 72 | 67 | ...field, |
| 73 | 68 | pointId, |
| 74 | - id: unref(noticeId), | |
| 69 | + id: unref(isUpdate) ? unref(noticeId) : undefined, | |
| 75 | 70 | }; |
| 76 | 71 | await notifyAddLeaseApi(editNotice); |
| 77 | - } | |
| 78 | - emit('success'); | |
| 79 | - closeDrawer(); | |
| 80 | - createMessage.success('发布成功'); | |
| 72 | + emit('success'); | |
| 73 | + closeDrawer(); | |
| 74 | + createMessage.success('发布成功'); | |
| 75 | + } catch {} | |
| 81 | 76 | }; |
| 82 | 77 | // 保存草稿 |
| 83 | 78 | const handleSaveDraft = async () => { | ... | ... |
| ... | ... | @@ -93,8 +93,8 @@ export const searchFormSchema: FormSchema[] = [ |
| 93 | 93 | componentProps: { |
| 94 | 94 | placeholder: '请选择状态', |
| 95 | 95 | options: [ |
| 96 | - { label: '已启用', value: '1' }, | |
| 97 | - { label: '未启用', value: '0' }, | |
| 96 | + { label: '启用', value: '1' }, | |
| 97 | + { label: '禁用', value: '0' }, | |
| 98 | 98 | ], |
| 99 | 99 | }, |
| 100 | 100 | colProps: { span: 6 }, | ... | ... |
| ... | ... | @@ -111,8 +111,8 @@ export const columns: BasicColumn[] = [ |
| 111 | 111 | } |
| 112 | 112 | return h(Switch, { |
| 113 | 113 | checked: record.status === 1, |
| 114 | - checkedChildren: '已启用', | |
| 115 | - unCheckedChildren: '已禁用', | |
| 114 | + checkedChildren: '启用', | |
| 115 | + unCheckedChildren: '禁用', | |
| 116 | 116 | loading: record.pendingStatus, |
| 117 | 117 | onChange(checked: boolean) { |
| 118 | 118 | record.pendingStatus = true; |
| ... | ... | @@ -122,9 +122,9 @@ export const columns: BasicColumn[] = [ |
| 122 | 122 | .then(() => { |
| 123 | 123 | record.status = newStatus; |
| 124 | 124 | if (record.status == 1) { |
| 125 | - createMessage.success(`已启用`); | |
| 125 | + createMessage.success(`启用成功`); | |
| 126 | 126 | } else { |
| 127 | - createMessage.success('已禁用'); | |
| 127 | + createMessage.success('禁用成功'); | |
| 128 | 128 | } |
| 129 | 129 | }) |
| 130 | 130 | .finally(() => { |
| ... | ... | @@ -220,8 +220,8 @@ export const searchFormSchema: FormSchema[] = [ |
| 220 | 220 | componentProps: { |
| 221 | 221 | placeholder: '请选择状态', |
| 222 | 222 | options: [ |
| 223 | - { label: '已启用', value: '1' }, | |
| 224 | - { label: '未启用', value: '0' }, | |
| 223 | + { label: '启用', value: '1' }, | |
| 224 | + { label: '禁用', value: '0' }, | |
| 225 | 225 | ], |
| 226 | 226 | }, |
| 227 | 227 | colProps: { span: 6 }, | ... | ... |
| ... | ... | @@ -43,7 +43,7 @@ |
| 43 | 43 | if (unref(isUpdate)) { |
| 44 | 44 | //为表单赋值 |
| 45 | 45 | await setFieldsValue(data.record); |
| 46 | - const organizationId = Reflect.get(data.record, 'id'); | |
| 46 | + organizationId = Reflect.get(data.record, 'id'); | |
| 47 | 47 | // 过滤当前选中的组织, |
| 48 | 48 | (function filterTransFun(treeData: any[]) { |
| 49 | 49 | treeData.forEach((item, index, arr) => { |
| ... | ... | @@ -73,6 +73,7 @@ |
| 73 | 73 | if (isUpdate.value) { |
| 74 | 74 | Reflect.set(values, 'id', organizationId); |
| 75 | 75 | } |
| 76 | + | |
| 76 | 77 | await saveOrUpdateOrganization( |
| 77 | 78 | { ...values, parentId: values.parentId ?? null }, |
| 78 | 79 | isUpdate.value | ... | ... |
| ... | ... | @@ -31,7 +31,7 @@ |
| 31 | 31 | import { formSchema } from './role.data'; |
| 32 | 32 | import { BasicDrawer, useDrawerInner } from '/@/components/Drawer'; |
| 33 | 33 | import { BasicTree, TreeItem } from '/@/components/Tree'; |
| 34 | - | |
| 34 | + import { useMessage } from '/@/hooks/web/useMessage'; | |
| 35 | 35 | const { t } = useI18n(); //加载国际化 |
| 36 | 36 | // 加载菜单数据 |
| 37 | 37 | import { getMenuList, getMenusIdsByRoleId } from '/@/api/sys/menu'; |
| ... | ... | @@ -111,6 +111,7 @@ |
| 111 | 111 | const getTitle = computed(() => (!unref(isUpdate) ? '新增角色' : '编辑角色')); |
| 112 | 112 | |
| 113 | 113 | async function handleSubmit() { |
| 114 | + const { createMessage } = useMessage(); | |
| 114 | 115 | try { |
| 115 | 116 | const values = await validate(); |
| 116 | 117 | setDrawerProps({ confirmLoading: true }); |
| ... | ... | @@ -124,6 +125,7 @@ |
| 124 | 125 | saveOrUpdateRoleInfoWithMenu(req).then(() => { |
| 125 | 126 | closeDrawer(); |
| 126 | 127 | emit('success'); |
| 128 | + createMessage.success(`${unref(isUpdate) ? '编辑' : '新增'}成功`); | |
| 127 | 129 | }); |
| 128 | 130 | } finally { |
| 129 | 131 | setDrawerProps({ confirmLoading: false }); | ... | ... |
| ... | ... | @@ -32,14 +32,13 @@ |
| 32 | 32 | import { BasicDrawer, useDrawerInner } from '/@/components/Drawer'; |
| 33 | 33 | import { BasicTree, TreeItem } from '/@/components/Tree'; |
| 34 | 34 | const { t } = useI18n(); //加载国际化 |
| 35 | - // import { getMenuList } from '/@/api/demo/system'; | |
| 36 | 35 | // 加载菜单数据 |
| 37 | 36 | import { getMenuList, getMenusIdsByRoleId } from '/@/api/sys/menu'; |
| 38 | 37 | import { useI18n } from '/@/hooks/web/useI18n'; |
| 39 | 38 | import { RouteItem } from '/@/api/sys/model/menuModel'; |
| 40 | 39 | import { saveOrUpdateRoleInfoWithMenu } from '/@/api/system/system'; |
| 41 | 40 | import { RoleEnum } from '/@/enums/roleEnum'; |
| 42 | - // import useCurrentInstance from '/@/hooks/web/useCurrentInstance'; | |
| 41 | + import { useMessage } from '/@/hooks/web/useMessage'; | |
| 43 | 42 | |
| 44 | 43 | export default defineComponent({ |
| 45 | 44 | name: 'RoleDrawer', |
| ... | ... | @@ -112,6 +111,8 @@ |
| 112 | 111 | const getTitle = computed(() => (!unref(isUpdate) ? '新增角色' : '编辑角色')); |
| 113 | 112 | |
| 114 | 113 | async function handleSubmit() { |
| 114 | + const { createMessage } = useMessage(); | |
| 115 | + | |
| 115 | 116 | try { |
| 116 | 117 | const values = await validate(); |
| 117 | 118 | setDrawerProps({ confirmLoading: true }); |
| ... | ... | @@ -126,6 +127,7 @@ |
| 126 | 127 | await saveOrUpdateRoleInfoWithMenu(req); |
| 127 | 128 | closeDrawer(); |
| 128 | 129 | emit('success'); |
| 130 | + createMessage.success(`${unref(isUpdate) ? '编辑' : '新增'}成功`); | |
| 129 | 131 | } finally { |
| 130 | 132 | setDrawerProps({ confirmLoading: false }); |
| 131 | 133 | } | ... | ... |