mirror of
https://github.com/nsnail/NetAdmin.git
synced 2025-07-05 01:58:15 +08:00
feat: ✨ 分组统计功能
This commit is contained in:
@ -27,6 +27,17 @@ export default {
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* 平面查询接口
|
||||
*/
|
||||
plainQuery: {
|
||||
url: `${config.API_URL}/api/sys/api/plain.query`,
|
||||
name: `平面查询接口`,
|
||||
post: async function (data = {}, config = {}) {
|
||||
return await http.post(this.url, data, config)
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* 查询接口
|
||||
*/
|
||||
|
@ -27,6 +27,17 @@ export default {
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* 配置分组计数
|
||||
*/
|
||||
countBy: {
|
||||
url: `${config.API_URL}/api/sys/config/count.by`,
|
||||
name: `配置分组计数`,
|
||||
post: async function (data = {}, config = {}) {
|
||||
return await http.post(this.url, data, config)
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* 创建配置
|
||||
*/
|
||||
|
@ -27,6 +27,17 @@ export default {
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* 部门分组计数
|
||||
*/
|
||||
countBy: {
|
||||
url: `${config.API_URL}/api/sys/dept/count.by`,
|
||||
name: `部门分组计数`,
|
||||
post: async function (data = {}, config = {}) {
|
||||
return await http.post(this.url, data, config)
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* 创建部门
|
||||
*/
|
||||
|
@ -27,6 +27,17 @@ export default {
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* 字典内容分组计数
|
||||
*/
|
||||
contentCountBy: {
|
||||
url: `${config.API_URL}/api/sys/dic/content.count.by`,
|
||||
name: `字典内容分组计数`,
|
||||
post: async function (data = {}, config = {}) {
|
||||
return await http.post(this.url, data, config)
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* 创建字典目录
|
||||
*/
|
||||
|
@ -27,6 +27,17 @@ export default {
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* 文档内容分组计数
|
||||
*/
|
||||
contentCountBy: {
|
||||
url: `${config.API_URL}/api/sys/doc/content.count.by`,
|
||||
name: `文档内容分组计数`,
|
||||
post: async function (data = {}, config = {}) {
|
||||
return await http.post(this.url, data, config)
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* 创建文档分类
|
||||
*/
|
||||
|
@ -27,6 +27,17 @@ export default {
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* 计划作业分组计数
|
||||
*/
|
||||
countBy: {
|
||||
url: `${config.API_URL}/api/sys/job/count.by`,
|
||||
name: `计划作业分组计数`,
|
||||
post: async function (data = {}, config = {}) {
|
||||
return await http.post(this.url, data, config)
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* 作业记录计数
|
||||
*/
|
||||
@ -192,6 +203,17 @@ export default {
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* 作业记录分组计数
|
||||
*/
|
||||
recordCountBy: {
|
||||
url: `${config.API_URL}/api/sys/job/record.count.by`,
|
||||
name: `作业记录分组计数`,
|
||||
post: async function (data = {}, config = {}) {
|
||||
return await http.post(this.url, data, config)
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* 启用/禁用作业
|
||||
*/
|
||||
|
@ -27,6 +27,17 @@ export default {
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* 登录日志分组计数
|
||||
*/
|
||||
countBy: {
|
||||
url: `${config.API_URL}/api/sys/login.log/count.by`,
|
||||
name: `登录日志分组计数`,
|
||||
post: async function (data = {}, config = {}) {
|
||||
return await http.post(this.url, data, config)
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* 创建登录日志
|
||||
*/
|
||||
|
@ -16,6 +16,17 @@ export default {
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* 请求日志分组计数
|
||||
*/
|
||||
countBy: {
|
||||
url: `${config.API_URL}/api/sys/request.log/count.by`,
|
||||
name: `请求日志分组计数`,
|
||||
post: async function (data = {}, config = {}) {
|
||||
return await http.post(this.url, data, config)
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* 导出请求日志
|
||||
*/
|
||||
|
@ -27,6 +27,17 @@ export default {
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* 角色分组计数
|
||||
*/
|
||||
countBy: {
|
||||
url: `${config.API_URL}/api/sys/role/count.by`,
|
||||
name: `角色分组计数`,
|
||||
post: async function (data = {}, config = {}) {
|
||||
return await http.post(this.url, data, config)
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* 创建角色
|
||||
*/
|
||||
|
@ -27,6 +27,17 @@ export default {
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* 站内信分组计数
|
||||
*/
|
||||
countBy: {
|
||||
url: `${config.API_URL}/api/sys/site.msg/count.by`,
|
||||
name: `站内信分组计数`,
|
||||
post: async function (data = {}, config = {}) {
|
||||
return await http.post(this.url, data, config)
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* 创建站内信
|
||||
*/
|
||||
|
@ -38,6 +38,17 @@ export default {
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户分组计数
|
||||
*/
|
||||
countBy: {
|
||||
url: `${config.API_URL}/api/sys/user/count.by`,
|
||||
name: `用户分组计数`,
|
||||
post: async function (data = {}, config = {}) {
|
||||
return await http.post(this.url, data, config)
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* 创建用户
|
||||
*/
|
||||
|
7
src/frontend/admin/src/assets/icons/Country.vue
Normal file
7
src/frontend/admin/src/assets/icons/Country.vue
Normal file
@ -0,0 +1,7 @@
|
||||
<template>
|
||||
<svg class="icon" height="512" p-id="4274" t="1733403909419" version="1.1" viewBox="0 0 1024 1024" width="512" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M1021.952 464.384v-1.024c-0.512-7.68-1.536-14.848-2.56-22.528v-1.024C984.064 191.488 770.56 0 512 0 229.376 0 0 229.376 0 512s229.376 512 512 512 512-229.376 512-512c0-15.872-1.024-32.256-2.048-47.616z m-129.536-212.48c1.024 1.536 2.56 3.584 3.584 5.12 1.024 2.048 2.56 3.584 3.584 5.632 2.56 3.584 4.608 7.168 6.656 10.752 0.512 0.512 1.024 1.536 1.536 2.048l6.144 10.752c0.512 0.512 0.512 1.024 1.024 2.048 30.72 54.784 49.664 115.712 55.808 178.688-109.056 18.432-134.144 35.84-144.896 64.512-8.704 22.528-5.632 40.96-0.512 53.76-3.072 3.072-6.656 6.144-9.216 8.704-24.064 22.528-44.544 42.496-44.544 71.168 0 13.824 3.584 28.16 7.68 43.008 1.536 5.12 3.584 12.288 4.608 17.92-5.12 6.656-12.288 15.872-17.408 29.184-3.072 2.048-6.656 4.608-10.752 7.68-3.072-18.432-3.584-41.984-1.536-50.176 11.776-36.352-2.048-61.952-13.312-76.8 2.048-9.216 2.56-20.992-1.024-34.304-7.68-27.136-31.232-44.544-59.904-44.544-10.24 0-19.968 2.048-29.184 4.096-5.12 1.024-10.752 2.56-15.872 3.072h-0.512c-1.536 0-10.752-4.096-22.528-23.04 3.072-9.216 15.872-27.136 20.992-33.792 9.728-13.312 17.92-24.064 20.48-38.912 2.56-12.8 1.536-26.112 0.512-40.448-0.512-3.584-0.512-9.216-1.024-13.824 11.264-8.704 34.304-30.208 29.184-64 0-4.608 2.048-14.336 3.584-21.504 4.608-1.536 9.216-2.56 12.288-3.072 34.304-5.12 47.104-35.328 53.248-53.248 18.944-6.656 58.368-18.944 129.024-38.912 4.096 7.168 8.192 12.8 12.288 18.432zM273.92 483.84c-2.56 3.584-4.608 7.68-6.656 11.264h-5.632c-4.096 0-7.68 0-11.264-0.512-26.624-70.144-50.688-86.016-71.68-91.648-4.608-1.536-9.216-2.048-12.8-3.072-9.728-24.576-34.304-43.008-81.408-59.392 0-0.512 0.512-1.024 0.512-1.536 1.024-3.072 2.56-5.632 3.584-8.192 0.512-1.536 1.536-3.072 2.048-5.12 1.024-1.536 1.536-3.584 2.56-5.12 1.024-2.048 2.048-4.608 3.072-6.656 0-0.512 0.512-1.024 0.512-1.536 27.136-55.808 65.536-105.472 111.616-145.92 44.544 116.736 63.488 126.976 89.088 132.608 25.6 5.632 62.976 16.896 81.92 24.576-21.504 11.264-41.984 22.528-55.808 35.84-19.456 18.944-53.248 78.336-49.664 124.416zM51.2 512c0-42.496 5.632-83.968 16.896-123.392 25.6 8.704 47.104 19.456 50.688 30.72 9.216 29.696 27.136 27.136 45.568 32.256 18.944 5.632 40.448 67.584 44.544 79.36 4.096 12.288 36.352 14.848 52.736 14.848s51.2 32.256 61.952 43.008 9.216 36.352 2.56 74.24 17.408 43.008 18.944 56.832c1.536 13.312 24.064 27.136 29.696 44.544 5.632 17.408 6.656 41.984-4.096 64.512-10.752 23.04-13.312 52.736-9.216 70.144 1.024 5.632-4.096 23.04-11.776 44.544C175.616 877.568 51.2 709.12 51.2 512z m325.12 161.28v-1.536c2.56-14.848 5.12-29.696 5.632-44.544l7.68 4.608c4.096 2.56 9.216 5.632 14.336 8.704 3.584 2.048 7.68 3.584 11.264 5.12 6.656 35.84 31.232 47.104 47.104 50.688 6.144 1.536 12.8 2.048 19.968 2.048 5.632 0 10.752-0.512 15.36-0.512-31.232 20.48-55.808 57.856-68.608 87.552-0.512-12.288-2.56-24.576-6.144-36.352-6.144-19.456-18.944-33.792-27.136-43.008-1.024-1.024-1.536-2.048-2.56-3.072-4.096-13.824-12.288-23.552-16.896-29.696 0.512 0.512 0.512 0.512 0 0zM512 972.8c-43.52 0-86.016-6.144-125.952-17.408 5.632-19.968 10.24-36.864 11.776-43.008 5.632-19.968 67.584-66.048 72.704-89.088 5.632-23.04 34.816-74.24 63.488-86.016 28.16-12.288 27.136-59.392 9.216-79.36-8.192-9.216-19.456-11.264-31.744-11.264-9.728 0-19.968 1.536-28.672 1.536-3.072 0-6.144 0-8.704-1.024-17.408-4.096-4.096-34.816-10.752-43.008-2.56-3.072-5.632-3.584-9.728-3.584h-6.656c-5.12 0-11.264-0.512-18.944-4.608-15.36-8.192-28.672-20.992-48.64-20.992-2.56 0-5.12 0-8.192 0.512s-5.632 0.512-8.704 0.512c-20.48 0-37.888-12.288-53.248-29.184-17.408-18.944 24.064-45.568 16.384-61.952-8.192-16.384 14.848-71.168 33.792-90.112 18.944-18.944 84.992-43.008 89.088-57.856s-13.312-33.792-27.136-48.64c-13.312-14.848-89.088-34.816-113.152-40.448-12.8-3.072-37.376-60.928-57.856-115.712C325.632 81.408 415.232 51.2 512 51.2c130.048 0 247.296 54.272 331.264 140.8-58.88 16.896-129.024 37.888-132.608 44.032-6.656 10.752-10.752 38.912-19.968 40.448-9.216 1.536-49.664 10.752-51.2 23.04s-10.752 44.544-8.192 59.392-24.064 19.968-28.16 37.888c-4.096 17.408 2.56 49.664 0 63.488-2.56 13.312-60.416 66.048-37.888 104.96 20.48 35.328 44.544 51.712 68.608 51.712 2.56 0 5.12 0 8.192-0.512 16.384-2.56 29.184-7.168 37.888-7.168 5.632 0 9.216 2.048 10.752 7.68 4.096 14.336-10.752 26.112 0 39.936 10.752 13.312 21.504 21.504 14.848 41.984-6.656 19.968-4.096 70.144 5.632 96.768 9.216 27.136 9.216 43.008 21.504 45.568 1.536 0.512 2.56 0.512 4.096 0.512 11.264 0 24.576-9.216 38.912-26.112 16.384-18.944 32.256-18.944 37.888-37.888 5.632-18.944 23.04-25.6 23.04-44.544s-13.312-52.736-13.312-67.584c0-14.848 63.488-57.856 61.952-75.264-1.536-17.408-18.944-18.944-10.752-40.448 4.096-11.264 53.76-22.528 99.328-30.72C968.704 770.048 763.904 972.8 512 972.8z"
|
||||
p-id="4275"></path>
|
||||
</svg>
|
||||
</template>
|
7
src/frontend/admin/src/assets/icons/DeviceLog.vue
Normal file
7
src/frontend/admin/src/assets/icons/DeviceLog.vue
Normal file
@ -0,0 +1,7 @@
|
||||
<template>
|
||||
<svg class="icon" height="256" p-id="5172" t="1717742099290" version="1.1" viewBox="0 0 1024 1024" width="256" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M801.45 97h-578.9C153.21 97 97 153.21 97 222.54v376.64c0 69.33 28.31 132.52 97.64 132.52h634.71c69.34 0 97.64-63.19 97.64-132.52V222.54C927 153.21 870.79 97 801.45 97z m27.9 537.06h-634.7V194.65h634.71v439.41zM721.61 829H302.39c-32.32 0-58.51 21.94-58.51 49s26.19 49 58.51 49h419.22c32.32 0 58.5-21.94 58.5-48.99S753.93 829 721.61 829zM397.3 536.41c8.84 0.09 17.57-1.74 25.36-5.32l225.49-96.84c19.5-6.98 32.83-22.74 34.52-40.84 1.69-18.08-8.54-35.47-26.51-45.03-17.96-9.55-40.64-9.68-58.74-0.32L371.93 444.9c-27.64 12.08-38.72 41.08-24.8 64.88 9.55 16.28 28.94 26.57 50.17 26.63z"
|
||||
p-id="5173"></path>
|
||||
</svg>
|
||||
</template>
|
7
src/frontend/admin/src/assets/icons/NickName.vue
Normal file
7
src/frontend/admin/src/assets/icons/NickName.vue
Normal file
@ -0,0 +1,7 @@
|
||||
<template>
|
||||
<svg class="icon" height="256" p-id="4276" t="1720059258947" version="1.1" viewBox="0 0 1024 1024" width="256" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M512.127855 3.960574C230.416064 3.960574 2.108142 232.268497 2.108142 513.980287s228.307923 510.019713 510.019713 510.019713c28.873862 0 57.108921-2.427449 84.705177-7.026825 77.806114-13.031566 149.735246-43.694074 211.315783-87.643668-2.93849-6.132502-6.260262-12.137243-10.476357-17.886463l-32.706674-45.738241c-2.299688-3.321772-4.854897-6.388022-7.410107-9.326512-56.597879 40.627823-123.672115 67.713038-196.49557 76.145227-16.097817 1.916407-32.451154 2.81073-49.060013 2.81073-232.524017 0-421.226201-188.702183-421.226201-421.353961S279.476077 92.626326 512.127855 92.626326s421.353961 188.574423 421.353961 421.353961c0 14.053649-0.766563 27.979538-2.044167 41.777667-1.022084 10.476357-2.427449 20.697193-4.216095 30.918029-11.24292 33.600998-42.79975 57.875483-79.978041 57.875483h-15.203494c-46.632564 0-84.449657-38.072614-84.449657-84.960699 0-1.277604 0-2.555209 0.127761-3.832813h-0.127761v-26.701934c0.255521-2.044167 0.383281-3.960574 0.511042-6.004741h0.638802V319.401123h-91.987523c-39.222458-29.895945-88.28247-47.654648-141.430817-47.654648-128.910293 0-233.418341 104.508047-233.418341 233.418341S386.411573 738.455396 515.321866 738.455396c63.241422 0 120.478104-25.168808 162.511291-65.924392 23.507923 39.477979 66.435434 65.924392 115.495446 65.924392h99.014348c19.291828 1.277604 83.172052-24.274485 108.08534-90.96544 16.864379-43.566313 15.203493-38.839177 19.547349-87.260386 1.405365-15.203493 2.044167-30.662508 2.044167-46.249283C1022.147568 232.268497 793.839645 3.960574 512.127855 3.960574z m3.194011 640.846413c-77.167311 0-139.642171-62.60262-139.642171-139.642171C375.679695 427.997505 438.282315 365.394885 515.321866 365.394885c77.167311 0 139.642171 62.60262 139.642171 139.642171 0.12776 77.167311-62.47486 139.769931-139.642171 139.769931z"
|
||||
p-id="4277"></path>
|
||||
</svg>
|
||||
</template>
|
7
src/frontend/admin/src/assets/icons/Telegram.vue
Normal file
7
src/frontend/admin/src/assets/icons/Telegram.vue
Normal file
@ -0,0 +1,7 @@
|
||||
<template>
|
||||
<svg class="icon" height="256" p-id="4238" t="1731037925416" version="1.1" viewBox="0 0 1024 1024" width="256" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M912.213333 154.026667A85.333333 85.333333 0 0 0 853.333333 128a85.333333 85.333333 0 0 0-33.28 6.826667l-708.266666 306.773333a42.666667 42.666667 0 0 0-26.453334 42.666667V512a42.666667 42.666667 0 0 0 29.44 42.666667L298.666667 616.106667l55.466666 187.306666a75.946667 75.946667 0 0 0 56.32 53.333334 62.72 62.72 0 0 0 15.36 0 73.813333 73.813333 0 0 0 50.773334-20.48l67.84-64 131.413333 103.68a85.333333 85.333333 0 0 0 90.026667 9.386666l14.08-7.253333a88.32 88.32 0 0 0 46.506666-62.72L938.666667 235.093333a90.026667 90.026667 0 0 0-26.453334-81.066666zM763.733333 805.12a25.173333 25.173333 0 0 1-12.8 17.493333l-14.08 7.253334a19.626667 19.626667 0 0 1-8.96 2.133333 19.626667 19.626667 0 0 1-12.373333-4.693333l-160.426667-128a20.906667 20.906667 0 0 0-27.733333 0l-94.72 89.173333a11.093333 11.093333 0 0 1-5.973333 2.133333V640a21.76 21.76 0 0 1 6.826666-15.786667c136.106667-128 217.6-199.68 266.24-240.64a15.786667 15.786667 0 0 0 5.12-11.093333 13.653333 13.653333 0 0 0-4.266666-11.093333 14.933333 14.933333 0 0 0-17.92-4.266667l-322.56 203.52a21.333333 21.333333 0 0 1-18.346667 0L149.333333 494.933333l694.186667-301.226666a16.64 16.64 0 0 1 7.68 0 22.186667 22.186667 0 0 1 16.213333 7.68 26.88 26.88 0 0 1 6.826667 23.466666z"
|
||||
p-id="4239"></path>
|
||||
</svg>
|
||||
</template>
|
@ -71,4 +71,8 @@ export { default as Mobile } from './Mobile.vue'
|
||||
export { default as Email } from './Email.vue'
|
||||
export { default as SmsCode } from './SmsCode.vue'
|
||||
export { default as MailCode } from './MailCode.vue'
|
||||
export { default as Archive } from './Archive.vue'
|
||||
export { default as Archive } from './Archive.vue'
|
||||
export { default as DeviceLog } from './DeviceLog.vue'
|
||||
export { default as NickName } from './NickName.vue'
|
||||
export { default as Telegram } from './Telegram.vue'
|
||||
export { default as Country } from './Country.vue'
|
@ -250,17 +250,6 @@ export default {
|
||||
return [start, end]
|
||||
},
|
||||
},
|
||||
{
|
||||
text: this.$t('最近一年'),
|
||||
value: () => {
|
||||
const start = new Date()
|
||||
start.setHours(0, 0, 0, 0)
|
||||
start.setFullYear(start.getFullYear() - 1)
|
||||
const end = new Date()
|
||||
end.setHours(0, 0, 0, 0)
|
||||
return [start, end]
|
||||
},
|
||||
},
|
||||
],
|
||||
options: [
|
||||
{
|
||||
@ -493,7 +482,7 @@ export default {
|
||||
async reSearch(sec) {
|
||||
const newParam = JSON.parse(this.aceEditorValue)
|
||||
this.vue.$refs.table.tableParams = newParam
|
||||
this.vue.$refs.table.upData()
|
||||
await this.vue.$refs.table.upData()
|
||||
await this.$nextTick()
|
||||
this.vue.$refs.table.tableParams = this.vue.query
|
||||
this.$emit('reSearch', newParam)
|
||||
|
@ -24,10 +24,13 @@
|
||||
<el-icon v-if="option.icon">
|
||||
<component :is="option.icon" />
|
||||
</el-icon>
|
||||
<el-badge v-if="item.badgeMax" :max="item.badgeMax" :value="option.badge">
|
||||
<el-badge
|
||||
:max="item.badgeMax ?? 999999999"
|
||||
:show-zero="false"
|
||||
:type="option.badgeType ? option.badgeType : option.badge > 1 ? 'danger' : 'info'"
|
||||
:value="option.badge">
|
||||
<span>{{ option.label }}</span>
|
||||
</el-badge>
|
||||
<span v-else>{{ option.label }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@ -54,12 +57,12 @@ export default {
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
data(val) {
|
||||
val.forEach((item) => {
|
||||
this.selected[item.key] =
|
||||
this.selectedValues[item.key] || (Array.isArray(item.options) && item.options.length) ? [item.options[0].value] : []
|
||||
})
|
||||
},
|
||||
// data(val) {
|
||||
// val.forEach((item) => {
|
||||
// this.selected[item.key] =
|
||||
// this.selectedValues[item.key] || (Array.isArray(item.options) && item.options.length) ? [item.options[0].value] : []
|
||||
// })
|
||||
// },
|
||||
},
|
||||
computed: {
|
||||
selectedString() {
|
||||
|
@ -520,11 +520,11 @@ export default {
|
||||
this.loading = false
|
||||
},
|
||||
//更新数据 合并上一次params
|
||||
upData(params = null, page = 1) {
|
||||
async upData(params = null, page = 1) {
|
||||
this.currentPage = page
|
||||
this.$refs.scTable.clearSelection()
|
||||
Object.assign(this.tableParams, params || {})
|
||||
this.getData()
|
||||
await this.getData()
|
||||
},
|
||||
//重载数据 替换params
|
||||
reload(params, page = 1) {
|
||||
|
@ -5,5 +5,5 @@ export default {
|
||||
//标题
|
||||
//APP_NAME: "标题",
|
||||
//接口地址,如遇跨域需使用nginx代理
|
||||
//API_URL: import.meta.env.VITE_API_URL,
|
||||
API_URL: import.meta.env.VITE_API_URL,
|
||||
}
|
File diff suppressed because one or more lines are too long
@ -14,7 +14,7 @@ const DEFAULT_CONFIG = {
|
||||
API_URL: '',
|
||||
|
||||
//请求超时
|
||||
TIMEOUT: 10000,
|
||||
TIMEOUT: 60 * 60 * 1000,
|
||||
|
||||
//追加其他头
|
||||
HEADERS: {},
|
||||
|
@ -272,7 +272,7 @@ export default {
|
||||
请选择月份: 'Please select a month',
|
||||
请选择类型: 'Please select a type',
|
||||
请选择通知类型: 'Please select a notification type',
|
||||
账号信息: 'Account information',
|
||||
基本资料: 'Basic Profile',
|
||||
路径: 'Path',
|
||||
路由地址: 'Routing address',
|
||||
身高: 'Height',
|
||||
@ -356,7 +356,6 @@ export default {
|
||||
最近一月: 'Last month',
|
||||
最近三月: 'Last 3 months',
|
||||
最近六月: 'Last 6 months',
|
||||
最近一年: 'Last year',
|
||||
查看: 'View',
|
||||
编辑: 'Edit',
|
||||
删除: 'Delete',
|
||||
|
@ -272,7 +272,7 @@ export default {
|
||||
请选择月份: '请选择月份',
|
||||
请选择类型: '请选择类型',
|
||||
请选择通知类型: '请选择通知类型',
|
||||
账号信息: '账号信息',
|
||||
基本资料: '基本资料',
|
||||
路径: '路径',
|
||||
路由地址: '路由地址',
|
||||
身高: '身高',
|
||||
@ -355,7 +355,6 @@ export default {
|
||||
最近一月: '最近一月',
|
||||
最近三月: '最近三月',
|
||||
最近六月: '最近六月',
|
||||
最近一年: '最近一年',
|
||||
查看: '查看',
|
||||
编辑: '编辑',
|
||||
删除: '删除',
|
||||
|
@ -12,7 +12,7 @@ const routes = [
|
||||
path: '/profile',
|
||||
component: () => import(/* webpackChunkName: "userRegister" */ '@/views/profile'),
|
||||
meta: {
|
||||
title: '账号信息',
|
||||
title: '基本资料',
|
||||
},
|
||||
children: [
|
||||
{
|
||||
@ -33,7 +33,14 @@ const routes = [
|
||||
path: '/profile/account',
|
||||
component: () => import(/* webpackChunkName: "userRegister" */ '@/views/profile/account/index.vue'),
|
||||
meta: {
|
||||
title: '账号信息',
|
||||
title: '基本资料',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/profile/token',
|
||||
component: () => import(/* webpackChunkName: "userRegister" */ '@/views/profile/token/index.vue'),
|
||||
meta: {
|
||||
title: '授权信息',
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -2,6 +2,7 @@
|
||||
:root {
|
||||
--na-color-primary: #21a675;
|
||||
}
|
||||
|
||||
#app,
|
||||
body,
|
||||
html {
|
||||
@ -540,9 +541,11 @@ textarea {
|
||||
.justify-content-center {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.justify-content-right {
|
||||
justify-content: right;
|
||||
}
|
||||
|
||||
.font-monospace {
|
||||
font-family: 'Lucida Console', 'Microsoft YaHei', monospace;
|
||||
}
|
||||
@ -605,9 +608,22 @@ textarea {
|
||||
.color-secondary {
|
||||
color: var(--el-text-color-secondary);
|
||||
}
|
||||
|
||||
.color-primary {
|
||||
color: var(--el-text-color-primary);
|
||||
}
|
||||
|
||||
.color-regular {
|
||||
color: var(--el-text-color-regular);
|
||||
}
|
||||
|
||||
.el-header.el-header-statistics {
|
||||
height: auto;
|
||||
padding: 1rem 1rem 0 1rem;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.el-header.el-header-select-filter {
|
||||
height: auto;
|
||||
padding: 0 1rem
|
||||
}
|
@ -251,6 +251,12 @@ tool.groupSeparator = function (num) {
|
||||
tool.unicodeDecode = function (str) {
|
||||
return str.replace(/\\u([0-9a-fA-F]{4})/g, (match, grp) => String.fromCharCode(parseInt(grp, 16)))
|
||||
}
|
||||
// 高亮关键词
|
||||
tool.highLightKeywords = function (str) {
|
||||
return str
|
||||
.replace(new RegExp('(Body)', 'gi'), '<span class=keywords-highlight>$1</span>')
|
||||
.replace(new RegExp('(http(s?)://.*?),', 'gi'), '<span class=keywords-highlight>$1</span>')
|
||||
}
|
||||
// 属性排序
|
||||
tool.sortProperties = function (obj) {
|
||||
const sortedKeys = Object.keys(obj).sort()
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-card :header="$t('账号信息')" shadow="never">
|
||||
<el-card :header="$t('基本资料')" shadow="never">
|
||||
<el-form :model="form" label-width="15rem" ref="form">
|
||||
<el-form-item :label="$t('头像')">
|
||||
<sc-upload v-model="form.avatar" :onSuccess="updateUser" :title="$t('上传头像')"></sc-upload>
|
||||
|
@ -47,9 +47,14 @@ export default {
|
||||
list: [
|
||||
{
|
||||
icon: 'el-icon-postcard',
|
||||
title: '账号信息',
|
||||
title: '基本资料',
|
||||
component: '/profile/account',
|
||||
},
|
||||
{
|
||||
icon: 'el-icon-user',
|
||||
title: '授权信息',
|
||||
component: '/profile/token',
|
||||
},
|
||||
{
|
||||
icon: 'el-icon-operation',
|
||||
title: '系统设置',
|
||||
|
51
src/frontend/admin/src/views/profile/token/index.vue
Normal file
51
src/frontend/admin/src/views/profile/token/index.vue
Normal file
@ -0,0 +1,51 @@
|
||||
<template>
|
||||
<el-card :header="$t('授权信息')" shadow="never">
|
||||
<el-form :model="form" :rules="rules" label-width="10rem" ref="form">
|
||||
<el-form-item :label="$t('用户标识')">
|
||||
<el-input v-model="form.id" class="font-monospace" readonly></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('授权令牌')">
|
||||
<el-input v-model="form.token" class="font-monospace" readonly rows="10" type="textarea"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('过期时间')">
|
||||
<el-input v-model="form.exp" class="font-monospace" readonly></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button v-copy="form.token" type="primary">{{ $t('复制授权令牌') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import tool from '@/utils/tool'
|
||||
|
||||
export default {
|
||||
components: {},
|
||||
methods: {},
|
||||
|
||||
created() {
|
||||
this.form.token = tool.cookie.get('ACCESS-TOKEN')
|
||||
let payload = this.form.token.split(' ')[1].split('.')[1]
|
||||
payload = payload.replaceAll('-', '+').replaceAll('_', '/')
|
||||
while (payload.length % 4) payload += '='
|
||||
const jwt = JSON.parse(tool.crypto.BASE64.decrypt(payload))
|
||||
this.form.id = jwt.ContextUserToken.Token
|
||||
this.form.exp = new Date(jwt.exp * 1000)
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
dialog: {},
|
||||
form: {
|
||||
token: null,
|
||||
exp: null,
|
||||
id: null,
|
||||
},
|
||||
rules: {},
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
@ -79,7 +79,7 @@
|
||||
hide-refresh
|
||||
pagination-layout="total"
|
||||
stripe>
|
||||
<el-table-column type="selection" />
|
||||
<el-table-column type="selection" width="50" />
|
||||
<el-table-column :label="$t('键名')" min-width="400" prop="key" />
|
||||
<el-table-column :label="$t('数据类型')" align="center" prop="type" width="100" />
|
||||
<el-table-column :label="$t('过期时间')" align="right" prop="expireTime" width="200" />
|
||||
|
@ -1,15 +1,15 @@
|
||||
<template>
|
||||
<el-container>
|
||||
<el-header v-loading="total === '...'" style="height: auto; padding: 1rem 1rem 0 1rem; display: block">
|
||||
<el-header v-loading="statistics.total === '...'" class="el-header-statistics">
|
||||
<el-row :gutter="15">
|
||||
<el-col :lg="24">
|
||||
<el-card shadow="never">
|
||||
<sc-statistic :value="total" group-separator title="总数"></sc-statistic>
|
||||
<sc-statistic :value="statistics.total" group-separator title="总数"></sc-statistic>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-header>
|
||||
<el-header style="height: auto; padding: 0 1rem">
|
||||
<el-header class="el-header-select-filter">
|
||||
<sc-select-filter
|
||||
:data="[
|
||||
{
|
||||
@ -17,8 +17,8 @@
|
||||
key: 'enabled',
|
||||
options: [
|
||||
{ label: $t('全部'), value: '' },
|
||||
{ label: $t('启用'), value: true },
|
||||
{ label: $t('禁用'), value: false },
|
||||
{ label: $t('启用'), value: true, badge: statistics.enabled?.find((x) => x.key.enabled === 'True')?.value },
|
||||
{ label: $t('禁用'), value: false, badge: statistics.enabled?.find((x) => x.key.enabled === 'False')?.value },
|
||||
],
|
||||
},
|
||||
]"
|
||||
@ -61,10 +61,10 @@
|
||||
<sc-table
|
||||
:context-menus="['id', 'userRegisterConfirm', 'userRegisterDept.name', 'userRegisterRole.name', 'enabled', 'createdTime']"
|
||||
:export-api="$API.sys_config.export"
|
||||
:on-command="this.getStatistics"
|
||||
:params="query"
|
||||
:query-api="$API.sys_config.pagedQuery"
|
||||
:vue="this"
|
||||
@data-change="getStatistics"
|
||||
@selection-change="
|
||||
(items) => {
|
||||
selection = items
|
||||
@ -73,7 +73,7 @@
|
||||
ref="table"
|
||||
row-key="id"
|
||||
stripe>
|
||||
<el-table-column type="selection" />
|
||||
<el-table-column type="selection" width="50" />
|
||||
<na-col-id :label="$t('配置编号')" min-width="170" prop="id" />
|
||||
<el-table-column :label="$t('用户注册')" align="center">
|
||||
<el-table-column :label="$t('默认部门')" align="center" prop="userRegisterDept.name" width="150" />
|
||||
@ -95,7 +95,7 @@
|
||||
icon: 'el-icon-delete',
|
||||
confirm: true,
|
||||
title: '删除部门',
|
||||
click: rowDel,
|
||||
click: this.rowDel,
|
||||
type: 'danger',
|
||||
})
|
||||
"
|
||||
@ -134,7 +134,9 @@ export default {
|
||||
created() {},
|
||||
data() {
|
||||
return {
|
||||
total: '...',
|
||||
statistics: {
|
||||
total: '...',
|
||||
},
|
||||
dialog: {},
|
||||
loading: false,
|
||||
query: {
|
||||
@ -156,8 +158,17 @@ export default {
|
||||
inject: ['reload'],
|
||||
methods: {
|
||||
async getStatistics() {
|
||||
const res = await this.$API.sys_config.count.post(this.query)
|
||||
this.total = res.data
|
||||
this.statistics.total = this.$refs.table?.total
|
||||
const res = await Promise.all([
|
||||
this.$API.sys_config.countBy.post({
|
||||
dynamicFilter: {
|
||||
filters: this.query.dynamicFilter.filters,
|
||||
},
|
||||
requiredFields: ['Enabled'],
|
||||
}),
|
||||
])
|
||||
|
||||
this.statistics.enabled = res[0].data
|
||||
},
|
||||
async setEnabled(enabled) {
|
||||
let loading
|
||||
@ -233,8 +244,7 @@ export default {
|
||||
})
|
||||
}
|
||||
|
||||
this.$refs.table.upData()
|
||||
await this.getStatistics()
|
||||
await this.$refs.table.upData()
|
||||
},
|
||||
},
|
||||
async mounted() {
|
||||
@ -254,7 +264,6 @@ export default {
|
||||
type: 'dy',
|
||||
})
|
||||
this.onReset()
|
||||
await this.getStatistics()
|
||||
},
|
||||
props: ['keywords'],
|
||||
watch: {},
|
||||
|
@ -1,15 +1,15 @@
|
||||
<template>
|
||||
<el-container>
|
||||
<el-header v-loading="total === '...'" style="height: auto; padding: 1rem 1rem 0 1rem; display: block">
|
||||
<el-header v-loading="statistics.total === '...'" class="el-header-statistics">
|
||||
<el-row :gutter="15">
|
||||
<el-col :lg="24">
|
||||
<el-card shadow="never">
|
||||
<sc-statistic :value="total" group-separator title="总数"></sc-statistic>
|
||||
<sc-statistic :value="statistics.total" group-separator title="总数"></sc-statistic>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-header>
|
||||
<el-header style="height: auto; padding: 0 1rem">
|
||||
<el-header class="el-header-select-filter">
|
||||
<sc-select-filter
|
||||
:data="[
|
||||
{
|
||||
@ -17,8 +17,8 @@
|
||||
key: 'enabled',
|
||||
options: [
|
||||
{ label: $t('全部'), value: '' },
|
||||
{ label: $t('启用'), value: true },
|
||||
{ label: $t('禁用'), value: false },
|
||||
{ label: $t('启用'), value: true, badge: statistics.enabled?.find((x) => x.key.enabled === 'True')?.value },
|
||||
{ label: $t('禁用'), value: false, badge: statistics.enabled?.find((x) => x.key.enabled === 'False')?.value },
|
||||
],
|
||||
},
|
||||
]"
|
||||
@ -69,10 +69,10 @@
|
||||
:context-menus="['id', 'name', 'sort', 'enabled', 'createdTime', 'summary']"
|
||||
:default-sort="{ prop: 'sort', order: 'descending' }"
|
||||
:export-api="$API.sys_dept.export"
|
||||
:on-command="this.getStatistics"
|
||||
:params="query"
|
||||
:query-api="$API.sys_dept.query"
|
||||
:vue="this"
|
||||
@data-change="getStatistics"
|
||||
@selection-change="
|
||||
(items) => {
|
||||
selection = items
|
||||
@ -85,7 +85,7 @@
|
||||
remote-sort
|
||||
row-key="id"
|
||||
stripe>
|
||||
<el-table-column type="selection" />
|
||||
<el-table-column type="selection" width="50" />
|
||||
<na-col-id :label="$t('部门编号')" prop="id" sortable="custom" width="170" />
|
||||
<el-table-column :label="$t('部门名称')" min-width="150" prop="name" sortable="custom" />
|
||||
<el-table-column :label="$t('排序')" align="right" prop="sort" sortable="custom" width="100" />
|
||||
@ -101,7 +101,7 @@
|
||||
icon: 'el-icon-delete',
|
||||
confirm: true,
|
||||
title: '删除部门',
|
||||
click: rowDel,
|
||||
click: this.rowDel,
|
||||
type: 'danger',
|
||||
})
|
||||
"
|
||||
@ -140,7 +140,9 @@ export default {
|
||||
created() {},
|
||||
data() {
|
||||
return {
|
||||
total: '...',
|
||||
statistics: {
|
||||
total: '...',
|
||||
},
|
||||
dialog: {},
|
||||
loading: false,
|
||||
query: {
|
||||
@ -162,8 +164,17 @@ export default {
|
||||
inject: ['reload'],
|
||||
methods: {
|
||||
async getStatistics() {
|
||||
const res = await this.$API.sys_dept.count.post(this.query)
|
||||
this.total = res.data
|
||||
this.statistics.total = this.$refs.table?.total
|
||||
const res = await Promise.all([
|
||||
this.$API.sys_dept.countBy.post({
|
||||
dynamicFilter: {
|
||||
filters: this.query.dynamicFilter.filters,
|
||||
},
|
||||
requiredFields: ['Enabled'],
|
||||
}),
|
||||
])
|
||||
|
||||
this.statistics.enabled = res[0].data
|
||||
},
|
||||
async setEnabled(enabled) {
|
||||
let loading
|
||||
@ -239,8 +250,7 @@ export default {
|
||||
})
|
||||
}
|
||||
|
||||
this.$refs.table.upData()
|
||||
await this.getStatistics()
|
||||
await this.$refs.table.upData()
|
||||
},
|
||||
},
|
||||
async mounted() {
|
||||
@ -260,7 +270,6 @@ export default {
|
||||
type: 'dy',
|
||||
})
|
||||
this.onReset()
|
||||
await this.getStatistics()
|
||||
},
|
||||
props: ['keywords'],
|
||||
watch: {},
|
||||
|
@ -1,6 +1,15 @@
|
||||
<template>
|
||||
<el-container>
|
||||
<el-header style="height: auto; padding: 0 1rem">
|
||||
<el-header v-loading="statistics.total === '...'" class="el-header-statistics">
|
||||
<el-row :gutter="15">
|
||||
<el-col :lg="24">
|
||||
<el-card shadow="never">
|
||||
<sc-statistic :value="statistics.total" group-separator title="总数"></sc-statistic>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-header>
|
||||
<el-header class="el-header-select-filter">
|
||||
<sc-select-filter
|
||||
:data="[
|
||||
{
|
||||
@ -8,8 +17,8 @@
|
||||
key: 'enabled',
|
||||
options: [
|
||||
{ label: $t('全部'), value: '' },
|
||||
{ label: $t('启用'), value: true },
|
||||
{ label: $t('禁用'), value: false },
|
||||
{ label: $t('启用'), value: true, badge: statistics.enabled?.find((x) => x.key.enabled === 'True')?.value },
|
||||
{ label: $t('禁用'), value: false, badge: statistics.enabled?.find((x) => x.key.enabled === 'False')?.value },
|
||||
],
|
||||
},
|
||||
]"
|
||||
@ -70,6 +79,7 @@
|
||||
:params="query"
|
||||
:query-api="$API.sys_dic.pagedQueryContent"
|
||||
:vue="this"
|
||||
@data-change="getStatistics"
|
||||
@selection-change="
|
||||
(items) => {
|
||||
selection = items
|
||||
@ -95,7 +105,7 @@
|
||||
icon: 'el-icon-delete',
|
||||
confirm: true,
|
||||
title: '删除字典项',
|
||||
click: rowDel,
|
||||
click: this.rowDel,
|
||||
type: 'danger',
|
||||
})
|
||||
"
|
||||
@ -143,6 +153,9 @@ export default {
|
||||
created() {},
|
||||
data() {
|
||||
return {
|
||||
statistics: {
|
||||
total: '...',
|
||||
},
|
||||
dialog: {},
|
||||
loading: false,
|
||||
query: {
|
||||
@ -157,6 +170,18 @@ export default {
|
||||
},
|
||||
inject: ['reload'],
|
||||
methods: {
|
||||
async getStatistics() {
|
||||
this.statistics.total = this.$refs.table?.total
|
||||
const res = await Promise.all([
|
||||
this.$API.sys_dic.contentCountBy.post({
|
||||
dynamicFilter: {
|
||||
filters: this.query.dynamicFilter.filters,
|
||||
},
|
||||
requiredFields: ['Enabled'],
|
||||
}),
|
||||
])
|
||||
this.statistics.enabled = res[0].data
|
||||
},
|
||||
async batchsuccess(data, mode) {
|
||||
if (mode === 'batchedit') {
|
||||
let loading
|
||||
@ -211,7 +236,7 @@ export default {
|
||||
Object.entries(this.$refs.selectFilter.selected).forEach(([key, _]) => (this.$refs.selectFilter.selected[key] = ['']))
|
||||
},
|
||||
//搜索
|
||||
onSearch(form) {
|
||||
async onSearch(form) {
|
||||
this.query.dynamicFilter.filters.push({
|
||||
field: 'catalogId',
|
||||
value: this.catalogId,
|
||||
@ -234,7 +259,7 @@ export default {
|
||||
})
|
||||
}
|
||||
|
||||
this.$refs.table.upData()
|
||||
await this.$refs.table.upData()
|
||||
},
|
||||
|
||||
//删除
|
||||
|
@ -1,6 +1,15 @@
|
||||
<template>
|
||||
<el-container>
|
||||
<el-header style="height: auto; padding: 0 1rem">
|
||||
<el-header v-loading="statistics.total === '...'" class="el-header-statistics">
|
||||
<el-row :gutter="15">
|
||||
<el-col :lg="24">
|
||||
<el-card shadow="never">
|
||||
<sc-statistic :value="statistics.total" group-separator title="总数"></sc-statistic>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-header>
|
||||
<el-header class="el-header-select-filter">
|
||||
<sc-select-filter
|
||||
:data="[
|
||||
{
|
||||
@ -8,8 +17,8 @@
|
||||
key: 'enabled',
|
||||
options: [
|
||||
{ label: $t('全部'), value: '' },
|
||||
{ label: $t('启用'), value: true },
|
||||
{ label: $t('禁用'), value: false },
|
||||
{ label: $t('启用'), value: true, badge: statistics.enabled?.find((x) => x.key.enabled === 'True')?.value },
|
||||
{ label: $t('禁用'), value: false, badge: statistics.enabled?.find((x) => x.key.enabled === 'False')?.value },
|
||||
],
|
||||
},
|
||||
{
|
||||
@ -18,7 +27,11 @@
|
||||
options: [
|
||||
{ label: $t('全部'), value: '' },
|
||||
...Object.entries(this.$GLOBAL.enums.archiveVisibilities).map((x) => {
|
||||
return { value: x[0], label: x[1][1] }
|
||||
return {
|
||||
value: x[0],
|
||||
label: x[1][1],
|
||||
badge: this.statistics.visibility?.find((y) => y.key.visibility.toLowerCase() === x[0].toLowerCase())?.value,
|
||||
}
|
||||
}),
|
||||
],
|
||||
},
|
||||
@ -77,6 +90,7 @@
|
||||
:params="query"
|
||||
:query-api="$API.sys_doc.pagedQueryContent"
|
||||
:vue="this"
|
||||
@data-change="getStatistics"
|
||||
@selection-change="
|
||||
(items) => {
|
||||
selection = items
|
||||
@ -128,7 +142,7 @@
|
||||
icon: 'el-icon-delete',
|
||||
confirm: true,
|
||||
title: '删除文档',
|
||||
click: rowDel,
|
||||
click: this.rowDel,
|
||||
type: 'danger',
|
||||
},
|
||||
]"
|
||||
@ -167,6 +181,9 @@ export default {
|
||||
created() {},
|
||||
data() {
|
||||
return {
|
||||
statistics: {
|
||||
total: '...',
|
||||
},
|
||||
dialog: {},
|
||||
loading: false,
|
||||
query: {
|
||||
@ -181,6 +198,25 @@ export default {
|
||||
},
|
||||
inject: ['reload'],
|
||||
methods: {
|
||||
async getStatistics() {
|
||||
this.statistics.total = this.$refs.table?.total
|
||||
const res = await Promise.all([
|
||||
this.$API.sys_doc.contentCountBy.post({
|
||||
dynamicFilter: {
|
||||
filters: this.query.dynamicFilter.filters,
|
||||
},
|
||||
requiredFields: ['Enabled'],
|
||||
}),
|
||||
this.$API.sys_doc.contentCountBy.post({
|
||||
dynamicFilter: {
|
||||
filters: this.query.dynamicFilter.filters,
|
||||
},
|
||||
requiredFields: ['Visibility'],
|
||||
}),
|
||||
])
|
||||
this.statistics.enabled = res[0].data
|
||||
this.statistics.visibility = res[1].data
|
||||
},
|
||||
viewClick(row) {
|
||||
window.open(window.location.origin + `/guest/view-doc/${row.id}`)
|
||||
},
|
||||
@ -219,7 +255,7 @@ export default {
|
||||
Object.entries(this.$refs.selectFilter.selected).forEach(([key, _]) => (this.$refs.selectFilter.selected[key] = ['']))
|
||||
},
|
||||
//搜索
|
||||
onSearch(form) {
|
||||
async onSearch(form) {
|
||||
this.query.dynamicFilter.filters.push({
|
||||
field: 'catalogId',
|
||||
value: this.catalogId,
|
||||
@ -250,7 +286,7 @@ export default {
|
||||
})
|
||||
}
|
||||
|
||||
this.$refs.table.upData()
|
||||
await this.$refs.table.upData()
|
||||
},
|
||||
async share(row) {
|
||||
const textarea = document.createElement('textarea')
|
||||
|
@ -1,20 +1,15 @@
|
||||
<template>
|
||||
<el-container>
|
||||
<el-header v-loading="total === '...'" style="height: auto; padding: 1rem 1rem 0 1rem; display: block">
|
||||
<el-header v-loading="statistics.total === '...'" class="el-header-statistics">
|
||||
<el-row :gutter="15">
|
||||
<el-col :lg="12">
|
||||
<el-col :lg="24">
|
||||
<el-card shadow="never">
|
||||
<sc-statistic :value="total" group-separator title="总数"></sc-statistic>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-card shadow="never">
|
||||
<sc-statistic :value="running" group-separator title="运行"></sc-statistic>
|
||||
<sc-statistic :value="statistics.total" group-separator title="总数"></sc-statistic>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-header>
|
||||
<el-header style="height: auto; padding: 0 1rem">
|
||||
<el-header class="el-header-select-filter">
|
||||
<sc-select-filter
|
||||
:data="[
|
||||
{
|
||||
@ -23,7 +18,11 @@
|
||||
options: [
|
||||
{ label: $t('全部'), value: '' },
|
||||
...Object.entries(this.$GLOBAL.enums.jobStatues).map((x) => {
|
||||
return { value: x[0], label: x[1][1] }
|
||||
return {
|
||||
value: x[0],
|
||||
label: x[1][1],
|
||||
badge: this.statistics.status?.find((y) => y.key.status.toLowerCase() === x[0].toLowerCase())?.value,
|
||||
}
|
||||
}),
|
||||
],
|
||||
},
|
||||
@ -32,10 +31,25 @@
|
||||
key: 'enabled',
|
||||
options: [
|
||||
{ label: $t('全部'), value: '' },
|
||||
{ label: $t('启用'), value: true },
|
||||
{ label: $t('禁用'), value: false },
|
||||
{ label: $t('启用'), value: true, badge: statistics.enabled?.find((x) => x.key.enabled === 'True')?.value },
|
||||
{ label: $t('禁用'), value: false, badge: statistics.enabled?.find((x) => x.key.enabled === 'False')?.value },
|
||||
],
|
||||
},
|
||||
{
|
||||
title: $t('上次执行状态'),
|
||||
key: 'lastStatusCode',
|
||||
options: [
|
||||
{ label: $t('全部'), value: '' },
|
||||
...(this.statistics.lastStatusCode?.map((x) => {
|
||||
return {
|
||||
value: x.key.lastStatusCode,
|
||||
label: x.key.lastStatusCode,
|
||||
badge: x.value,
|
||||
}
|
||||
}) ?? []),
|
||||
],
|
||||
w100p: true,
|
||||
},
|
||||
]"
|
||||
:label-width="10"
|
||||
@on-change="filterChange"
|
||||
@ -114,11 +128,11 @@
|
||||
]"
|
||||
:default-sort="{ prop: 'lastExecTime', order: 'descending' }"
|
||||
:export-api="$API.sys_job.export"
|
||||
:on-command="this.getStatistics"
|
||||
:page-size="100"
|
||||
:params="query"
|
||||
:query-api="$API.sys_job.pagedQuery"
|
||||
:vue="this"
|
||||
@data-change="getStatistics"
|
||||
@selection-change="
|
||||
(items) => {
|
||||
selection = items
|
||||
@ -129,7 +143,7 @@
|
||||
remote-sort
|
||||
row-key="id"
|
||||
stripe>
|
||||
<el-table-column type="selection" />
|
||||
<el-table-column type="selection" width="50" />
|
||||
<na-col-id :label="$t('作业编号')" prop="id" sortable="custom" width="170" />
|
||||
<el-table-column :label="$t('作业名称')" min-width="150" prop="jobName" show-overflow-tooltip sortable="custom" />
|
||||
<el-table-column :label="$t('执行计划')" align="right" prop="executionCron" sortable="custom" width="150">
|
||||
@ -211,7 +225,7 @@
|
||||
icon: 'el-icon-delete',
|
||||
confirm: true,
|
||||
title: '删除作业',
|
||||
click: rowDel,
|
||||
click: this.rowDel,
|
||||
type: 'danger',
|
||||
},
|
||||
)
|
||||
@ -253,8 +267,9 @@ export default {
|
||||
created() {},
|
||||
data() {
|
||||
return {
|
||||
total: '...',
|
||||
running: '...',
|
||||
statistics: {
|
||||
total: '...',
|
||||
},
|
||||
dialog: {},
|
||||
loading: false,
|
||||
query: {
|
||||
@ -277,15 +292,30 @@ export default {
|
||||
inject: ['reload'],
|
||||
methods: {
|
||||
async getStatistics() {
|
||||
const runningFilter = JSON.parse(JSON.stringify(this.query))
|
||||
runningFilter.dynamicFilter.filters.push({
|
||||
field: 'status',
|
||||
operator: 'eq',
|
||||
value: 'running',
|
||||
})
|
||||
const res = await Promise.all([this.$API.sys_job.count.post(this.query), this.$API.sys_job.count.post(runningFilter)])
|
||||
this.total = res[0].data
|
||||
this.running = res[1].data
|
||||
const res = await Promise.all([
|
||||
this.$API.sys_job.countBy.post({
|
||||
dynamicFilter: {
|
||||
filters: this.query.dynamicFilter.filters,
|
||||
},
|
||||
requiredFields: ['Status'],
|
||||
}),
|
||||
this.$API.sys_job.countBy.post({
|
||||
dynamicFilter: {
|
||||
filters: this.query.dynamicFilter.filters,
|
||||
},
|
||||
requiredFields: ['Enabled'],
|
||||
}),
|
||||
this.$API.sys_job.countBy.post({
|
||||
dynamicFilter: {
|
||||
filters: this.query.dynamicFilter.filters,
|
||||
},
|
||||
requiredFields: ['LastStatusCode'],
|
||||
}),
|
||||
])
|
||||
this.statistics.total = this.$refs.table?.total
|
||||
this.statistics.status = res[0].data
|
||||
this.statistics.enabled = res[1].data
|
||||
this.statistics.lastStatusCode = res[2].data
|
||||
},
|
||||
async copyJob(row) {
|
||||
let loading = this.$loading()
|
||||
@ -399,6 +429,14 @@ export default {
|
||||
})
|
||||
}
|
||||
|
||||
if (typeof form.dy.lastStatusCode === 'string' && form.dy.lastStatusCode.trim() !== '') {
|
||||
this.query.dynamicFilter.filters.push({
|
||||
field: 'lastStatusCode',
|
||||
operator: 'eq',
|
||||
value: form.dy.lastStatusCode,
|
||||
})
|
||||
}
|
||||
|
||||
if (typeof form.dy.enabled === 'boolean') {
|
||||
this.query.dynamicFilter.filters.push({
|
||||
field: 'enabled',
|
||||
@ -414,8 +452,7 @@ export default {
|
||||
value: form.dy.httpMethod,
|
||||
})
|
||||
}
|
||||
this.$refs.table.upData()
|
||||
await this.getStatistics()
|
||||
await this.$refs.table.upData()
|
||||
},
|
||||
},
|
||||
async mounted() {
|
||||
@ -435,7 +472,6 @@ export default {
|
||||
type: 'dy',
|
||||
})
|
||||
this.onReset()
|
||||
await this.getStatistics()
|
||||
},
|
||||
props: ['keywords'],
|
||||
watch: {},
|
||||
|
@ -1,14 +1,42 @@
|
||||
<template>
|
||||
<el-container>
|
||||
<el-header v-loading="total === '...'" style="height: auto; padding: 1rem 1rem 0 1rem; display: block">
|
||||
<el-header v-loading="statistics.total === '...'" class="el-header-statistics">
|
||||
<el-row :gutter="15">
|
||||
<el-col :lg="24">
|
||||
<el-col :lg="12">
|
||||
<el-card shadow="never">
|
||||
<sc-statistic :value="total" group-separator title="总数"></sc-statistic>
|
||||
<sc-statistic :value="statistics.total" group-separator title="总数"></sc-statistic>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-card shadow="never">
|
||||
<sc-statistic :value="statistics.rate" suffix="%" title="成功率"></sc-statistic>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-header>
|
||||
<el-header class="el-header-select-filter">
|
||||
<sc-select-filter
|
||||
:data="[
|
||||
{
|
||||
title: $t('响应状态码'),
|
||||
key: 'httpStatusCode',
|
||||
options: [
|
||||
{ label: $t('全部'), value: '' },
|
||||
...(this.statistics.httpStatusCode?.map((x) => {
|
||||
return {
|
||||
value: x.key.httpStatusCode,
|
||||
label: x.key.httpStatusCode,
|
||||
badge: x.value,
|
||||
}
|
||||
}) ?? []),
|
||||
],
|
||||
w100p: true,
|
||||
},
|
||||
]"
|
||||
:label-width="6"
|
||||
@on-change="filterChange"
|
||||
ref="selectFilter"></sc-select-filter>
|
||||
</el-header>
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<na-search
|
||||
@ -74,10 +102,10 @@
|
||||
:context-menus="['id', 'duration', 'httpMethod', 'requestUrl', 'httpStatusCode', 'createdTime', 'jobId', 'responseBody']"
|
||||
:default-sort="{ prop: 'createdTime', order: 'descending' }"
|
||||
:export-api="$API.sys_job.exportRecord"
|
||||
:on-command="this.getStatistics"
|
||||
:params="query"
|
||||
:query-api="$API.sys_job.pagedQueryRecord"
|
||||
:vue="this"
|
||||
@data-change="getStatistics"
|
||||
ref="table"
|
||||
remote-filter
|
||||
remote-sort
|
||||
@ -193,7 +221,10 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
total: '...',
|
||||
statistics: {
|
||||
total: '...',
|
||||
rate: '...',
|
||||
},
|
||||
dialog: {},
|
||||
loading: false,
|
||||
query: {
|
||||
@ -212,9 +243,39 @@ export default {
|
||||
},
|
||||
inject: ['reload'],
|
||||
methods: {
|
||||
filterChange(data) {
|
||||
Object.entries(data).forEach(([key, value]) => {
|
||||
this.$refs.search.form.dy[key] = value === 'true' ? true : value === 'false' ? false : value
|
||||
})
|
||||
this.$refs.search.search()
|
||||
},
|
||||
async getStatistics() {
|
||||
const res = await this.$API.sys_job.countRecord.post(this.query)
|
||||
this.total = res.data
|
||||
this.statistics.total = this.$refs.table?.total
|
||||
const res = await Promise.all([
|
||||
this.$API.sys_job.recordCountBy.post({
|
||||
dynamicFilter: {
|
||||
filters: this.query.dynamicFilter.filters,
|
||||
},
|
||||
requiredFields: ['HttpStatusCode'],
|
||||
}),
|
||||
])
|
||||
|
||||
this.statistics.httpStatusCode = res[0].data
|
||||
try {
|
||||
let rate =
|
||||
((res[0].data
|
||||
?.filter((x) => x.key.httpStatusCode.indexOf('2') === 0)
|
||||
?.map((x) => x.value)
|
||||
?.reduce((a, b) => a + b) ?? 0) /
|
||||
this.statistics.total) *
|
||||
100
|
||||
if (rate > 100) {
|
||||
rate = 100
|
||||
}
|
||||
this.statistics.rate = rate.toFixed(2)
|
||||
} catch {
|
||||
this.statistics.rate = 0
|
||||
}
|
||||
},
|
||||
jobClick(job) {
|
||||
this.dialog.job = { mode: 'view', row: { id: job.id } }
|
||||
@ -265,7 +326,7 @@ export default {
|
||||
})
|
||||
}
|
||||
|
||||
if (typeof form.dy.jobId === 'string' && form.dy.jobId.trim() !== '') {
|
||||
if (typeof form.dy.jobId === 'number' && form.dy.jobId !== 0) {
|
||||
this.query.dynamicFilter.filters.push({
|
||||
field: 'jobId',
|
||||
operator: 'eq',
|
||||
@ -273,11 +334,11 @@ export default {
|
||||
})
|
||||
}
|
||||
|
||||
if (typeof form.dy.jobId === 'number' && form.dy.jobId !== 0) {
|
||||
if (typeof form.dy.httpStatusCode === 'string' && form.dy.httpStatusCode.trim() !== '') {
|
||||
this.query.dynamicFilter.filters.push({
|
||||
field: 'jobId',
|
||||
field: 'httpStatusCode',
|
||||
operator: 'eq',
|
||||
value: form.dy.jobId,
|
||||
value: form.dy.httpStatusCode,
|
||||
})
|
||||
}
|
||||
|
||||
@ -288,8 +349,7 @@ export default {
|
||||
value: form.dy.httpMethod,
|
||||
})
|
||||
}
|
||||
this.$refs.table.upData()
|
||||
await this.getStatistics()
|
||||
await this.$refs.table.upData()
|
||||
},
|
||||
},
|
||||
async mounted() {
|
||||
@ -319,7 +379,6 @@ export default {
|
||||
value: this.$refs.search.form.dy.createdTime,
|
||||
type: 'dy',
|
||||
})
|
||||
await this.getStatistics()
|
||||
},
|
||||
props: ['statusCodes', 'jobId'],
|
||||
watch: {},
|
||||
|
@ -1,15 +1,15 @@
|
||||
<template>
|
||||
<el-container>
|
||||
<el-header v-loading="total === '...'" style="height: auto; padding: 1rem 1rem 0 1rem; display: block">
|
||||
<el-header v-loading="statistics.total === '...'" class="el-header-statistics">
|
||||
<el-row :gutter="15">
|
||||
<el-col :lg="24">
|
||||
<el-card shadow="never">
|
||||
<sc-statistic :value="total" group-separator title="总数"></sc-statistic>
|
||||
<sc-statistic :value="statistics.total" group-separator title="总数"></sc-statistic>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-header>
|
||||
<el-header style="height: auto; padding: 0 1rem">
|
||||
<el-header class="el-header-select-filter">
|
||||
<sc-select-filter
|
||||
v-if="showFilter"
|
||||
:data="[
|
||||
@ -22,6 +22,51 @@
|
||||
{ label: $t('失败'), value: false },
|
||||
],
|
||||
},
|
||||
{
|
||||
title: $t('错误码'),
|
||||
key: 'errorCode',
|
||||
options: [
|
||||
{ label: $t('全部'), value: '' },
|
||||
...(this.statistics.errorCode?.map((x) => {
|
||||
return {
|
||||
value: x.key.errorCode,
|
||||
label: x.key.errorCode,
|
||||
badge: x.value,
|
||||
}
|
||||
}) ?? []),
|
||||
],
|
||||
w100p: true,
|
||||
},
|
||||
{
|
||||
title: $t('登录用户名'),
|
||||
key: 'loginUserName',
|
||||
options: [
|
||||
{ label: $t('全部'), value: '' },
|
||||
...(this.statistics.loginUserName?.map((x) => {
|
||||
return {
|
||||
value: x.key.loginUserName,
|
||||
label: x.key.loginUserName,
|
||||
badge: x.value,
|
||||
}
|
||||
}) ?? []),
|
||||
],
|
||||
w100p: true,
|
||||
},
|
||||
{
|
||||
title: $t('客户端IP地址'),
|
||||
key: 'createdClientIp',
|
||||
options: [
|
||||
{ label: $t('全部'), value: '' },
|
||||
...(this.statistics.createdClientIp?.map((x) => {
|
||||
return {
|
||||
value: x.key.createdClientIp,
|
||||
label: x.key.createdClientIp,
|
||||
badge: x.value,
|
||||
}
|
||||
}) ?? []),
|
||||
],
|
||||
w100p: true,
|
||||
},
|
||||
]"
|
||||
:label-width="10"
|
||||
@on-change="filterChange"
|
||||
@ -54,7 +99,6 @@
|
||||
:context-opers="['view']"
|
||||
:default-sort="{ prop: 'createdTime', order: 'descending' }"
|
||||
:export-api="$API.sys_loginlog.export"
|
||||
:on-command="this.getStatistics"
|
||||
:params="query"
|
||||
:query-api="$API.sys_loginlog.pagedQuery"
|
||||
:vue="this"
|
||||
@ -111,7 +155,9 @@ export default {
|
||||
created() {},
|
||||
data() {
|
||||
return {
|
||||
total: '...',
|
||||
statistics: {
|
||||
total: '...',
|
||||
},
|
||||
dialog: {
|
||||
info: false,
|
||||
},
|
||||
@ -130,8 +176,42 @@ export default {
|
||||
inject: ['reload'],
|
||||
methods: {
|
||||
async getStatistics() {
|
||||
const res = await this.$API.sys_loginlog.count.post(this.query)
|
||||
this.total = res.data
|
||||
this.statistics.total = this.$refs.table?.total
|
||||
const res = await Promise.all([
|
||||
this.$API.sys_loginlog.countBy.post({
|
||||
dynamicFilter: {
|
||||
filters: this.query.dynamicFilter.filters,
|
||||
},
|
||||
requiredFields: ['ErrorCode'],
|
||||
}),
|
||||
this.$API.sys_loginlog.countBy.post({
|
||||
dynamicFilter: {
|
||||
filters: [
|
||||
...this.query.dynamicFilter.filters,
|
||||
{
|
||||
field: 'LoginUserName',
|
||||
operator: 'notEqual',
|
||||
},
|
||||
],
|
||||
},
|
||||
requiredFields: ['LoginUserName'],
|
||||
}),
|
||||
this.$API.sys_loginlog.countBy.post({
|
||||
dynamicFilter: {
|
||||
filters: [
|
||||
...this.query.dynamicFilter.filters,
|
||||
{
|
||||
field: 'CreatedClientIp',
|
||||
operator: 'notEqual',
|
||||
},
|
||||
],
|
||||
},
|
||||
requiredFields: ['CreatedClientIp'],
|
||||
}),
|
||||
])
|
||||
this.statistics.errorCode = res[0].data
|
||||
this.statistics.loginUserName = res[1].data.slice(0, 20)
|
||||
this.statistics.createdClientIp = res[2].data.slice(0, 20)
|
||||
},
|
||||
async dataChange(data) {
|
||||
this.apis = []
|
||||
@ -140,6 +220,7 @@ export default {
|
||||
ips && ips.length > 0 ? http.get(`https://ip.tools92.top/?ip=${ips.join('&ip=')}`) : new Promise((x) => x({ data: [] })),
|
||||
])
|
||||
this.ips = res[0]
|
||||
await this.getStatistics()
|
||||
},
|
||||
filterChange(data) {
|
||||
Object.entries(data).forEach(([key, value]) => {
|
||||
@ -175,8 +256,32 @@ export default {
|
||||
},
|
||||
)
|
||||
}
|
||||
this.$refs.table.upData()
|
||||
await this.getStatistics()
|
||||
|
||||
if (typeof form.dy.errorCode === 'string' && form.dy.errorCode.trim() !== '') {
|
||||
this.query.dynamicFilter.filters.push({
|
||||
field: 'errorCode',
|
||||
operator: 'eq',
|
||||
value: form.dy.errorCode,
|
||||
})
|
||||
}
|
||||
|
||||
if (typeof form.dy.loginUserName === 'string' && form.dy.loginUserName.trim() !== '') {
|
||||
this.query.dynamicFilter.filters.push({
|
||||
field: 'loginUserName',
|
||||
operator: 'eq',
|
||||
value: form.dy.loginUserName,
|
||||
})
|
||||
}
|
||||
|
||||
if (typeof form.dy.createdClientIp === 'string' && form.dy.createdClientIp.trim() !== '') {
|
||||
this.query.dynamicFilter.filters.push({
|
||||
field: 'createdClientIp',
|
||||
operator: 'eq',
|
||||
value: form.dy.createdClientIp,
|
||||
})
|
||||
}
|
||||
|
||||
await this.$refs.table.upData()
|
||||
},
|
||||
|
||||
async rowClick(row) {
|
||||
@ -200,7 +305,6 @@ export default {
|
||||
type: 'root',
|
||||
})
|
||||
}
|
||||
await this.getStatistics()
|
||||
},
|
||||
props: { keywords: { type: String }, showFilter: { type: Boolean, default: true } },
|
||||
watch: {},
|
||||
|
@ -1,15 +1,15 @@
|
||||
<template>
|
||||
<el-container>
|
||||
<el-header v-loading="total === '...'" style="height: auto; padding: 1rem 1rem 0 1rem; display: block">
|
||||
<el-header v-loading="statistics.total === '...'" class="el-header-statistics">
|
||||
<el-row :gutter="15">
|
||||
<el-col :lg="24">
|
||||
<el-card shadow="never">
|
||||
<sc-statistic :value="total" group-separator title="总数"></sc-statistic>
|
||||
<sc-statistic :value="statistics.total" group-separator title="总数"></sc-statistic>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-header>
|
||||
<el-header style="height: auto; padding: 0 1rem">
|
||||
<el-header class="el-header-select-filter">
|
||||
<sc-select-filter
|
||||
:data="[
|
||||
{
|
||||
@ -21,6 +21,37 @@
|
||||
{ label: $t('失败'), value: false },
|
||||
],
|
||||
},
|
||||
{
|
||||
title: $t('响应状态码'),
|
||||
key: 'httpStatusCode',
|
||||
options: [
|
||||
{ label: $t('全部'), value: '' },
|
||||
...(this.statistics.httpStatusCode?.map((x) => {
|
||||
return {
|
||||
value: x.key.httpStatusCode,
|
||||
label: x.key.httpStatusCode,
|
||||
badge: x.value,
|
||||
}
|
||||
}) ?? []),
|
||||
],
|
||||
w100p: true,
|
||||
},
|
||||
{
|
||||
title: $t('请求服务'),
|
||||
key: 'apiPathCrc32',
|
||||
options: [
|
||||
{ label: $t('全部'), value: '' },
|
||||
...(this.statistics.apiPathCrc32?.map((x) => {
|
||||
let api = this.apis?.find((y) => y.pathCrc32.toString() === x.key.apiPathCrc32)
|
||||
return {
|
||||
value: x.key.apiPathCrc32,
|
||||
label: `${api?.summary} : ${api?.id}`,
|
||||
badge: x.value,
|
||||
}
|
||||
}) ?? []),
|
||||
],
|
||||
w100p: true,
|
||||
},
|
||||
]"
|
||||
:label-width="10"
|
||||
@on-change="filterChange"
|
||||
@ -201,17 +232,21 @@ export default {
|
||||
saveDialog,
|
||||
},
|
||||
computed: {},
|
||||
created() {
|
||||
async created() {
|
||||
if (this.ownerId) {
|
||||
this.query.dynamicFilter.filters.push({ field: 'ownerId', operator: 'eq', value: this.ownerId })
|
||||
}
|
||||
if (this.excludeApiPathCrc32) {
|
||||
this.query.dynamicFilter.filters.push({ field: 'apiPathCrc32', operator: 'notEqual', value: this.excludeApiPathCrc32 })
|
||||
}
|
||||
const res = await this.$API.sys_api.plainQuery.post({ count: 1000 })
|
||||
this.apis = res.data
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
total: '...',
|
||||
statistics: {
|
||||
total: '...',
|
||||
},
|
||||
dialog: {
|
||||
info: false,
|
||||
},
|
||||
@ -225,7 +260,10 @@ export default {
|
||||
{
|
||||
field: 'createdTime',
|
||||
operator: 'dateRange',
|
||||
value: [this.$TOOL.dateFormat(new Date(), 'yyyy-MM-dd'), this.$TOOL.dateFormat(new Date(), 'yyyy-MM-dd')],
|
||||
value: [
|
||||
this.$TOOL.dateFormat(new Date(new Date() - 3600 * 1000), 'yyyy-MM-dd hh:mm:ss'),
|
||||
this.$TOOL.dateFormat(new Date(), 'yyyy-MM-dd hh:mm:ss'),
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
@ -242,7 +280,6 @@ export default {
|
||||
},
|
||||
async dataChange(data) {
|
||||
this.owners = []
|
||||
this.apis = []
|
||||
const ownerIds = data.data.rows?.filter((x) => x.ownerId).map((x) => x.ownerId)
|
||||
const apiCrcs = data.data.rows?.map((x) => x.apiPathCrc32)
|
||||
const ips = data.data.rows?.map((x) => x.createdClientIp) ?? []
|
||||
@ -257,22 +294,31 @@ export default {
|
||||
})
|
||||
: new Promise((x) => x({ data: [] })),
|
||||
|
||||
apiCrcs && apiCrcs.length > 0
|
||||
? this.$API.sys_api.query.post({
|
||||
dynamicFilter: {
|
||||
field: 'pathCrc32',
|
||||
operator: 'any',
|
||||
value: apiCrcs,
|
||||
},
|
||||
})
|
||||
: new Promise((x) => x({ data: [] })),
|
||||
|
||||
ips && ips.length > 0 ? http.get(`https://ip.tools92.top/?ip=${ips.join('&ip=')}`) : new Promise((x) => x({ data: [] })),
|
||||
])
|
||||
this.owners = res[0].data
|
||||
this.apis = res[1].data
|
||||
this.ips = res[2]
|
||||
this.total = data.data.total
|
||||
this.ips = res[1]
|
||||
await this.getStatistics()
|
||||
},
|
||||
async getStatistics() {
|
||||
this.statistics.total = this.$refs.table?.total
|
||||
|
||||
const res = await Promise.all([
|
||||
this.$API.sys_requestlog.countBy.post({
|
||||
dynamicFilter: {
|
||||
filters: this.query.dynamicFilter.filters,
|
||||
},
|
||||
requiredFields: ['HttpStatusCode'],
|
||||
}),
|
||||
this.$API.sys_requestlog.countBy.post({
|
||||
dynamicFilter: {
|
||||
filters: this.query.dynamicFilter.filters,
|
||||
},
|
||||
requiredFields: ['ApiPathCrc32'],
|
||||
}),
|
||||
])
|
||||
this.statistics.httpStatusCode = res[0].data
|
||||
this.statistics.apiPathCrc32 = res[1].data.slice(0, 20)
|
||||
},
|
||||
filterChange(data) {
|
||||
Object.entries(data).forEach(([key, value]) => {
|
||||
@ -327,6 +373,21 @@ export default {
|
||||
value: form.dy.ownerId,
|
||||
})
|
||||
}
|
||||
|
||||
if (typeof form.dy.httpStatusCode === 'string' && form.dy.httpStatusCode.trim() !== '') {
|
||||
this.query.dynamicFilter.filters.push({
|
||||
field: 'httpStatusCode',
|
||||
operator: 'eq',
|
||||
value: form.dy.httpStatusCode,
|
||||
})
|
||||
}
|
||||
if (typeof form.dy.apiPathCrc32 === 'string' && form.dy.apiPathCrc32.trim() !== '') {
|
||||
this.query.dynamicFilter.filters.push({
|
||||
field: 'apiPathCrc32',
|
||||
operator: 'eq',
|
||||
value: form.dy.apiPathCrc32,
|
||||
})
|
||||
}
|
||||
if (typeof form.dy.id === 'string' && form.dy.id.trim() !== '') {
|
||||
this.query.dynamicFilter.filters.push({
|
||||
field: 'id',
|
||||
@ -358,7 +419,7 @@ export default {
|
||||
},
|
||||
)
|
||||
}
|
||||
this.$refs.table.upData()
|
||||
await this.$refs.table.upData()
|
||||
},
|
||||
|
||||
async rowClick(row) {
|
||||
@ -371,6 +432,33 @@ export default {
|
||||
id: row.id,
|
||||
createdTime: row.createdTime,
|
||||
}),
|
||||
{
|
||||
query: {
|
||||
bool: {
|
||||
must: [
|
||||
{
|
||||
range: {
|
||||
'@timestamp': {
|
||||
gt: new Date(row.createdTime).getTime() - 1000 * 60 * 60,
|
||||
lt: new Date(row.createdTime).getTime() + 1000 * 60 * 60,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
match_phrase: {
|
||||
log_message: row.traceId,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
size: 1000,
|
||||
sort: [
|
||||
{
|
||||
'@timestamp': 'desc',
|
||||
},
|
||||
],
|
||||
},
|
||||
)
|
||||
},
|
||||
},
|
||||
@ -403,8 +491,8 @@ export default {
|
||||
}
|
||||
|
||||
this.$refs.search.form.dy.createdTime = [
|
||||
this.$TOOL.dateFormat(new Date(), 'yyyy-MM-dd 00:00:00'),
|
||||
this.$TOOL.dateFormat(new Date(), 'yyyy-MM-dd 00:00:00'),
|
||||
this.$TOOL.dateFormat(new Date(new Date() - 3600 * 1000), 'yyyy-MM-dd hh:mm:ss'),
|
||||
this.$TOOL.dateFormat(new Date(), 'yyyy-MM-dd hh:mm:ss'),
|
||||
]
|
||||
this.$refs.search.keeps.push({
|
||||
field: 'createdTime',
|
||||
|
@ -1,15 +1,15 @@
|
||||
<template>
|
||||
<el-container>
|
||||
<el-header v-loading="total === '...'" style="height: auto; padding: 1rem 1rem 0 1rem; display: block">
|
||||
<el-header v-loading="statistics.total === '...'" class="el-header-statistics">
|
||||
<el-row :gutter="15">
|
||||
<el-col :lg="24">
|
||||
<el-card shadow="never">
|
||||
<sc-statistic :value="total" group-separator title="总数"></sc-statistic>
|
||||
<sc-statistic :value="statistics.total" group-separator title="总数"></sc-statistic>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-header>
|
||||
<el-header style="height: auto; padding: 0 1rem">
|
||||
<el-header class="el-header-select-filter">
|
||||
<sc-select-filter
|
||||
:data="[
|
||||
{
|
||||
@ -18,7 +18,11 @@
|
||||
options: [
|
||||
{ label: $t('全部'), value: '' },
|
||||
...Object.entries(this.$GLOBAL.enums.siteMsgTypes).map((x) => {
|
||||
return { value: x[0], label: x[1][1] }
|
||||
return {
|
||||
value: x[0],
|
||||
label: x[1][1],
|
||||
badge: this.statistics.msgType?.find((y) => y.key.msgType.toLowerCase() === x[0].toLowerCase())?.value,
|
||||
}
|
||||
}),
|
||||
],
|
||||
},
|
||||
@ -56,10 +60,10 @@
|
||||
:context-menus="['id', 'createdUserName', 'msgType', 'title', 'summary', 'createdTime']"
|
||||
:default-sort="{ prop: 'createdTime', order: 'descending' }"
|
||||
:export-api="$API.sys_sitemsg.export"
|
||||
:on-command="this.getStatistics"
|
||||
:params="query"
|
||||
:query-api="$API.sys_sitemsg.pagedQuery"
|
||||
:vue="this"
|
||||
@data-change="getStatistics"
|
||||
@selection-change="
|
||||
(items) => {
|
||||
selection = items
|
||||
@ -70,7 +74,7 @@
|
||||
remote-sort
|
||||
row-key="id"
|
||||
stripe>
|
||||
<el-table-column type="selection" />
|
||||
<el-table-column type="selection" width="50" />
|
||||
<na-col-id :label="$t('消息编号')" prop="id" sortable="custom" width="170" />
|
||||
<na-col-avatar :label="$t('用户名')" min-width="100" prop="createdUserName" />
|
||||
<na-col-indicator
|
||||
@ -93,7 +97,7 @@
|
||||
icon: 'el-icon-delete',
|
||||
confirm: true,
|
||||
title: '删除消息',
|
||||
click: rowDel,
|
||||
click: this.rowDel,
|
||||
type: 'danger',
|
||||
})
|
||||
"
|
||||
@ -132,7 +136,9 @@ export default {
|
||||
created() {},
|
||||
data() {
|
||||
return {
|
||||
total: '...',
|
||||
statistics: {
|
||||
total: '...',
|
||||
},
|
||||
dialog: {},
|
||||
loading: false,
|
||||
query: {
|
||||
@ -148,8 +154,17 @@ export default {
|
||||
inject: ['reload'],
|
||||
methods: {
|
||||
async getStatistics() {
|
||||
const res = await this.$API.sys_sitemsg.count.post(this.query)
|
||||
this.total = res.data
|
||||
this.statistics.total = this.$refs.table?.total
|
||||
const res = await Promise.all([
|
||||
this.$API.sys_sitemsg.countBy.post({
|
||||
dynamicFilter: {
|
||||
filters: this.query.dynamicFilter.filters,
|
||||
},
|
||||
requiredFields: ['MsgType'],
|
||||
}),
|
||||
])
|
||||
|
||||
this.statistics.msgType = res[0].data
|
||||
},
|
||||
filterChange(data) {
|
||||
Object.entries(data).forEach(([key, value]) => {
|
||||
@ -183,8 +198,7 @@ export default {
|
||||
})
|
||||
}
|
||||
|
||||
this.$refs.table.upData()
|
||||
await this.getStatistics()
|
||||
await this.$refs.table.upData()
|
||||
},
|
||||
},
|
||||
async mounted() {
|
||||
@ -196,7 +210,6 @@ export default {
|
||||
type: 'root',
|
||||
})
|
||||
}
|
||||
await this.getStatistics()
|
||||
},
|
||||
props: ['keywords'],
|
||||
watch: {},
|
||||
|
@ -1,15 +1,15 @@
|
||||
<template>
|
||||
<el-container>
|
||||
<el-header v-loading="total === '...'" style="height: auto; padding: 1rem 1rem 0 1rem; display: block">
|
||||
<el-header v-loading="statistics.total === '...'" class="el-header-statistics">
|
||||
<el-row :gutter="15">
|
||||
<el-col :lg="24">
|
||||
<el-card shadow="never">
|
||||
<sc-statistic :value="total" group-separator title="总数"></sc-statistic>
|
||||
<sc-statistic :value="statistics.total" group-separator title="总数"></sc-statistic>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-header>
|
||||
<el-header style="height: auto; padding: 0 1rem">
|
||||
<el-header class="el-header-select-filter">
|
||||
<sc-select-filter
|
||||
:data="[
|
||||
{
|
||||
@ -17,8 +17,8 @@
|
||||
key: 'enabled',
|
||||
options: [
|
||||
{ label: $t('全部'), value: '' },
|
||||
{ label: $t('启用'), value: true },
|
||||
{ label: $t('禁用'), value: false },
|
||||
{ label: $t('启用'), value: true, badge: statistics.enabled?.find((x) => x.key.enabled === 'True')?.value },
|
||||
{ label: $t('禁用'), value: false, badge: statistics.enabled?.find((x) => x.key.enabled === 'False')?.value },
|
||||
],
|
||||
},
|
||||
{
|
||||
@ -26,8 +26,16 @@
|
||||
key: 'ignorePermissionControl',
|
||||
options: [
|
||||
{ label: $t('全部'), value: '' },
|
||||
{ label: $t('是'), value: true },
|
||||
{ label: $t('否'), value: false },
|
||||
{
|
||||
label: $t('是'),
|
||||
value: true,
|
||||
badge: statistics.ignorePermissionControl?.find((x) => x.key.ignorePermissionControl === 'True')?.value,
|
||||
},
|
||||
{
|
||||
label: $t('否'),
|
||||
value: false,
|
||||
badge: statistics.ignorePermissionControl?.find((x) => x.key.ignorePermissionControl === 'False')?.value,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
@ -35,10 +43,33 @@
|
||||
key: 'displayDashboard',
|
||||
options: [
|
||||
{ label: $t('全部'), value: '' },
|
||||
{ label: $t('是'), value: true },
|
||||
{ label: $t('否'), value: false },
|
||||
{
|
||||
label: $t('是'),
|
||||
value: true,
|
||||
badge: statistics.displayDashboard?.find((x) => x.key.displayDashboard === 'True')?.value,
|
||||
},
|
||||
{
|
||||
label: $t('否'),
|
||||
value: false,
|
||||
badge: statistics.displayDashboard?.find((x) => x.key.displayDashboard === 'False')?.value,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: $t('数据范围'),
|
||||
key: 'dataScope',
|
||||
options: [
|
||||
{ label: $t('全部'), value: '' },
|
||||
...Object.entries(this.$GLOBAL.enums.dataScopes).map((x) => {
|
||||
return {
|
||||
value: x[0],
|
||||
label: x[1][1],
|
||||
badge: this.statistics.dataScope?.find((y) => y.key.dataScope.toLowerCase() === x[0])?.value,
|
||||
}
|
||||
}),
|
||||
],
|
||||
w100p: true,
|
||||
},
|
||||
]"
|
||||
:label-width="15"
|
||||
@on-change="filterChange"
|
||||
@ -87,10 +118,10 @@
|
||||
:context-menus="['id', 'name', 'sort', 'enabled', 'ignorePermissionControl', 'dataScope', 'displayDashboard', 'createdTime']"
|
||||
:default-sort="{ prop: 'sort', order: 'descending' }"
|
||||
:export-api="$API.sys_role.export"
|
||||
:on-command="this.getStatistics"
|
||||
:params="query"
|
||||
:query-api="$API.sys_role.pagedQuery"
|
||||
:vue="this"
|
||||
@data-change="getStatistics"
|
||||
@selection-change="
|
||||
(items) => {
|
||||
selection = items
|
||||
@ -101,7 +132,7 @@
|
||||
remote-sort
|
||||
row-key="id"
|
||||
stripe>
|
||||
<el-table-column type="selection" />
|
||||
<el-table-column type="selection" width="50" />
|
||||
<na-col-id :label="$t('角色编号')" prop="id" sortable="custom" width="170" />
|
||||
<el-table-column :label="$t('角色名称')" min-width="150" prop="name" sortable="custom" />
|
||||
<el-table-column :label="$t('排序')" align="right" prop="sort" sortable="custom" width="100" />
|
||||
@ -146,7 +177,7 @@
|
||||
icon: 'el-icon-delete',
|
||||
confirm: true,
|
||||
title: '删除角色',
|
||||
click: rowDel,
|
||||
click: this.rowDel,
|
||||
type: 'danger',
|
||||
},
|
||||
)
|
||||
@ -186,7 +217,9 @@ export default {
|
||||
created() {},
|
||||
data() {
|
||||
return {
|
||||
total: '...',
|
||||
statistics: {
|
||||
total: '...',
|
||||
},
|
||||
dialog: {},
|
||||
loading: false,
|
||||
query: {
|
||||
@ -208,8 +241,38 @@ export default {
|
||||
inject: ['reload'],
|
||||
methods: {
|
||||
async getStatistics() {
|
||||
const res = await this.$API.sys_role.count.post(this.query)
|
||||
this.total = res.data
|
||||
this.statistics.total = this.$refs.table?.total
|
||||
const res = await Promise.all([
|
||||
this.$API.sys_role.countBy.post({
|
||||
dynamicFilter: {
|
||||
filters: this.query.dynamicFilter.filters,
|
||||
},
|
||||
requiredFields: ['Enabled'],
|
||||
}),
|
||||
this.$API.sys_role.countBy.post({
|
||||
dynamicFilter: {
|
||||
filters: this.query.dynamicFilter.filters,
|
||||
},
|
||||
requiredFields: ['DisplayDashboard'],
|
||||
}),
|
||||
this.$API.sys_role.countBy.post({
|
||||
dynamicFilter: {
|
||||
filters: this.query.dynamicFilter.filters,
|
||||
},
|
||||
requiredFields: ['IgnorePermissionControl'],
|
||||
}),
|
||||
this.$API.sys_role.countBy.post({
|
||||
dynamicFilter: {
|
||||
filters: this.query.dynamicFilter.filters,
|
||||
},
|
||||
requiredFields: ['DataScope'],
|
||||
}),
|
||||
])
|
||||
|
||||
this.statistics.enabled = res[0].data
|
||||
this.statistics.displayDashboard = res[1].data
|
||||
this.statistics.ignorePermissionControl = res[2].data
|
||||
this.statistics.dataScope = res[3].data
|
||||
},
|
||||
async copyRole(row) {
|
||||
const loading = this.$loading()
|
||||
@ -324,8 +387,16 @@ export default {
|
||||
value: form.dy.displayDashboard,
|
||||
})
|
||||
}
|
||||
this.$refs.table.upData()
|
||||
await this.getStatistics()
|
||||
|
||||
if (typeof form.dy.dataScope === 'string' && form.dy.dataScope.trim() !== '') {
|
||||
this.query.dynamicFilter.filters.push({
|
||||
field: 'dataScope',
|
||||
operator: 'eq',
|
||||
value: form.dy.dataScope,
|
||||
})
|
||||
}
|
||||
|
||||
await this.$refs.table.upData()
|
||||
},
|
||||
},
|
||||
async mounted() {
|
||||
@ -345,7 +416,6 @@ export default {
|
||||
type: 'dy',
|
||||
})
|
||||
this.onReset()
|
||||
await this.getStatistics()
|
||||
},
|
||||
props: ['keywords'],
|
||||
watch: {},
|
||||
|
@ -1,15 +1,15 @@
|
||||
<template>
|
||||
<el-container>
|
||||
<el-header v-loading="total === '...'" style="height: auto; padding: 1rem 1rem 0 1rem; display: block">
|
||||
<el-header v-loading="statistics.total === '...'" class="el-header-statistics">
|
||||
<el-row :gutter="15">
|
||||
<el-col :lg="24">
|
||||
<el-card shadow="never">
|
||||
<sc-statistic :value="total" group-separator title="总数"></sc-statistic>
|
||||
<sc-statistic :value="statistics.total" group-separator title="总数"></sc-statistic>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-header>
|
||||
<el-header style="height: auto; padding: 0 1rem">
|
||||
<el-header class="el-header-select-filter">
|
||||
<sc-select-filter
|
||||
:data="[
|
||||
{
|
||||
@ -17,8 +17,8 @@
|
||||
key: 'enabled',
|
||||
options: [
|
||||
{ label: $t('全部'), value: '' },
|
||||
{ label: $t('启用'), value: true },
|
||||
{ label: $t('禁用'), value: false },
|
||||
{ label: $t('启用'), value: true, badge: statistics.enabled?.find((x) => x.key.enabled === 'True')?.value },
|
||||
{ label: $t('禁用'), value: false, badge: statistics.enabled?.find((x) => x.key.enabled === 'False')?.value },
|
||||
],
|
||||
},
|
||||
]"
|
||||
@ -85,10 +85,10 @@
|
||||
:context-opers="['view', 'edit']"
|
||||
:default-sort="{ prop: 'createdTime', order: 'descending' }"
|
||||
:export-api="$API.sys_user.export"
|
||||
:on-command="this.getStatistics"
|
||||
:params="query"
|
||||
:query-api="$API.sys_user.pagedQuery"
|
||||
:vue="this"
|
||||
@data-change="getStatistics"
|
||||
@selection-change="
|
||||
(items) => {
|
||||
selection = items
|
||||
@ -99,7 +99,7 @@
|
||||
remote-sort
|
||||
row-key="id"
|
||||
stripe>
|
||||
<el-table-column type="selection" />
|
||||
<el-table-column type="selection" width="50" />
|
||||
<na-col-id :label="$t('用户编号')" prop="id" sortable="custom" width="170" />
|
||||
<na-col-avatar :label="$t('用户名')" prop="userName" width="170" />
|
||||
<el-table-column :label="$t('手机号')" align="center" prop="mobile" sortable="custom" width="120" />
|
||||
@ -177,7 +177,9 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
total: '...',
|
||||
statistics: {
|
||||
total: '...',
|
||||
},
|
||||
dialog: {},
|
||||
loading: false,
|
||||
query: {
|
||||
@ -199,8 +201,17 @@ export default {
|
||||
inject: ['reload'],
|
||||
methods: {
|
||||
async getStatistics() {
|
||||
const res = await this.$API.sys_user.count.post(this.query)
|
||||
this.total = res.data
|
||||
this.statistics.total = this.$refs.table?.total
|
||||
const res = await Promise.all([
|
||||
this.$API.sys_user.countBy.post({
|
||||
dynamicFilter: {
|
||||
filters: this.query.dynamicFilter.filters,
|
||||
},
|
||||
requiredFields: ['Enabled'],
|
||||
}),
|
||||
])
|
||||
|
||||
this.statistics.enabled = res[0].data
|
||||
},
|
||||
async setEnabled(enabled) {
|
||||
let loading
|
||||
@ -267,8 +278,7 @@ export default {
|
||||
})
|
||||
}
|
||||
|
||||
this.$refs.table.upData()
|
||||
await this.getStatistics()
|
||||
await this.$refs.table.upData()
|
||||
},
|
||||
},
|
||||
async mounted() {
|
||||
@ -288,7 +298,6 @@ export default {
|
||||
type: 'dy',
|
||||
})
|
||||
this.onReset()
|
||||
await this.getStatistics()
|
||||
},
|
||||
props: ['keywords', 'roleId', 'deptId'],
|
||||
watch: {},
|
||||
|
Reference in New Issue
Block a user