diff --git a/Api/Ewide.Core/Ewide.Core.Web.Src/src/assets/style/main.less b/Api/Ewide.Core/Ewide.Core.Web.Src/src/assets/style/main.less
index fdb3fe6..8e14533 100644
--- a/Api/Ewide.Core/Ewide.Core.Web.Src/src/assets/style/main.less
+++ b/Api/Ewide.Core/Ewide.Core.Web.Src/src/assets/style/main.less
@@ -59,6 +59,83 @@
}
}
}
+ .user-container {
+ z-index: 10;
+
+ width: 32px + @padding-sm * 2;
+ height: @layout-header-height - 24px;
+ margin: 2px 0;
+
+ transition: @animation-duration-slow;
+ .user-container-inner {
+ position: relative;
+
+ transition: @animation-duration-slow;
+
+ border-radius: @border-radius-base;
+ }
+ .user {
+ &--base {
+ line-height: @layout-header-height - 24px;
+
+ position: relative;
+
+ display: flex;
+ overflow: hidden;
+ align-items: center;
+
+ width: 100%;
+ height: @layout-header-height - 24px;
+ padding: 0 @padding-sm;
+
+ transition: @animation-duration-slow;
+ }
+ &--avatar {
+ box-shadow: 0 0 0 2px @white;
+ }
+ &--name {
+ position: absolute;
+ left: 32px + @padding-sm * 2;
+
+ transition: @animation-duration-slow;
+
+ opacity: 0;
+ }
+ &--dropdown {
+ width: 200px;
+
+ transition: @animation-duration-base;
+ transform: scaleY(0);
+ transform-origin: top;
+
+ opacity: 0;
+ .ant-dropdown-menu {
+ box-shadow: none;
+ }
+ }
+ }
+ &.open {
+ width: 200px;
+ .user-container-inner {
+ background-color: @white;
+ box-shadow: @box-shadow-base;
+ }
+ .user {
+ &--name {
+ opacity: 1;
+ }
+ }
+ }
+ &.drop {
+ .user {
+ &--dropdown {
+ transform: scaleY(1);
+
+ opacity: 1;
+ }
+ }
+ }
+ }
}
.ant-layout-content {
position: relative;
@@ -73,7 +150,7 @@
width: 100%;
>.ant-tabs-bar {
- z-index: 6;
+ z-index: 5;
margin-bottom: 0;
@@ -176,7 +253,7 @@
.ant-layout-header {
line-height: @layout-header-height - 20px;
- z-index: 5;
+ z-index: 6;
height: @layout-header-height - 20px;
padding: 0;
@@ -188,7 +265,9 @@
}
.header-actions {
.header-action {
- line-height: @layout-header-height - 20px;
+ line-height: @layout-header-height - 16px;
+
+ height: @layout-header-height - 20px;
.anticon {
color: fade(@black, 35%);
}
@@ -339,6 +418,9 @@
}
}
}
+ .user-container {
+ margin: 12px 0;
+ }
.logo {
font-size: @font-size-lg * 1.5;
font-weight: 500;
@@ -389,7 +471,7 @@
&--container {
.ant-layout-header {
.ant-menu-horizontal {
- width: 600px;
+ width: 400px;
}
}
.ant-layout-content {
diff --git a/Api/Ewide.Core/Ewide.Core.Web.Src/src/common/api/index.js b/Api/Ewide.Core/Ewide.Core.Web.Src/src/common/api/index.js
index eb6f495..2abd397 100644
--- a/Api/Ewide.Core/Ewide.Core.Web.Src/src/common/api/index.js
+++ b/Api/Ewide.Core/Ewide.Core.Web.Src/src/common/api/index.js
@@ -77,12 +77,22 @@ for (let key in urls) {
.then(({ data }) => {
reslove(data)
})
- .catch(err => {
- if (process.env.VUE_APP_NODE_ENV === 'development') {
- alert('发生错误,请联系管理员')
- } else {
- reject(err, urls[key])
- }
+ .catch(({ response: { data } }) => {
+ const { code, message } = data
+ app.$notification.error({
+ duration: 0,
+ message: code,
+ description: message,
+ })
+
+ // if (process.env.VUE_APP_NODE_ENV === 'development') {
+ // app.$notification.open({
+ // message: '错误',
+ // description: '发生错误,请联系管理员',
+ // });
+ // } else {
+ // reject(err, urls[key])
+ // }
})
})
}
diff --git a/Api/Ewide.Core/Ewide.Core.Web.Src/src/common/login/index.js b/Api/Ewide.Core/Ewide.Core.Web.Src/src/common/login/index.js
index 5b6e84d..edfa8f7 100644
--- a/Api/Ewide.Core/Ewide.Core.Web.Src/src/common/login/index.js
+++ b/Api/Ewide.Core/Ewide.Core.Web.Src/src/common/login/index.js
@@ -46,7 +46,7 @@ const doLogin = (args) => {
const doLogout = () => {
return new Promise((resolve, reject) => {
- api.logout().then(({ result: { success, message } }) => {
+ api.logout().then(({ success, message }) => {
if (success) {
removeGlobal()
token.value = ''
diff --git a/Api/Ewide.Core/Ewide.Core.Web.Src/src/components/authorized/index.js b/Api/Ewide.Core/Ewide.Core.Web.Src/src/components/authorized/index.js
index d917b6f..417851c 100644
--- a/Api/Ewide.Core/Ewide.Core.Web.Src/src/components/authorized/index.js
+++ b/Api/Ewide.Core/Ewide.Core.Web.Src/src/components/authorized/index.js
@@ -37,9 +37,9 @@
*
*/
-const authByArray = (auth, permissions) => {
+import app from '@/main'
- let result = true
+const authByArray = (auth, permissions) => {
const flags = []
@@ -57,8 +57,25 @@ const authByArray = (auth, permissions) => {
}
})
- flags.forEach(p => {
- result = p[1] === '&&' ? result && p[0] : result || p[0]
+ let result
+
+ flags.forEach((p, i) => {
+ if (p[1] === '&&') {
+ if (i === 0) {
+ result = true
+ }
+ if (result) {
+ result = p[0]
+ }
+ } else {
+ if (i === 0) {
+ result = false
+ }
+ if (!result) {
+ result = p[0]
+ }
+ }
+ //result = p[1] === '&&' ? result && p[0] : result || p[0]
})
return result
@@ -71,10 +88,10 @@ const authByJson = (auth, permissions) => {
const flags = []
const deepName = (arr, key) => {
- arr.forEach(p => {
+ arr.forEach((p, i) => {
switch (p.constructor) {
case String:
- p = `${key}:${p}`
+ arr[i] = `${key}:${p}`
break
case Array:
p = deepName(p, key)
@@ -84,6 +101,7 @@ const authByJson = (auth, permissions) => {
break
}
})
+ return arr
}
for (let key in auth) {
@@ -106,6 +124,41 @@ const authByJson = (auth, permissions) => {
}
+export const auth = (auth) => {
+
+ const { info } = app.global
+ const permissions = info.permissions
+
+ if (!info) {
+ return false
+ }
+
+ /**
+ * 超级管理员
+ */
+ if (info.adminType === 1) {
+ return true
+ }
+
+ let flag = false
+
+ if (auth) {
+ switch (auth.constructor) {
+ case String:
+ flag = permissions.indexOf(auth) > -1
+ break
+ case Array:
+ flag = authByArray(auth, permissions)
+ break
+ case Object:
+ flag = authByJson(auth, permissions)
+ break
+ }
+ }
+
+ return flag
+}
+
export default {
functional: true,
props: {
@@ -125,37 +178,9 @@ export default {
render(h, context) {
const { props, scopedSlots } = context
- const { info } = context.parent.$root.global
- const permissions = info.permissions
- const auth = props.auth
const authExclude = props.authExclude
- if (!info) {
- return false
- }
-
- /**
- * 超级管理员
- */
- if (info.adminType === 1) {
- return scopedSlots.default()
- }
-
- let flag = false
-
- if (auth) {
- switch (auth.constructor) {
- case String:
- flag = permissions.indexOf(auth) > -1
- break
- case Array:
- flag = authByArray(auth, permissions)
- break
- case Object:
- flag = authByJson(auth, permissions)
- break
- }
- }
+ let flag = auth(props.auth)
if (flag) {
return scopedSlots.default()
diff --git a/Api/Ewide.Core/Ewide.Core.Web.Src/src/components/yoTable/index.js b/Api/Ewide.Core/Ewide.Core.Web.Src/src/components/yoTable/index.js
index 21cff88..64072b3 100644
--- a/Api/Ewide.Core/Ewide.Core.Web.Src/src/components/yoTable/index.js
+++ b/Api/Ewide.Core/Ewide.Core.Web.Src/src/components/yoTable/index.js
@@ -1,3 +1,5 @@
+import { template } from "lodash";
+
export default {
props: {
pageNo: {
@@ -33,6 +35,11 @@ export default {
showQuickJumper: true,
showTotal: (total) => `总共${total}条数据`
},
+
+ sorter: {
+ sortField: '',
+ sortOrder: '',
+ }
};
},
@@ -57,7 +64,8 @@ export default {
this.loadData({
pageNo: this.pagination.current,
- pageSize: this.pagination.pageSize
+ pageSize: this.pagination.pageSize,
+ ...this.sorter
}).then((res) => {
this.data = res.rows
this.pagination.total = res.totalRows
@@ -75,6 +83,7 @@ export default {
onTableChange(pagination, filters, sorter) {
this.pagination = pagination
+ this.sorter = sorter
this.onLoadData()
}
},
@@ -95,11 +104,17 @@ export default {
}
return (
-
- {Object.keys(this.$slots).map((name) => (
- {this.$slots[name]}
- ))}
-
+
+
+ 后端没有排序参数
+
+
+
+ {Object.keys(this.$slots).map((name) => (
+ {this.$slots[name]}
+ ))}
+
+
)
},
}
\ No newline at end of file
diff --git a/Api/Ewide.Core/Ewide.Core.Web.Src/src/components/yoTreeLayout/index.js b/Api/Ewide.Core/Ewide.Core.Web.Src/src/components/yoTreeLayout/index.js
index 9d36221..3f7ba4c 100644
--- a/Api/Ewide.Core/Ewide.Core.Web.Src/src/components/yoTreeLayout/index.js
+++ b/Api/Ewide.Core/Ewide.Core.Web.Src/src/components/yoTreeLayout/index.js
@@ -180,7 +180,7 @@ export default {
- {this.$scopedSlots.default()}
+ {this.$scopedSlots.default ? this.$scopedSlots.default() : null}
)
diff --git a/Api/Ewide.Core/Ewide.Core.Web.Src/src/main.js b/Api/Ewide.Core/Ewide.Core.Web.Src/src/main.js
index 33d1d2d..a97461f 100644
--- a/Api/Ewide.Core/Ewide.Core.Web.Src/src/main.js
+++ b/Api/Ewide.Core/Ewide.Core.Web.Src/src/main.js
@@ -39,6 +39,9 @@ Vue.prototype.$api = api
import _ from 'lodash'
Vue.prototype.$_ = _
+import { auth } from './components/authorized'
+Vue.prototype.$auth = auth
+
/**
* 注册全局组件
*/
diff --git a/Api/Ewide.Core/Ewide.Core.Web.Src/src/pages/system/org/addForm.vue b/Api/Ewide.Core/Ewide.Core.Web.Src/src/pages/system/org/addForm.vue
new file mode 100644
index 0000000..8002997
--- /dev/null
+++ b/Api/Ewide.Core/Ewide.Core.Web.Src/src/pages/system/org/addForm.vue
@@ -0,0 +1,69 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Api/Ewide.Core/Ewide.Core.Web.Src/src/pages/system/org/editForm.vue b/Api/Ewide.Core/Ewide.Core.Web.Src/src/pages/system/org/editForm.vue
new file mode 100644
index 0000000..3f917c2
--- /dev/null
+++ b/Api/Ewide.Core/Ewide.Core.Web.Src/src/pages/system/org/editForm.vue
@@ -0,0 +1,72 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Api/Ewide.Core/Ewide.Core.Web.Src/src/pages/system/org/form.vue b/Api/Ewide.Core/Ewide.Core.Web.Src/src/pages/system/org/form.vue
new file mode 100644
index 0000000..2600cee
--- /dev/null
+++ b/Api/Ewide.Core/Ewide.Core.Web.Src/src/pages/system/org/form.vue
@@ -0,0 +1,66 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Api/Ewide.Core/Ewide.Core.Web.Src/src/pages/system/org/index.vue b/Api/Ewide.Core/Ewide.Core.Web.Src/src/pages/system/org/index.vue
index 0bc6fc9..41ba1c1 100644
--- a/Api/Ewide.Core/Ewide.Core.Web.Src/src/pages/system/org/index.vue
+++ b/Api/Ewide.Core/Ewide.Core.Web.Src/src/pages/system/org/index.vue
@@ -1,3 +1,172 @@
-
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+
+
+
+
+ 查询
+ 重置
+
+
+
+
+
+
+
+
+
+ 编辑
+
+
+
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Api/Ewide.Core/Ewide.Core.Web.Src/src/pages/system/user/index.vue b/Api/Ewide.Core/Ewide.Core.Web.Src/src/pages/system/user/index.vue
index 640776d..22bfecf 100644
--- a/Api/Ewide.Core/Ewide.Core.Web.Src/src/pages/system/user/index.vue
+++ b/Api/Ewide.Core/Ewide.Core.Web.Src/src/pages/system/user/index.vue
@@ -2,11 +2,14 @@
-
- 后端bug:生日不填写,在保存时会默认写入0001-01-01
+
+
+ 后端bug:生日不填写,在保存时会默认写入0001-01-01
+
权限问题,在这里需要用到组织架构以及职位的数据接口,所以必须配置该两项的菜单
+
-
+
缺授权的两块功能
@@ -82,7 +85,7 @@
删除
-
+
授权
@@ -156,14 +159,6 @@ export default {
customRender: 'status',
},
},
- {
- title: '操作',
- width: '240px',
- dataIndex: 'action',
- scopedSlots: {
- customRender: 'action',
- },
- },
],
codes: [
{
@@ -180,6 +175,18 @@ export default {
created() {
this.onLoadCodes();
+
+ const flag = this.$auth({
+ sysUser: ['edit', 'resetPwd', 'delete', 'grantRole', 'grantData'],
+ });
+ if (flag) {
+ this.columns.push({
+ title: '操作',
+ width: '240px',
+ dataIndex: 'action',
+ scopedSlots: { customRender: 'action' },
+ });
+ }
},
methods: {
diff --git a/Api/Ewide.Core/Ewide.Core.Web.Src/src/views/main/_layout/header/index.vue b/Api/Ewide.Core/Ewide.Core.Web.Src/src/views/main/_layout/header/index.vue
index e9d6e4d..d881ca7 100644
--- a/Api/Ewide.Core/Ewide.Core.Web.Src/src/views/main/_layout/header/index.vue
+++ b/Api/Ewide.Core/Ewide.Core.Web.Src/src/views/main/_layout/header/index.vue
@@ -13,6 +13,7 @@