hlq-cli 1.0.0
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/README.md +18 -0
- package/bin/index.js +16 -0
- package/lib/aesCreate.js +11 -0
- package/lib/axiosCreate.js +11 -0
- package/lib/create.js +172 -0
- package/lib/echartCreate.js +12 -0
- package/lib/jwtDecodeCreate.js +16 -0
- package/lib/rsaCreate.js +11 -0
- package/lib/stateCreate.js +34 -0
- package/lib/websocketCreate.js +16 -0
- package/package.json +21 -0
- package/templates/.env +1 -0
- package/templates/.env.dev +2 -0
- package/templates/.env.pro +2 -0
- package/templates/index.html +15 -0
- package/templates/package-lock.json +4058 -0
- package/templates/package.json +31 -0
- package/templates/public/config.js +1 -0
- package/templates/public/font/iconfont.css +579 -0
- package/templates/public/font/iconfont.js +1 -0
- package/templates/public/font/iconfont.ttf +0 -0
- package/templates/public/font/iconfont.woff +0 -0
- package/templates/public/font/iconfont.woff2 +0 -0
- package/templates/src/App.vue +35 -0
- package/templates/src/components/chart/barChart.vue +103 -0
- package/templates/src/components/chart/color.ts +43 -0
- package/templates/src/components/chart/lineChart.vue +114 -0
- package/templates/src/components/chart/mapChart.vue +135 -0
- package/templates/src/components/chart/mixedChart.vue +148 -0
- package/templates/src/components/chart/pieChart.vue +104 -0
- package/templates/src/components/chart/radarChart.vue +112 -0
- package/templates/src/components/chart/scatterChart.vue +144 -0
- package/templates/src/components/chart/sunburstChart.vue +183 -0
- package/templates/src/components/descript/index.vue +45 -0
- package/templates/src/components/dialog/index.vue +54 -0
- package/templates/src/components/drawer/index.vue +53 -0
- package/templates/src/components/form/component/cascader.vue +65 -0
- package/templates/src/components/form/component/checkbox.vue +31 -0
- package/templates/src/components/form/component/datePicker.vue +39 -0
- package/templates/src/components/form/component/dateRange.vue +36 -0
- package/templates/src/components/form/component/datetimePicker.vue +25 -0
- package/templates/src/components/form/component/fileUpload.vue +80 -0
- package/templates/src/components/form/component/formFun.ts +132 -0
- package/templates/src/components/form/component/imageUpload.vue +92 -0
- package/templates/src/components/form/component/input.vue +41 -0
- package/templates/src/components/form/component/location.vue +79 -0
- package/templates/src/components/form/component/radio.vue +31 -0
- package/templates/src/components/form/component/select.vue +66 -0
- package/templates/src/components/form/component/textarea.vue +26 -0
- package/templates/src/components/form/component/timePicker.vue +28 -0
- package/templates/src/components/form/component/upload.ts +20 -0
- package/templates/src/components/form/formInterface.ts +115 -0
- package/templates/src/components/form/index.vue +193 -0
- package/templates/src/components/form/item.vue +323 -0
- package/templates/src/components/groupForm/index.vue +91 -0
- package/templates/src/components/icon/index.vue +29 -0
- package/templates/src/components/layout/header.vue +238 -0
- package/templates/src/components/layout/index.vue +167 -0
- package/templates/src/components/layout/menu.vue +130 -0
- package/templates/src/components/layout/sideBarItem.vue +49 -0
- package/templates/src/components/searchBox/height.ts +9 -0
- package/templates/src/components/searchBox/index.vue +265 -0
- package/templates/src/components/table/index.vue +371 -0
- package/templates/src/components/table/table.ts +23 -0
- package/templates/src/components/tree/index.vue +222 -0
- package/templates/src/components/tree/lazyTree.vue +136 -0
- package/templates/src/data.d.ts +4 -0
- package/templates/src/main.ts +18 -0
- package/templates/src/router/index.ts +60 -0
- package/templates/src/store/menuInterface.ts +10 -0
- package/templates/src/store/permission.ts +59 -0
- package/templates/src/store/user.ts +24 -0
- package/templates/src/utils/alioss/index.ts +0 -0
- package/templates/src/utils/axios/http.ts +99 -0
- package/templates/src/utils/axios/index.ts +112 -0
- package/templates/src/utils/axios/service.ts +8 -0
- package/templates/src/utils/crypto/index.ts +28 -0
- package/templates/src/utils/rsa/index.ts +18 -0
- package/templates/src/utils/token/index.ts +6 -0
- package/templates/src/utils/tree/index.ts +74 -0
- package/templates/src/utils/websocket/index.ts +136 -0
- package/templates/src/views/login/index.vue +248 -0
- package/templates/src/views/templete/table.vue +122 -0
- package/templates/src/views/templete/tableConfig.ts +153 -0
- package/templates/tsconfig.app.json +19 -0
- package/templates/tsconfig.json +7 -0
- package/templates/tsconfig.node.json +23 -0
- package/templates/vite.config.ts +34 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="menu wh100 cardContent">
|
|
3
|
+
<Table
|
|
4
|
+
:columns="columns"
|
|
5
|
+
:search-config="searchConfig"
|
|
6
|
+
:autoSearch="false"
|
|
7
|
+
:page-show="true"
|
|
8
|
+
:pagination="pagination"
|
|
9
|
+
rowKey="menuCode"
|
|
10
|
+
:tableData="tableData"
|
|
11
|
+
:extra-list="extraList"
|
|
12
|
+
@extraClick="extraClick"
|
|
13
|
+
@search="search"
|
|
14
|
+
@reset="search"
|
|
15
|
+
@currentChange="currentChange"
|
|
16
|
+
@size-change="sizeChange"
|
|
17
|
+
ref="tableRef"
|
|
18
|
+
>
|
|
19
|
+
<template v-slot:option="{ row }">
|
|
20
|
+
<el-button type="primary" plain size="small" @click="edit(row)">
|
|
21
|
+
编辑
|
|
22
|
+
</el-button>
|
|
23
|
+
</template>
|
|
24
|
+
<el-popconfirm title="确定要删除吗?">
|
|
25
|
+
<template #reference>
|
|
26
|
+
<el-button type="danger" size="small"> 删除 </el-button>
|
|
27
|
+
</template>
|
|
28
|
+
</el-popconfirm>
|
|
29
|
+
</Table>
|
|
30
|
+
<Dialog
|
|
31
|
+
title="新增"
|
|
32
|
+
v-model="state.addFormVisible"
|
|
33
|
+
:destroy="true"
|
|
34
|
+
@submit="submit"
|
|
35
|
+
>
|
|
36
|
+
<Form
|
|
37
|
+
ref="addFormRef"
|
|
38
|
+
:form-item-config="addFormConfig"
|
|
39
|
+
:form-data="state.addFormData"
|
|
40
|
+
></Form>
|
|
41
|
+
</Dialog>
|
|
42
|
+
</div>
|
|
43
|
+
</template>
|
|
44
|
+
<script lang="ts" setup>
|
|
45
|
+
import Table from '@/components/table/index.vue'
|
|
46
|
+
import Dialog from '@/components/dialog/index.vue'
|
|
47
|
+
import Form from '@/components/form/index.vue'
|
|
48
|
+
import { onMounted, reactive, ref } from 'vue'
|
|
49
|
+
import { columns, searchConfig, extraList, addFormConfig } from './tableConfig'
|
|
50
|
+
defineOptions({
|
|
51
|
+
name: 'templateTable',
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
const tableData = ref<Data[]>([])
|
|
55
|
+
const state = reactive({
|
|
56
|
+
formVisible: false,
|
|
57
|
+
isAdd: true,
|
|
58
|
+
formData: {},
|
|
59
|
+
})
|
|
60
|
+
const pagination = ref({
|
|
61
|
+
total: 0,
|
|
62
|
+
currentPage: 1,
|
|
63
|
+
pageSize: 10,
|
|
64
|
+
})
|
|
65
|
+
const editFormRef = ref()
|
|
66
|
+
// 编辑按钮
|
|
67
|
+
const edit = (data: Data) => {
|
|
68
|
+
const obj = { ...data }
|
|
69
|
+
state.isAdd = false
|
|
70
|
+
state.formData = obj
|
|
71
|
+
state.formVisible = true
|
|
72
|
+
}
|
|
73
|
+
const search = (data?: Data) => {
|
|
74
|
+
pagination.value.currentPage = 1
|
|
75
|
+
getData(data)
|
|
76
|
+
}
|
|
77
|
+
// 新增按钮
|
|
78
|
+
const extraClick = (type: string) => {
|
|
79
|
+
if (type === 'add') {
|
|
80
|
+
state.isAdd = true
|
|
81
|
+
state.formData = {}
|
|
82
|
+
state.formVisible = true
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
// 提交
|
|
86
|
+
const submit = async () => {
|
|
87
|
+
const valid = await editFormRef.value.valid()
|
|
88
|
+
if (!valid) return
|
|
89
|
+
const formData = editFormRef.value.getFormData()
|
|
90
|
+
state.editFormVisible = false
|
|
91
|
+
}
|
|
92
|
+
const sizeChange = (size: number) => {
|
|
93
|
+
pagination.value.currentPage = 1
|
|
94
|
+
pagination.value.pageSize = size
|
|
95
|
+
getData()
|
|
96
|
+
}
|
|
97
|
+
const currentChange = (num: number) => {
|
|
98
|
+
pagination.value.currentPage = num
|
|
99
|
+
getData()
|
|
100
|
+
}
|
|
101
|
+
// 获取数据
|
|
102
|
+
const getData = (data?: Data) => {
|
|
103
|
+
tableData.value = [
|
|
104
|
+
{
|
|
105
|
+
name: '张三',
|
|
106
|
+
username: 'zhangsan',
|
|
107
|
+
phoneNum: '13800000000',
|
|
108
|
+
roleNames: '管理员',
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: '李四',
|
|
112
|
+
username: 'lisi',
|
|
113
|
+
phoneNum: '13800000001',
|
|
114
|
+
roleNames: '普通用户',
|
|
115
|
+
},
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
onMounted(() => {
|
|
119
|
+
getData()
|
|
120
|
+
})
|
|
121
|
+
</script>
|
|
122
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
export const columns = [
|
|
2
|
+
{
|
|
3
|
+
prop: 'username',
|
|
4
|
+
label: '账号',
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
prop: 'phoneNum',
|
|
8
|
+
label: '手机号',
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
prop: 'name',
|
|
12
|
+
label: '姓名',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
prop: 'roleNames',
|
|
16
|
+
label: '角色',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
prop: 'createTime',
|
|
20
|
+
label: '创建时间',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
prop: 'state',
|
|
24
|
+
label: '账号状态',
|
|
25
|
+
formatter: (data: any) => (data.state === 1 ? '未冻结' : '已冻结'),
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
prop: 'option',
|
|
29
|
+
label: '操作',
|
|
30
|
+
slot: 'option',
|
|
31
|
+
width: 300,
|
|
32
|
+
},
|
|
33
|
+
]
|
|
34
|
+
export const searchConfig: SearchItemConfig[] = [
|
|
35
|
+
{
|
|
36
|
+
type: 'input',
|
|
37
|
+
label: '账号',
|
|
38
|
+
key: 'username',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
type: 'input',
|
|
42
|
+
label: '手机号',
|
|
43
|
+
key: 'phoneNum',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
type: 'input',
|
|
47
|
+
label: '姓名',
|
|
48
|
+
key: 'name',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
type: 'select',
|
|
52
|
+
label: '角色',
|
|
53
|
+
key: 'roleId',
|
|
54
|
+
options: [],
|
|
55
|
+
},
|
|
56
|
+
]
|
|
57
|
+
export const extraList = [
|
|
58
|
+
{ label: '创建用户', code: 'add', value: 'add' },
|
|
59
|
+
{ label: '用户加载', code: 'load', value: 'load' },
|
|
60
|
+
]
|
|
61
|
+
export const addFormConfig: FormItemConfig[] = [
|
|
62
|
+
{
|
|
63
|
+
type: 'input',
|
|
64
|
+
label: '姓名',
|
|
65
|
+
key: 'name',
|
|
66
|
+
rules: [{ required: true, message: '请输入姓名', trigger: 'blur' }],
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
type: 'input',
|
|
70
|
+
label: '账号',
|
|
71
|
+
key: 'username',
|
|
72
|
+
rules: [{ required: true, message: '请输入账号', trigger: 'blur' }],
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
type: 'input',
|
|
76
|
+
label: '手机号',
|
|
77
|
+
key: 'phoneNum',
|
|
78
|
+
rules: [{ required: true, message: '请输入手机号', trigger: 'blur' }],
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
type: 'password',
|
|
82
|
+
label: '登录密码',
|
|
83
|
+
key: 'password',
|
|
84
|
+
rules: [{ required: true, message: '请输入登录密码', trigger: 'blur' }],
|
|
85
|
+
describe: `<div>1、密码长度8-20个字符</div>
|
|
86
|
+
<div>2、密码不能包含空格</div>
|
|
87
|
+
<div>3、密码由字母开头且必须包含大写字母、小写字母、数字,支持特殊字符
|
|
88
|
+
</div>`,
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
type: 'password',
|
|
92
|
+
label: '确认密码',
|
|
93
|
+
key: 'confirmPassword',
|
|
94
|
+
rules: [{ required: true, message: '请输入确认密码', trigger: 'blur' }],
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
type: 'select',
|
|
98
|
+
label: '选择角色',
|
|
99
|
+
key: 'roleIdList',
|
|
100
|
+
isMore: true,
|
|
101
|
+
rules: [{ required: true, message: '请输入角色', trigger: 'blur' }],
|
|
102
|
+
options: [],
|
|
103
|
+
},
|
|
104
|
+
]
|
|
105
|
+
export const editFormConfig: FormItemConfig[] = [
|
|
106
|
+
{
|
|
107
|
+
type: 'input',
|
|
108
|
+
label: '账号',
|
|
109
|
+
key: 'username',
|
|
110
|
+
disabled: true,
|
|
111
|
+
rules: [{ required: true, message: '请输入账号', trigger: 'blur' }],
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
type: 'input',
|
|
115
|
+
label: '手机号',
|
|
116
|
+
key: 'phoneNum',
|
|
117
|
+
disabled: true,
|
|
118
|
+
rules: [{ required: true, message: '请输入手机号', trigger: 'blur' }],
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
type: 'select',
|
|
122
|
+
label: '选择角色',
|
|
123
|
+
key: 'roleIdList',
|
|
124
|
+
isMore: true,
|
|
125
|
+
rules: [{ required: true, message: '请输入角色', trigger: 'blur' }],
|
|
126
|
+
options: [],
|
|
127
|
+
},
|
|
128
|
+
]
|
|
129
|
+
export const resetFormConfig: FormItemConfig[] = [
|
|
130
|
+
{
|
|
131
|
+
type: 'password',
|
|
132
|
+
label: '新密码',
|
|
133
|
+
key: 'newPassword',
|
|
134
|
+
rules: [{ required: true, message: '请输入新密码', trigger: 'blur' }],
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
type: 'password',
|
|
138
|
+
label: '确认新密码',
|
|
139
|
+
key: 'confirmPassword',
|
|
140
|
+
rules: [{ required: true, message: '请输入确认新密码', trigger: 'blur' }],
|
|
141
|
+
},
|
|
142
|
+
]
|
|
143
|
+
|
|
144
|
+
export enum apiUrl {
|
|
145
|
+
getList = '/api/sysUser/query',
|
|
146
|
+
getRoleList = '/api/sysRole/query',
|
|
147
|
+
getDetail = '/api/sysUser/getDetails',
|
|
148
|
+
add = '/api/sysUser/create',
|
|
149
|
+
edit = '/api/sysUser/updateUserRole',
|
|
150
|
+
reset = '/api/sysUser/update',
|
|
151
|
+
changeStatus = '/api/sysUser/update',
|
|
152
|
+
syncUserData = '/api/mdb/collect/syncUserData',
|
|
153
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "@vue/tsconfig/tsconfig.dom.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
5
|
+
"types": ["vite/client"],
|
|
6
|
+
/* Linting */
|
|
7
|
+
"strict": true,
|
|
8
|
+
"noUnusedLocals": false,
|
|
9
|
+
"noUnusedParameters": true,
|
|
10
|
+
"noFallthroughCasesInSwitch": true,
|
|
11
|
+
"noUncheckedSideEffectImports": true,
|
|
12
|
+
"baseUrl": "./",
|
|
13
|
+
"paths": {
|
|
14
|
+
"@/*": ["./src/*"]
|
|
15
|
+
},
|
|
16
|
+
"ignoreDeprecations": "6.0"
|
|
17
|
+
},
|
|
18
|
+
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"]
|
|
19
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
4
|
+
"target": "ES2022",
|
|
5
|
+
"lib": ["ES2023"],
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
/* Bundler mode */
|
|
9
|
+
"moduleResolution": "bundler",
|
|
10
|
+
"allowImportingTsExtensions": true,
|
|
11
|
+
"isolatedModules": true,
|
|
12
|
+
"moduleDetection": "force",
|
|
13
|
+
"noEmit": true,
|
|
14
|
+
|
|
15
|
+
/* Linting */
|
|
16
|
+
"strict": true,
|
|
17
|
+
"noUnusedLocals": true,
|
|
18
|
+
"noUnusedParameters": true,
|
|
19
|
+
"noFallthroughCasesInSwitch": true,
|
|
20
|
+
"noUncheckedSideEffectImports": true
|
|
21
|
+
},
|
|
22
|
+
"include": ["vite.config.ts"]
|
|
23
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { defineConfig } from 'vite'
|
|
2
|
+
import { fileURLToPath, URL } from 'url'
|
|
3
|
+
import vue from '@vitejs/plugin-vue'
|
|
4
|
+
|
|
5
|
+
// https://vite.dev/config/
|
|
6
|
+
export default defineConfig({
|
|
7
|
+
plugins: [vue()],
|
|
8
|
+
build: {
|
|
9
|
+
minify: 'terser',
|
|
10
|
+
terserOptions: {
|
|
11
|
+
compress: {
|
|
12
|
+
//生产环境时移除console
|
|
13
|
+
drop_console: true,
|
|
14
|
+
drop_debugger: true,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
resolve: {
|
|
19
|
+
alias: {
|
|
20
|
+
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
server: {
|
|
24
|
+
port: 8005,
|
|
25
|
+
host: '0.0.0.0',
|
|
26
|
+
proxy: {
|
|
27
|
+
'/api': {
|
|
28
|
+
target: 'http://127.0.0.1:19191',
|
|
29
|
+
changeOrigin: true,
|
|
30
|
+
// rewrite: (path) => path.replace(/^\/api/, ""),
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
})
|