create-jnrs-template-vue 1.1.4 → 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/jnrs-template-vue/.prettierrc.json +1 -1
- package/jnrs-template-vue/auto-imports.d.ts +1 -0
- package/jnrs-template-vue/components.d.ts +11 -2
- package/jnrs-template-vue/package.json +18 -17
- package/jnrs-template-vue/public/system/menu.json +29 -9
- package/jnrs-template-vue/src/App.vue +36 -5
- package/jnrs-template-vue/src/api/{base → system}/index.ts +30 -6
- package/jnrs-template-vue/src/assets/styles/init.scss +8 -3
- package/jnrs-template-vue/src/assets/styles/root.scss +7 -24
- package/jnrs-template-vue/src/layout/RouterTabs.vue +5 -4
- package/jnrs-template-vue/src/layout/SideMenu.vue +29 -20
- package/jnrs-template-vue/src/layout/SideMenuItem.vue +1 -1
- package/jnrs-template-vue/src/layout/TopHeader.vue +30 -19
- package/jnrs-template-vue/src/layout/index.vue +36 -6
- package/jnrs-template-vue/src/locales/en.ts +9 -0
- package/jnrs-template-vue/src/locales/index.ts +16 -0
- package/jnrs-template-vue/src/locales/zhCn.ts +9 -0
- package/jnrs-template-vue/src/main.ts +5 -1
- package/jnrs-template-vue/src/router/index.ts +10 -4
- package/jnrs-template-vue/src/types/index.d.ts +6 -0
- package/jnrs-template-vue/src/utils/common.ts +58 -0
- package/jnrs-template-vue/src/views/common/403.vue +2 -2
- package/jnrs-template-vue/src/views/common/404.vue +2 -2
- package/jnrs-template-vue/src/views/home/index.vue +6 -3
- package/jnrs-template-vue/src/views/login/index.vue +15 -26
- package/jnrs-template-vue/src/views/system/dict/index.vue +176 -0
- package/jnrs-template-vue/src/views/system/menu/index.vue +67 -0
- package/jnrs-template-vue/src/views/system/mine/baseInfo.vue +38 -30
- package/jnrs-template-vue/src/views/system/mine/securitySettings.vue +22 -31
- package/jnrs-template-vue/src/views/system/role/editDialog.vue +94 -0
- package/jnrs-template-vue/src/views/system/role/index.vue +30 -3
- package/jnrs-template-vue/src/views/visual/index.vue +6 -1
- package/jnrs-template-vue/vite.config.ts +6 -4
- package/jnrs-template-vue/viteMockServe/dictItemRes.json +27 -0
- package/jnrs-template-vue/viteMockServe/dictRes.json +141 -0
- package/jnrs-template-vue/viteMockServe/fail.ts +26 -0
- package/jnrs-template-vue/viteMockServe/index.ts +18 -25
- package/jnrs-template-vue/viteMockServe/{login.json → loginRes.json} +1 -0
- package/jnrs-template-vue/viteMockServe/success.ts +31 -0
- package/package.json +1 -1
- package/jnrs-template-vue/src/types/index.ts +0 -1
- package/jnrs-template-vue/src/views/system/user/index.vue +0 -9
|
@@ -1,41 +1,32 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { ref } from 'vue'
|
|
2
|
+
import { ref, onMounted } from 'vue'
|
|
3
|
+
import { storeToRefs } from 'pinia'
|
|
3
4
|
import { ElMessage } from 'element-plus'
|
|
4
5
|
import type { UploadProps } from 'element-plus'
|
|
5
6
|
import { useAuthStore } from '@/stores'
|
|
6
7
|
import { useAvatar } from '@/composables/common/useAvatar'
|
|
8
|
+
import { getOneDictList } from '@/utils/common'
|
|
9
|
+
import type { User } from '@jnrs/shared'
|
|
7
10
|
|
|
8
|
-
const { userInfo, token } = useAuthStore()
|
|
11
|
+
const { userInfo, token } = storeToRefs(useAuthStore())
|
|
9
12
|
const { avatar } = useAvatar()
|
|
10
13
|
const loading = ref(false)
|
|
11
14
|
const ruleFormRef = ref()
|
|
12
|
-
const ruleForm = ref({
|
|
15
|
+
const ruleForm = ref<User>({
|
|
16
|
+
id: 0,
|
|
13
17
|
account: '',
|
|
14
18
|
name: '',
|
|
15
19
|
workNo: '',
|
|
16
|
-
jobTitle:
|
|
20
|
+
jobTitle: 0,
|
|
17
21
|
workgroup: '',
|
|
18
|
-
role:
|
|
22
|
+
role: 0,
|
|
23
|
+
avatarFileName: ''
|
|
19
24
|
})
|
|
20
25
|
const rules = ref({
|
|
21
26
|
// account: { required: true, message: '请输入', trigger: 'change' },
|
|
22
27
|
// role: { required: true, message: '请输入', trigger: 'change' },
|
|
23
28
|
// name: { required: true, message: '请输入', trigger: 'change' },
|
|
24
29
|
// workNo: { required: true, message: '请输入', trigger: 'change' },
|
|
25
|
-
// email: [
|
|
26
|
-
// { required: false, message: '请输入', trigger: 'change' },
|
|
27
|
-
// {
|
|
28
|
-
// validator: (rule, value, callback) => {
|
|
29
|
-
// if (value && !isEmail(value)) {
|
|
30
|
-
// callback(new Error('请输入有效的邮箱!'))
|
|
31
|
-
// } else {
|
|
32
|
-
// callback()
|
|
33
|
-
// }
|
|
34
|
-
// },
|
|
35
|
-
// required: false,
|
|
36
|
-
// trigger: 'blur'
|
|
37
|
-
// }
|
|
38
|
-
// ]
|
|
39
30
|
})
|
|
40
31
|
|
|
41
32
|
interface ApiResponse {
|
|
@@ -44,9 +35,15 @@ interface ApiResponse {
|
|
|
44
35
|
data: string
|
|
45
36
|
}
|
|
46
37
|
|
|
38
|
+
onMounted(() => {
|
|
39
|
+
if (userInfo.value) {
|
|
40
|
+
ruleForm.value = userInfo.value
|
|
41
|
+
}
|
|
42
|
+
})
|
|
43
|
+
|
|
47
44
|
const handleAvatarSuccess: UploadProps['onSuccess'] = (response: ApiResponse) => {
|
|
48
45
|
loading.value = false
|
|
49
|
-
if (response.code === 0) {
|
|
46
|
+
if (userInfo.value && response.code === 0) {
|
|
50
47
|
userInfo.value.avatarFileName = response.data
|
|
51
48
|
ElMessage.success({ message: '头像上传成功' })
|
|
52
49
|
}
|
|
@@ -69,28 +66,39 @@ const beforeAvatarUpload: UploadProps['beforeUpload'] = (rawFile) => {
|
|
|
69
66
|
</script>
|
|
70
67
|
|
|
71
68
|
<template>
|
|
72
|
-
<el-form ref="ruleFormRef" :model="ruleForm" :rules="rules" label-width="auto">
|
|
69
|
+
<el-form ref="ruleFormRef" :model="ruleForm" :rules="rules" label-width="auto" disabled>
|
|
73
70
|
<el-form-item label="登录账号" prop="account">
|
|
74
|
-
<el-input v-model.trim="ruleForm.account" style="width: 200px"
|
|
71
|
+
<el-input v-model.trim="ruleForm.account" style="width: 200px" />
|
|
75
72
|
</el-form-item>
|
|
76
73
|
<el-form-item label="名称" prop="name">
|
|
77
|
-
<el-input v-model.trim="ruleForm.name" style="width: 200px"
|
|
74
|
+
<el-input v-model.trim="ruleForm.name" style="width: 200px" />
|
|
78
75
|
</el-form-item>
|
|
79
76
|
<el-form-item label="工号" prop="workNo">
|
|
80
|
-
<el-input v-model.trim="ruleForm.workNo" style="width: 200px"
|
|
77
|
+
<el-input v-model.trim="ruleForm.workNo" style="width: 200px" />
|
|
81
78
|
</el-form-item>
|
|
82
79
|
<el-form-item label="职称" prop="jobTitle">
|
|
83
|
-
<el-
|
|
80
|
+
<el-select v-model="ruleForm.jobTitle" style="width: 200px">
|
|
81
|
+
<el-option
|
|
82
|
+
:label="item.label"
|
|
83
|
+
:value="item.value"
|
|
84
|
+
v-for="(item, index) in getOneDictList('jobTitle')"
|
|
85
|
+
:key="index"
|
|
86
|
+
/>
|
|
87
|
+
</el-select>
|
|
84
88
|
</el-form-item>
|
|
85
89
|
<el-form-item label="部门/班组" prop="workgroup">
|
|
86
|
-
<el-input v-model.trim="ruleForm.workgroup" style="width: 200px"
|
|
90
|
+
<el-input v-model.trim="ruleForm.workgroup" style="width: 200px" />
|
|
87
91
|
</el-form-item>
|
|
88
92
|
<el-form-item label="职位/账号权限" prop="role">
|
|
89
|
-
<el-
|
|
93
|
+
<el-select v-model="ruleForm.role" style="width: 200px">
|
|
94
|
+
<el-option
|
|
95
|
+
:label="item.label"
|
|
96
|
+
:value="item.value"
|
|
97
|
+
v-for="(item, index) in getOneDictList('role')"
|
|
98
|
+
:key="index"
|
|
99
|
+
/>
|
|
100
|
+
</el-select>
|
|
90
101
|
</el-form-item>
|
|
91
|
-
<!-- <el-form-item label="邮箱" prop="email">
|
|
92
|
-
<el-input v-model.trim="ruleForm.email" style="width: 200px" />
|
|
93
|
-
</el-form-item> -->
|
|
94
102
|
<el-form-item label="头像" prop="avatarFileName" class="uploader_item">
|
|
95
103
|
<el-upload
|
|
96
104
|
action="/api/user/avatar"
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { reactive, ref } from 'vue'
|
|
3
|
-
import {
|
|
3
|
+
import { PasswordChangeApi } from '@/api/system'
|
|
4
4
|
import { useAuthStore } from '@/stores'
|
|
5
5
|
import { handleRouter } from '@jnrs/vue-core/router'
|
|
6
|
-
import { isWeakPwd } from '
|
|
7
|
-
import type { FormInstance } from 'element-plus'
|
|
8
|
-
import type { RuleItem } from 'async-validator'
|
|
6
|
+
import { isWeakPwd } from '@jnrs/shared/validator'
|
|
7
|
+
import type { FormInstance, FormItemRule } from 'element-plus'
|
|
9
8
|
import { ElMessage } from 'element-plus'
|
|
10
|
-
import { LogoutApi } from '@/api/
|
|
9
|
+
import { LogoutApi } from '@/api/system'
|
|
11
10
|
|
|
12
11
|
const { userInfo, asyncClearAuth } = useAuthStore()
|
|
13
12
|
const loading = ref(false)
|
|
@@ -21,47 +20,41 @@ const rules = reactive({
|
|
|
21
20
|
originPassword: [{ required: true, message: '请输入', trigger: 'change' }],
|
|
22
21
|
password: [
|
|
23
22
|
{ required: true, message: '请输入', trigger: 'change' },
|
|
24
|
-
{ min: 6, max: 36, message: '密码长度为 6 - 36 个字符', trigger: 'change' },
|
|
25
23
|
{
|
|
26
|
-
validator:
|
|
27
|
-
|
|
24
|
+
validator: isWeakPwd,
|
|
25
|
+
trigger: 'change'
|
|
28
26
|
}
|
|
29
|
-
]
|
|
27
|
+
],
|
|
30
28
|
repassword: [
|
|
31
29
|
{ required: true, message: '请输入', trigger: 'change' },
|
|
32
30
|
{
|
|
33
|
-
validator: (rule:
|
|
34
|
-
if (value
|
|
35
|
-
callback(
|
|
31
|
+
validator: (rule: FormItemRule, value: string, callback: (error?: string) => void) => {
|
|
32
|
+
if (value && value !== ruleForm.value.password) {
|
|
33
|
+
callback('两次密码不一致!')
|
|
36
34
|
} else {
|
|
37
35
|
callback()
|
|
38
36
|
}
|
|
39
37
|
},
|
|
40
|
-
required: false
|
|
38
|
+
required: false,
|
|
39
|
+
trigger: 'change'
|
|
41
40
|
}
|
|
42
|
-
]
|
|
41
|
+
]
|
|
43
42
|
})
|
|
44
43
|
|
|
45
44
|
const submitForm = async (formEl: FormInstance | undefined) => {
|
|
46
45
|
if (!formEl) return
|
|
47
46
|
try {
|
|
48
47
|
const valid = await formEl.validate()
|
|
49
|
-
if (valid) {
|
|
48
|
+
if (valid && userInfo?.id) {
|
|
50
49
|
loading.value = true
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
password: ruleForm.value.
|
|
50
|
+
await PasswordChangeApi({
|
|
51
|
+
userId: userInfo.id,
|
|
52
|
+
password: ruleForm.value.password
|
|
54
53
|
})
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
})
|
|
60
|
-
ElMessage.success('密码修改成功,请重新登录系统')
|
|
61
|
-
await LogoutApi()
|
|
62
|
-
await asyncClearAuth()
|
|
63
|
-
handleRouter({ name: 'Login' }, 'replace')
|
|
64
|
-
}
|
|
54
|
+
ElMessage.success('密码修改成功,请重新登录系统')
|
|
55
|
+
await LogoutApi()
|
|
56
|
+
await asyncClearAuth()
|
|
57
|
+
handleRouter({ name: 'Login' }, 'replace')
|
|
65
58
|
}
|
|
66
59
|
} catch {
|
|
67
60
|
} finally {
|
|
@@ -100,9 +93,7 @@ const submitForm = async (formEl: FormInstance | undefined) => {
|
|
|
100
93
|
/>
|
|
101
94
|
</el-form-item>
|
|
102
95
|
<el-form-item>
|
|
103
|
-
<el-button class="form_submit" type="primary" @click="submitForm(formRef)">
|
|
104
|
-
保存修改
|
|
105
|
-
</el-button>
|
|
96
|
+
<el-button class="form_submit" type="primary" @click="submitForm(formRef)">保存修改</el-button>
|
|
106
97
|
</el-form-item>
|
|
107
98
|
</el-form>
|
|
108
99
|
</template>
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { FormInstance } from 'element-plus'
|
|
3
|
+
import { ref, nextTick } from 'vue'
|
|
4
|
+
defineOptions({
|
|
5
|
+
name: 'editDialog'
|
|
6
|
+
})
|
|
7
|
+
|
|
8
|
+
const loading = ref(false)
|
|
9
|
+
const dialogVisible = ref(false)
|
|
10
|
+
const ruleFormRef = ref<FormInstance>()
|
|
11
|
+
const ruleForm = ref({
|
|
12
|
+
id: '',
|
|
13
|
+
name: '',
|
|
14
|
+
enname: '',
|
|
15
|
+
remark: '',
|
|
16
|
+
usable: '1'
|
|
17
|
+
})
|
|
18
|
+
const rules = ref({
|
|
19
|
+
name: { required: true, message: '请输入角色名称', trigger: 'change' },
|
|
20
|
+
enname: { required: true, message: '请输入英文名称', trigger: 'change' },
|
|
21
|
+
usable: { required: true, message: '请选择是否可用', trigger: 'change' }
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
const toggleVisible = () => {
|
|
25
|
+
dialogVisible.value = !dialogVisible.value
|
|
26
|
+
nextTick(() => {
|
|
27
|
+
ruleFormRef.value?.resetFields()
|
|
28
|
+
})
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const submitForm = () => {
|
|
32
|
+
if (!ruleFormRef.value) return
|
|
33
|
+
ruleFormRef.value.validate(async (valid) => {
|
|
34
|
+
if (!valid) return
|
|
35
|
+
})
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
defineExpose({
|
|
39
|
+
toggleVisible
|
|
40
|
+
})
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<template>
|
|
44
|
+
<el-dialog
|
|
45
|
+
v-model="dialogVisible"
|
|
46
|
+
width="600"
|
|
47
|
+
:append-to-body="true"
|
|
48
|
+
:close-on-click-modal="true"
|
|
49
|
+
:close-on-press-escape="true"
|
|
50
|
+
>
|
|
51
|
+
<template #header>
|
|
52
|
+
<h3>{{ ruleForm.id ? '修改' : '添加' }}角色</h3>
|
|
53
|
+
</template>
|
|
54
|
+
<el-form
|
|
55
|
+
ref="ruleFormRef"
|
|
56
|
+
:model="ruleForm"
|
|
57
|
+
:rules="rules"
|
|
58
|
+
label-width="auto"
|
|
59
|
+
v-loading="loading"
|
|
60
|
+
style="width: 80%; margin: 0 auto"
|
|
61
|
+
>
|
|
62
|
+
<el-form-item prop="id" v-show="false">
|
|
63
|
+
<el-input v-model="ruleForm.id" />
|
|
64
|
+
</el-form-item>
|
|
65
|
+
<el-form-item label="角色名称" prop="name">
|
|
66
|
+
<el-input v-model="ruleForm.name" maxlength="20" />
|
|
67
|
+
</el-form-item>
|
|
68
|
+
<el-form-item label="英文名称" prop="enname">
|
|
69
|
+
<el-input v-model="ruleForm.enname" maxlength="20" />
|
|
70
|
+
</el-form-item>
|
|
71
|
+
<el-form-item label="说明" prop="remark">
|
|
72
|
+
<el-input v-model="ruleForm.remark" maxlength="200" type="textarea" :rows="5" />
|
|
73
|
+
</el-form-item>
|
|
74
|
+
<el-form-item label="是否可用" prop="usable">
|
|
75
|
+
<el-switch
|
|
76
|
+
v-model="ruleForm.usable"
|
|
77
|
+
inline-prompt
|
|
78
|
+
active-text="是"
|
|
79
|
+
inactive-text="否"
|
|
80
|
+
:active-value="true"
|
|
81
|
+
:inactive-value="false"
|
|
82
|
+
width="50"
|
|
83
|
+
style="--el-switch-on-color: #67c23a; --el-switch-off-color: #f56c6c"
|
|
84
|
+
/>
|
|
85
|
+
</el-form-item>
|
|
86
|
+
</el-form>
|
|
87
|
+
<template #footer>
|
|
88
|
+
<div class="dialog-footer">
|
|
89
|
+
<el-button @click="toggleVisible()" :loading="loading">取消</el-button>
|
|
90
|
+
<el-button type="primary" @click="submitForm()" :loading="loading">提交</el-button>
|
|
91
|
+
</div>
|
|
92
|
+
</template>
|
|
93
|
+
</el-dialog>
|
|
94
|
+
</template>
|
|
@@ -1,9 +1,36 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { ref } from 'vue'
|
|
3
|
+
import { useAuthStore } from '@/stores'
|
|
4
|
+
|
|
5
|
+
const { dict } = useAuthStore()
|
|
6
|
+
const loading = ref(false)
|
|
7
|
+
const tableData = ref(dict?.role)
|
|
3
8
|
</script>
|
|
4
9
|
|
|
5
10
|
<template>
|
|
6
|
-
<div>
|
|
11
|
+
<div class="main">
|
|
12
|
+
<el-card shadow="never">
|
|
13
|
+
<template #header>
|
|
14
|
+
<div class="card_header">
|
|
15
|
+
<h3>角色管理</h3>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
<el-table
|
|
19
|
+
class="el_table_role"
|
|
20
|
+
header-cell-class-name="tableData_header_cell"
|
|
21
|
+
:data="tableData"
|
|
22
|
+
scrollbar-always-on
|
|
23
|
+
border
|
|
24
|
+
v-loading="loading"
|
|
25
|
+
>
|
|
26
|
+
<el-table-column prop="label" label="角色名称" align="center" />
|
|
27
|
+
<!-- <el-table-column prop="codeValue" label="系统权限" align="center" /> -->
|
|
28
|
+
<el-table-column prop="value" label="值" align="center">
|
|
29
|
+
<template #default="scope">
|
|
30
|
+
{{ scope.row.value + '[' + typeof scope.row.value + ']' }}
|
|
31
|
+
</template>
|
|
32
|
+
</el-table-column>
|
|
33
|
+
</el-table>
|
|
34
|
+
</el-card>
|
|
35
|
+
</div>
|
|
7
36
|
</template>
|
|
8
|
-
|
|
9
|
-
<style lang="scss" scoped></style>
|
|
@@ -6,7 +6,7 @@ import Components from 'unplugin-vue-components/vite'
|
|
|
6
6
|
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
|
|
7
7
|
import compression from 'vite-plugin-compression'
|
|
8
8
|
import { viteMockServe } from 'vite-plugin-mock'
|
|
9
|
-
|
|
9
|
+
import vueDevTools from 'vite-plugin-vue-devtools'
|
|
10
10
|
|
|
11
11
|
const path = (url: string) => fileURLToPath(new URL(url, import.meta.url))
|
|
12
12
|
const config = loadEnv('development', './')
|
|
@@ -15,11 +15,12 @@ const isMock = config.VITE_USE_MOCK === 'true'
|
|
|
15
15
|
export default defineConfig({
|
|
16
16
|
plugins: [
|
|
17
17
|
vue(),
|
|
18
|
-
|
|
18
|
+
vueDevTools(),
|
|
19
19
|
AutoImport({
|
|
20
20
|
resolvers: [ElementPlusResolver()]
|
|
21
21
|
}),
|
|
22
22
|
Components({
|
|
23
|
+
dirs: [], // 禁用本地组件自动导入
|
|
23
24
|
resolvers: [ElementPlusResolver()]
|
|
24
25
|
}),
|
|
25
26
|
compression({
|
|
@@ -32,8 +33,9 @@ export default defineConfig({
|
|
|
32
33
|
}),
|
|
33
34
|
viteMockServe({
|
|
34
35
|
mockPath: 'viteMockServe', // mock 文件目录
|
|
36
|
+
watchFiles: true, // mock 文件热更新
|
|
35
37
|
enable: isMock, // 是否开启
|
|
36
|
-
logger: isMock //
|
|
38
|
+
logger: isMock // 是否在终端显示请求日志
|
|
37
39
|
})
|
|
38
40
|
],
|
|
39
41
|
resolve: {
|
|
@@ -49,7 +51,7 @@ export default defineConfig({
|
|
|
49
51
|
'/api': {
|
|
50
52
|
target: 'http://' + config.VITE_BASE_URL,
|
|
51
53
|
changeOrigin: true,
|
|
52
|
-
rewrite: (path) => path.replace(/^\/api/, '')
|
|
54
|
+
rewrite: (path: string) => path.replace(/^\/api/, '')
|
|
53
55
|
},
|
|
54
56
|
'/ws': {
|
|
55
57
|
target: 'ws://' + config.VITE_BASE_URL,
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": [
|
|
3
|
+
{
|
|
4
|
+
"id": 7,
|
|
5
|
+
"value": 0,
|
|
6
|
+
"label": "未审批",
|
|
7
|
+
"displayColor": "#FEA822",
|
|
8
|
+
"sequence": 1
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"id": 8,
|
|
12
|
+
"value": 1,
|
|
13
|
+
"label": "未通过",
|
|
14
|
+
"displayColor": "#E43634",
|
|
15
|
+
"sequence": 2
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"id": 9,
|
|
19
|
+
"value": 2,
|
|
20
|
+
"label": "已通过",
|
|
21
|
+
"displayColor": "#65DC79",
|
|
22
|
+
"sequence": 3
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"code": 0,
|
|
26
|
+
"msg": "操作成功"
|
|
27
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": [
|
|
3
|
+
{
|
|
4
|
+
"id": 1,
|
|
5
|
+
"dictName": "defectiveWorkHourStatus",
|
|
6
|
+
"describe": null
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"id": 2,
|
|
10
|
+
"dictName": "factoryManagerDefectiveWorkHourReviewStatus",
|
|
11
|
+
"describe": null
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"id": 3,
|
|
15
|
+
"dictName": "productionDepartmentDefectiveWorkHourReviewStatus",
|
|
16
|
+
"describe": null
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"id": 4,
|
|
20
|
+
"dictName": "workHourType",
|
|
21
|
+
"describe": null
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"id": 5,
|
|
25
|
+
"dictName": "workHourStatue",
|
|
26
|
+
"describe": null
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"id": 6,
|
|
30
|
+
"dictName": "assignmentStatus",
|
|
31
|
+
"describe": null
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"id": 7,
|
|
35
|
+
"dictName": "planExecutionStatus",
|
|
36
|
+
"describe": null
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"id": 8,
|
|
40
|
+
"dictName": "jobTitle",
|
|
41
|
+
"describe": null
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"id": 9,
|
|
45
|
+
"dictName": "userLogType",
|
|
46
|
+
"describe": null
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"id": 10,
|
|
50
|
+
"dictName": "rectificationNoticeStatus",
|
|
51
|
+
"describe": null
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"id": 11,
|
|
55
|
+
"dictName": "attendanceStatus",
|
|
56
|
+
"describe": null
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"id": 12,
|
|
60
|
+
"dictName": "weekday",
|
|
61
|
+
"describe": null
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"id": 13,
|
|
65
|
+
"dictName": "factoryManagerWorkHourReduceApplicationReviewStatus",
|
|
66
|
+
"describe": null
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"id": 14,
|
|
70
|
+
"dictName": "productionDepartmentWorkHourReduceApplicationReviewStatus",
|
|
71
|
+
"describe": null
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"id": 15,
|
|
75
|
+
"dictName": "role",
|
|
76
|
+
"describe": null
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"id": 16,
|
|
80
|
+
"dictName": "attendanceRequestStatus",
|
|
81
|
+
"describe": null
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"id": 17,
|
|
85
|
+
"dictName": "abilityCoefficientFilter",
|
|
86
|
+
"describe": null
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"id": 18,
|
|
90
|
+
"dictName": "groupRemainWorkHourFilterType",
|
|
91
|
+
"describe": null
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"id": 19,
|
|
95
|
+
"dictName": "workHourReduceApplicationStatus",
|
|
96
|
+
"describe": null
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"id": 20,
|
|
100
|
+
"dictName": "workHourModifyApplicationReviewStatus",
|
|
101
|
+
"describe": null
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"id": 21,
|
|
105
|
+
"dictName": "firstThenReviewStatus",
|
|
106
|
+
"describe": null
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"id": 22,
|
|
110
|
+
"dictName": "planExecutionDateFilter",
|
|
111
|
+
"describe": null
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"id": 23,
|
|
115
|
+
"dictName": "overtimeWorkHourFilter",
|
|
116
|
+
"describe": null
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"id": 24,
|
|
120
|
+
"dictName": "statisticWorkHourUserDataOrderByType",
|
|
121
|
+
"describe": null
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"id": 25,
|
|
125
|
+
"dictName": "jobStatus",
|
|
126
|
+
"describe": null
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"id": 26,
|
|
130
|
+
"dictName": "reviewType",
|
|
131
|
+
"describe": null
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"id": 27,
|
|
135
|
+
"dictName": "rectificationNoticeTaskStatus",
|
|
136
|
+
"describe": null
|
|
137
|
+
}
|
|
138
|
+
],
|
|
139
|
+
"code": 0,
|
|
140
|
+
"msg": "操作成功"
|
|
141
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const res_fail = {
|
|
2
|
+
code: 1,
|
|
3
|
+
msg: '操作失败'
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export default [
|
|
7
|
+
// 权限不足
|
|
8
|
+
{
|
|
9
|
+
url: '/mock/auth/no',
|
|
10
|
+
method: 'post',
|
|
11
|
+
response: () => {
|
|
12
|
+
return {
|
|
13
|
+
code: 3,
|
|
14
|
+
msg: '暂无权限'
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
// 操作失败
|
|
19
|
+
{
|
|
20
|
+
url: '/mock/auth/fail',
|
|
21
|
+
method: 'post',
|
|
22
|
+
response: () => {
|
|
23
|
+
return res_fail
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
]
|
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import successMock from './success'
|
|
2
|
+
import failMock from './fail'
|
|
3
|
+
import loginRes from './loginRes.json'
|
|
4
|
+
import dictRes from './dictRes.json'
|
|
5
|
+
import dictItemRes from './dictItemRes.json'
|
|
2
6
|
import menuRes from '../public/system/menu.json'
|
|
3
7
|
|
|
4
|
-
const res_success = {
|
|
5
|
-
code: 0,
|
|
6
|
-
msg: '操作成功'
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
const res_fail = {
|
|
10
|
-
code: 1,
|
|
11
|
-
msg: '操作失败'
|
|
12
|
-
}
|
|
13
|
-
|
|
14
8
|
export default [
|
|
9
|
+
...successMock,
|
|
10
|
+
...failMock,
|
|
15
11
|
// 获取菜单
|
|
16
12
|
{
|
|
17
13
|
url: '/mock/menu',
|
|
@@ -20,7 +16,7 @@ export default [
|
|
|
20
16
|
return menuRes
|
|
21
17
|
}
|
|
22
18
|
},
|
|
23
|
-
//
|
|
19
|
+
// 登录
|
|
24
20
|
{
|
|
25
21
|
url: '/mock/api/auth/login',
|
|
26
22
|
method: 'post',
|
|
@@ -28,31 +24,28 @@ export default [
|
|
|
28
24
|
return loginRes
|
|
29
25
|
}
|
|
30
26
|
},
|
|
31
|
-
//
|
|
27
|
+
// 获取个人信息
|
|
32
28
|
{
|
|
33
|
-
url: '/mock/api/auth/
|
|
29
|
+
url: '/mock/api/auth/user-info',
|
|
34
30
|
method: 'get',
|
|
35
31
|
response: () => {
|
|
36
|
-
return
|
|
32
|
+
return loginRes
|
|
37
33
|
}
|
|
38
34
|
},
|
|
39
|
-
//
|
|
35
|
+
// 获取字典
|
|
40
36
|
{
|
|
41
|
-
url: '/mock/api/
|
|
37
|
+
url: '/mock/api/dict-manager',
|
|
42
38
|
method: 'get',
|
|
43
39
|
response: () => {
|
|
44
|
-
return
|
|
40
|
+
return dictRes
|
|
45
41
|
}
|
|
46
42
|
},
|
|
47
|
-
//
|
|
43
|
+
// 获取单个字典
|
|
48
44
|
{
|
|
49
|
-
url:
|
|
50
|
-
method: '
|
|
45
|
+
url: /\/mock\/api\/dict-manager\/detail\/\d+/,
|
|
46
|
+
method: 'get',
|
|
51
47
|
response: () => {
|
|
52
|
-
return
|
|
53
|
-
code: 3,
|
|
54
|
-
msg: '暂无权限'
|
|
55
|
-
}
|
|
48
|
+
return dictItemRes
|
|
56
49
|
}
|
|
57
50
|
}
|
|
58
51
|
]
|