From 5c27bce5ade0ccbc028e6277fcab29230f984f0f Mon Sep 17 00:00:00 2001 From: 32189 <3218665834@qq.com> Date: Thu, 2 Mar 2023 19:34:37 +0800 Subject: [PATCH 01/10] =?UTF-8?q?:tada:=20=E8=A1=A8=E5=8D=95=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/app/appmenu.ts | 83 +++-- src/api/app/approle.ts | 132 ++++--- src/api/app/appuser.ts | 100 +++-- src/views/admin/client/form.vue | 430 +++++++++++----------- src/views/admin/dict/form.vue | 227 ++++++------ src/views/admin/i18n/form.vue | 200 +++++----- src/views/admin/menu/form.vue | 414 ++++++++++----------- src/views/admin/param/form.vue | 279 +++++++------- src/views/admin/role/form.vue | 386 ++++++++++---------- src/views/admin/social/form.vue | 270 +++++++------- src/views/admin/user/form.vue | 504 +++++++++++++------------- src/views/app/appmenu/form.vue | 343 +++++++++--------- src/views/app/approle/form.vue | 226 ++++++------ src/views/app/appsocial/form.vue | 269 +++++++------- src/views/app/appsocial/i18n/zh-cn.ts | 2 +- src/views/app/appuser/form.vue | 405 +++++++++++---------- src/views/pay/channel/form.vue | 223 ++++++------ 17 files changed, 2365 insertions(+), 2128 deletions(-) diff --git a/src/api/app/appmenu.ts b/src/api/app/appmenu.ts index 125a959e..508c918b 100644 --- a/src/api/app/appmenu.ts +++ b/src/api/app/appmenu.ts @@ -1,49 +1,72 @@ import request from "/@/utils/request"; export const pageList = (params?: Object) => { - return request({ - url: '/admin/appmenu/tree', - method: "get", - params - }) + return request({ + url: '/admin/appmenu/tree', + method: "get", + params + }) } export const info = (id: String) => { - return request({ - url: `/admin/appmenu/${id}`, - method: "get", - }) + return request({ + url: `/admin/appmenu/${id}`, + method: "get", + }) } export const save = (data: Object) => { - return request({ - url: '/admin/appmenu', - method: "post", - data: data - }) + return request({ + url: '/admin/appmenu', + method: "post", + data: data + }) } export const update = (data: Object) => { - return request({ - url: '/admin/appmenu', - method: "put", - data: data - }) + return request({ + url: '/admin/appmenu', + method: "put", + data: data + }) } export const addObj = (data: Object) => { - return request({ - url: '/admin/appmenu', - method: "post", - data: data - }) + return request({ + url: '/admin/appmenu', + method: "post", + data: data + }) } -export function delObj (ids?:object) { - return request({ - url: '/admin/appmenu', - method: 'delete', - data:ids - }) +export function delObj(ids?: object) { + return request({ + url: '/admin/appmenu', + method: 'delete', + data: ids + }) } +export function getDetails(obj: Object) { + return request({ + url: '/admin/appmenu/details/' + obj, + method: 'get' + }) +} + +export function validatePermission(rule: any, value: any, callback: any, isEdit: boolean) { + if (isEdit) { + return callback() + } + + getDetails(value).then(response => { + const result = response.data + if (result !== null) { + callback(new Error('权限标识已经存在')) + } else { + callback() + } + }) +} + + diff --git a/src/api/app/approle.ts b/src/api/app/approle.ts index 9d3c3127..726a94eb 100644 --- a/src/api/app/approle.ts +++ b/src/api/app/approle.ts @@ -1,65 +1,115 @@ import request from "/@/utils/request"; export function fetchList(query: any) { - return request({ - url: '/admin/approle/page', - method: 'get', - params: query - }) + return request({ + url: '/admin/approle/page', + method: 'get', + params: query + }) } export function list() { - return request({ - url: '/admin/approle/list', - method: 'get' - }) + return request({ + url: '/admin/approle/list', + method: 'get' + }) } export function addObj(obj: any) { - return request({ - url: '/admin/approle', - method: 'post', - data: obj - }) + return request({ + url: '/admin/approle', + method: 'post', + data: obj + }) } export function getObj(id: string) { - return request({ - url: '/admin/approle/' + id, - method: 'get' - }) + return request({ + url: '/admin/approle/' + id, + method: 'get' + }) } -export function delObj( ids?:object ) { - return request({ - url: '/admin/approle', - method: 'delete', - data:ids - }) +export function delObj(ids?: object) { + return request({ + url: '/admin/approle', + method: 'delete', + data: ids + }) } export function putObj(obj: any) { - return request({ - url: '/admin/approle', - method: 'put', - data: obj - }) + return request({ + url: '/admin/approle', + method: 'put', + data: obj + }) } export function fetchRoleTree(roleId: string) { - return request({ - url: '/admin/appmenu/tree/' + roleId, - method: 'get' - }) + return request({ + url: '/admin/appmenu/tree/' + roleId, + method: 'get' + }) } export function permissionUpd(roleId: string, menuIds: string) { - return request({ - url: '/admin/approle/menu', - method: 'put', - data: { - roleId: roleId, - menuIds: menuIds - } - }) + return request({ + url: '/admin/approle/menu', + method: 'put', + data: { + roleId: roleId, + menuIds: menuIds + } + }) +} + +export function getDetails(obj: Object) { + return request({ + url: '/admin/approle/details/' + obj, + method: 'get' + }) +} + + +export function getDetailsByPhone(obj: Object) { + return request({ + url: '/admin/approle/detailsByCode/' + obj, + method: 'get' + }) +} + + +export function validateApproleName(rule: any, value: any, callback: any, isEdit: boolean) { + const flag = new RegExp(/^([a-z\u4e00-\u9fa5\d]+?)$/).test(value) + if (!flag) { + callback(new Error('用户名支持小写英文、数字、中文')) + } + + if (isEdit) { + return callback() + } + + getDetails(value).then(response => { + const result = response.data + if (result !== null) { + callback(new Error('用户名已经存在')) + } else { + callback() + } + }) +} + +export function validateAppRoleCode(rule: any, value: any, callback: any, isEdit: boolean) { + if (isEdit) { + return callback() + } + getDetailsByPhone(value).then(response => { + const result = response.data + if (result !== null) { + callback(new Error('角色标识已经存在')) + } else { + callback() + } + }) } diff --git a/src/api/app/appuser.ts b/src/api/app/appuser.ts index 9909cb3f..f2902dd3 100644 --- a/src/api/app/appuser.ts +++ b/src/api/app/appuser.ts @@ -1,40 +1,92 @@ import request from "/@/utils/request" export function fetchList(query: any) { - return request({ - url: '/admin/appuser/page', - method: 'get', - params: query - }) + return request({ + url: '/admin/appuser/page', + method: 'get', + params: query + }) } export function addObj(obj: any) { - return request({ - url: '/admin/appuser', - method: 'post', - data: obj - }) + return request({ + url: '/admin/appuser', + method: 'post', + data: obj + }) } export function getObj(id: string) { - return request({ - url: '/admin/appuser/' + id, - method: 'get' - }) + return request({ + url: '/admin/appuser/' + id, + method: 'get' + }) } export function delObj(ids?: object) { - return request({ - url: '/admin/appuser/', - method: 'delete', - data:ids - }) + return request({ + url: '/admin/appuser/', + method: 'delete', + data: ids + }) } export function putObj(obj: any) { - return request({ - url: '/admin/appuser', - method: 'put', - data: obj - }) + return request({ + url: '/admin/appuser', + method: 'put', + data: obj + }) } + + +export function getDetails(obj: Object) { + return request({ + url: '/admin/appuser/details/' + obj, + method: 'get' + }) +} + + +export function getDetailsByPhone(obj: Object) { + return request({ + url: '/admin/appuser/detailsByPhone/' + obj, + method: 'get' + }) +} + +export function validateUsername(rule: any, value: any, callback: any, isEdit: boolean) { + const flag = new RegExp(/^([a-z\u4e00-\u9fa5\d]+?)$/).test(value) + if (!flag) { + callback(new Error('用户名支持小写英文、数字、中文')) + } + + if (isEdit) { + return callback() + } + + getDetails(value).then(response => { + const result = response.data + if (result !== null) { + callback(new Error('用户名已经存在')) + } else { + callback() + } + }) +} + +export function validatePhone(rule: any, value: any, callback: any, isEdit: boolean) { + if (isEdit) { + return callback() + } + getDetailsByPhone(value).then(response => { + const result = response.data + if (result !== null) { + callback(new Error('手机号已经存在')) + } else { + callback() + } + }) +} + + diff --git a/src/views/admin/client/form.vue b/src/views/admin/client/form.vue index 6cafe9e2..e57c0d18 100644 --- a/src/views/admin/client/form.vue +++ b/src/views/admin/client/form.vue @@ -1,251 +1,263 @@ diff --git a/src/views/admin/dict/form.vue b/src/views/admin/dict/form.vue index ee36bf13..8c35579f 100644 --- a/src/views/admin/dict/form.vue +++ b/src/views/admin/dict/form.vue @@ -1,123 +1,130 @@ - diff --git a/src/views/admin/i18n/form.vue b/src/views/admin/i18n/form.vue index 5a929680..d56bedff 100644 --- a/src/views/admin/i18n/form.vue +++ b/src/views/admin/i18n/form.vue @@ -1,118 +1,122 @@ diff --git a/src/views/admin/menu/form.vue b/src/views/admin/menu/form.vue index a53eac63..1048b2e9 100644 --- a/src/views/admin/menu/form.vue +++ b/src/views/admin/menu/form.vue @@ -1,220 +1,226 @@ - diff --git a/src/views/admin/param/form.vue b/src/views/admin/param/form.vue index 54156aac..ad82b8a0 100644 --- a/src/views/admin/param/form.vue +++ b/src/views/admin/param/form.vue @@ -1,164 +1,167 @@ diff --git a/src/views/admin/role/form.vue b/src/views/admin/role/form.vue index a805909a..242ec369 100644 --- a/src/views/admin/role/form.vue +++ b/src/views/admin/role/form.vue @@ -1,209 +1,217 @@ - diff --git a/src/views/admin/social/form.vue b/src/views/admin/social/form.vue index 9c159b3e..763f4d7c 100644 --- a/src/views/admin/social/form.vue +++ b/src/views/admin/social/form.vue @@ -1,151 +1,157 @@ diff --git a/src/views/admin/user/form.vue b/src/views/admin/user/form.vue index 313331a4..c5f22cd3 100644 --- a/src/views/admin/user/form.vue +++ b/src/views/admin/user/form.vue @@ -1,267 +1,279 @@ - diff --git a/src/views/app/appmenu/form.vue b/src/views/app/appmenu/form.vue index cc6e1247..0490a1ea 100644 --- a/src/views/app/appmenu/form.vue +++ b/src/views/app/appmenu/form.vue @@ -1,180 +1,189 @@ - diff --git a/src/views/app/approle/form.vue b/src/views/app/approle/form.vue index 2038a710..f23d0d61 100644 --- a/src/views/app/approle/form.vue +++ b/src/views/app/approle/form.vue @@ -1,43 +1,47 @@ - diff --git a/src/views/app/appsocial/form.vue b/src/views/app/appsocial/form.vue index 098ef16a..6bcb26c7 100644 --- a/src/views/app/appsocial/form.vue +++ b/src/views/app/appsocial/form.vue @@ -1,155 +1,162 @@ diff --git a/src/views/app/appsocial/i18n/zh-cn.ts b/src/views/app/appsocial/i18n/zh-cn.ts index 28ffd7e0..2904fafd 100644 --- a/src/views/app/appsocial/i18n/zh-cn.ts +++ b/src/views/app/appsocial/i18n/zh-cn.ts @@ -6,7 +6,7 @@ export default { type: '类型', remark: '描述', appId: 'appId', - appSecret: 'appSecret', + appSecret: 'app秘钥', redirectUrl: '回调地址', ext: '拓展字段', createBy: '创建人', diff --git a/src/views/app/appuser/form.vue b/src/views/app/appuser/form.vue index 3b8959f5..2cd8f30d 100644 --- a/src/views/app/appuser/form.vue +++ b/src/views/app/appuser/form.vue @@ -1,213 +1,228 @@ - diff --git a/src/views/pay/channel/form.vue b/src/views/pay/channel/form.vue index cd635027..e65e8405 100644 --- a/src/views/pay/channel/form.vue +++ b/src/views/pay/channel/form.vue @@ -1,11 +1,12 @@ \ No newline at end of file From 018f0b49ecc5f0134245f2215de1a7fd10ecae9c Mon Sep 17 00:00:00 2001 From: lbw Date: Fri, 3 Mar 2023 00:43:16 +0800 Subject: [PATCH 02/10] =?UTF-8?q?feat:=20=E5=89=8D=E7=AB=AF=E5=AF=B9?= =?UTF-8?q?=E6=8E=A5=E5=B7=A5=E4=BD=9C=E6=B5=81=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/oa/leave-bill.ts | 46 ++++++++ src/api/oa/model.ts | 46 ++++++++ src/api/oa/process.ts | 23 ++++ src/api/oa/task.ts | 31 +++++ src/i18n/pages/form/en.ts | 1 + src/i18n/pages/form/zh-cn.ts | 1 + src/utils/storage.ts | 4 +- src/views/oa/leave_bill/form.vue | 144 +++++++++++++++++++++++ src/views/oa/leave_bill/i18n/en.ts | 26 +++++ src/views/oa/leave_bill/i18n/zh-cn.ts | 26 +++++ src/views/oa/leave_bill/index.vue | 154 +++++++++++++++++++++++++ src/views/oa/model/detail.vue | 37 ++++++ src/views/oa/model/form.vue | 105 +++++++++++++++++ src/views/oa/model/i18n/en.ts | 16 +++ src/views/oa/model/i18n/zh-cn.ts | 16 +++ src/views/oa/model/index.vue | 142 +++++++++++++++++++++++ src/views/oa/process/i18n/en.ts | 17 +++ src/views/oa/process/i18n/zh-cn.ts | 16 +++ src/views/oa/process/index.vue | 157 ++++++++++++++++++++++++++ src/views/oa/task/comment.vue | 74 ++++++++++++ src/views/oa/task/form.vue | 136 ++++++++++++++++++++++ src/views/oa/task/i18n/en.ts | 18 +++ src/views/oa/task/i18n/zh-cn.ts | 18 +++ src/views/oa/task/index.vue | 131 +++++++++++++++++++++ src/views/personal/index.vue | 2 - 25 files changed, 1384 insertions(+), 3 deletions(-) create mode 100644 src/api/oa/leave-bill.ts create mode 100644 src/api/oa/model.ts create mode 100644 src/api/oa/process.ts create mode 100644 src/api/oa/task.ts create mode 100644 src/views/oa/leave_bill/form.vue create mode 100644 src/views/oa/leave_bill/i18n/en.ts create mode 100644 src/views/oa/leave_bill/i18n/zh-cn.ts create mode 100644 src/views/oa/leave_bill/index.vue create mode 100644 src/views/oa/model/detail.vue create mode 100644 src/views/oa/model/form.vue create mode 100644 src/views/oa/model/i18n/en.ts create mode 100644 src/views/oa/model/i18n/zh-cn.ts create mode 100644 src/views/oa/model/index.vue create mode 100644 src/views/oa/process/i18n/en.ts create mode 100644 src/views/oa/process/i18n/zh-cn.ts create mode 100644 src/views/oa/process/index.vue create mode 100644 src/views/oa/task/comment.vue create mode 100644 src/views/oa/task/form.vue create mode 100644 src/views/oa/task/i18n/en.ts create mode 100644 src/views/oa/task/i18n/zh-cn.ts create mode 100644 src/views/oa/task/index.vue diff --git a/src/api/oa/leave-bill.ts b/src/api/oa/leave-bill.ts new file mode 100644 index 00000000..de553bf0 --- /dev/null +++ b/src/api/oa/leave-bill.ts @@ -0,0 +1,46 @@ +import request from '/@/utils/request'; + +export function fetchList(query) { + return request({ + url: '/admin/leave-bill/page', + method: 'get', + params: query + }) +} + +export function addObj(obj) { + return request({ + url: '/admin/leave-bill', + method: 'post', + data: obj + }) +} + +export function getObj(id) { + return request({ + url: '/admin/leave-bill/' + id, + method: 'get' + }) +} + +export function submit(id) { + return request({ + url: '/admin/leave-bill/submit/' + id, + method: 'get' + }) +} + +export function delObj(id) { + return request({ + url: '/admin/leave-bill/' + id, + method: 'delete' + }) +} + +export function putObj(obj) { + return request({ + url: '/admin/leave-bill/', + method: 'put', + data: obj + }) +} diff --git a/src/api/oa/model.ts b/src/api/oa/model.ts new file mode 100644 index 00000000..4de5bd3e --- /dev/null +++ b/src/api/oa/model.ts @@ -0,0 +1,46 @@ +import request from '/@/utils/request'; + +export function fetchList(query) { + return request({ + url: '/admin/model', + method: 'get', + params: query + }) +} + +export function delObj(id) { + return request({ + url: '/admin/model/' + id, + method: 'delete' + }) +} + +export function deploy(id) { + return request({ + url: '/admin/model/deploy/' + id, + method: 'post' + }) +} + +export function addObj(obj) { + return request({ + url: '/admin/model/insert', + method: 'post', + data: obj + }) +} + +export function getObj(id) { + return request({ + url: '/admin/log/' + id, + method: 'get' + }) +} + +export function putObj(obj) { + return request({ + url: '/admin/log/', + method: 'put', + data: obj + }) +} diff --git a/src/api/oa/process.ts b/src/api/oa/process.ts new file mode 100644 index 00000000..3369e76c --- /dev/null +++ b/src/api/oa/process.ts @@ -0,0 +1,23 @@ +import request from '/@/utils/request'; + +export function fetchList(query) { + return request({ + url: '/admin/process', + method: 'get', + params: query + }) +} + +export function delObj(id) { + return request({ + url: '/admin/process/' + id, + method: 'delete' + }) +} + +export function status(id, type) { + return request({ + url: '/admin/process/status/' + id + '/' + type, + method: 'put' + }) +} diff --git a/src/api/oa/task.ts b/src/api/oa/task.ts new file mode 100644 index 00000000..689cdf19 --- /dev/null +++ b/src/api/oa/task.ts @@ -0,0 +1,31 @@ +import request from '/@/utils/request'; + +export function fetchList(query) { + return request({ + url: '/admin/task/todo', + method: 'get', + params: query + }) +} + +export function fetchDetail(id) { + return request({ + url: '/admin/task/' + id, + method: 'get' + }) +} + +export function fetchComment(id) { + return request({ + url: '/admin/task/comment/' + id, + method: 'get' + }) +} + +export function doTask(obj) { + return request({ + url: '/admin/task', + method: 'post', + data: obj + }) +} diff --git a/src/i18n/pages/form/en.ts b/src/i18n/pages/form/en.ts index 6a367d0d..193d784e 100644 --- a/src/i18n/pages/form/en.ts +++ b/src/i18n/pages/form/en.ts @@ -13,6 +13,7 @@ export default { resetBtn: 'reset', action:'action', optSuccessText: 'operation success', + optConfirmText: 'Confirm this operation ', editSuccessText: 'edit success', addSuccessText: 'add success', delSuccessText: 'delete success', diff --git a/src/i18n/pages/form/zh-cn.ts b/src/i18n/pages/form/zh-cn.ts index 4b74b3dd..ca3ff167 100644 --- a/src/i18n/pages/form/zh-cn.ts +++ b/src/i18n/pages/form/zh-cn.ts @@ -16,6 +16,7 @@ export default { addSuccessText: '添加成功', delSuccessText: '删除成功', delConfirmText: '此操作将永久删除', + optConfirmText: '是否确认本操作', confirmButtonText: '确认', cancelButtonText: '取消', download: '下载' diff --git a/src/utils/storage.ts b/src/utils/storage.ts index a5760d9c..d7286c68 100644 --- a/src/utils/storage.ts +++ b/src/utils/storage.ts @@ -37,7 +37,9 @@ export const Local = { export const Session = { // 设置临时缓存 set(key: string, val: any) { - if (key === 'token' || key === 'refresh_token') return Cookies.set(key, val); + if (key === 'token' || key === 'refresh_token') { + Cookies.set(key, val) + } window.sessionStorage.setItem(key, JSON.stringify(val)); }, // 获取临时缓存 diff --git a/src/views/oa/leave_bill/form.vue b/src/views/oa/leave_bill/form.vue new file mode 100644 index 00000000..ffed072a --- /dev/null +++ b/src/views/oa/leave_bill/form.vue @@ -0,0 +1,144 @@ + + + \ No newline at end of file diff --git a/src/views/oa/leave_bill/i18n/en.ts b/src/views/oa/leave_bill/i18n/en.ts new file mode 100644 index 00000000..869c73f3 --- /dev/null +++ b/src/views/oa/leave_bill/i18n/en.ts @@ -0,0 +1,26 @@ +export default { + leave: { + index: 'index', + importoaLeaveBillTip: 'import OaLeaveBill', + leaveId: 'leaveId', + username: 'username', + days: 'days', + content: 'content', + state: 'state', + leaveTime: 'leaveTime', + createTime: 'createTime', + updateTime: 'updateTime', + delFlag: 'delFlag', + tenantId: 'tenantId', + inputLeaveIdTip: 'input leaveId', + inputUsernameTip: 'input username', + inputDaysTip: 'input days', + inputContentTip: 'input content', + inputStateTip: 'input state', + inputLeaveTimeTip: 'input leaveTime', + inputCreateTimeTip: 'input createTime', + inputUpdateTimeTip: 'input updateTime', + inputDelFlagTip: 'input delFlag', + inputTenantIdTip: 'input tenantId', + } +} \ No newline at end of file diff --git a/src/views/oa/leave_bill/i18n/zh-cn.ts b/src/views/oa/leave_bill/i18n/zh-cn.ts new file mode 100644 index 00000000..0e4254f6 --- /dev/null +++ b/src/views/oa/leave_bill/i18n/zh-cn.ts @@ -0,0 +1,26 @@ +export default { + leave: { + index: '序号', + importoaLeaveBillTip: '导入请假表', + leaveId: '主键', + username: '用户名', + days: '请假天数', + content: '备注', + state: '状态', + leaveTime: '请假时间', + createTime: '创建时间', + updateTime: '更新时间', + delFlag: '删除标识', + tenantId: '所属租户', + inputLeaveIdTip: '请输入主键', + inputUsernameTip: '请输入用户名', + inputDaysTip: '请输入请假天数', + inputContentTip: '请输入备注', + inputStateTip: '请输入状态', + inputLeaveTimeTip: '请输入请假时间', + inputCreateTimeTip: '请输入创建时间', + inputUpdateTimeTip: '请输入更新时间', + inputDelFlagTip: '请输入删除标识', + inputTenantIdTip: '请输入所属租户', + } +} \ No newline at end of file diff --git a/src/views/oa/leave_bill/index.vue b/src/views/oa/leave_bill/index.vue new file mode 100644 index 00000000..5c727dfb --- /dev/null +++ b/src/views/oa/leave_bill/index.vue @@ -0,0 +1,154 @@ + + + \ No newline at end of file diff --git a/src/views/oa/model/detail.vue b/src/views/oa/model/detail.vue new file mode 100644 index 00000000..4217add0 --- /dev/null +++ b/src/views/oa/model/detail.vue @@ -0,0 +1,37 @@ +