diff --git a/src/store/modules/websocket.ts b/src/store/modules/websocket.ts
index 17f6d1c..9ac4510 100644
--- a/src/store/modules/websocket.ts
+++ b/src/store/modules/websocket.ts
@@ -6,7 +6,7 @@
{
state: () => ({
wsUrl: `ws://${import.meta.env.VITE_APP_API_BASEURL.split('://')[1]}/websocket/${useUserStore().id}`,
- websocket: '', // ws连接
+ websocket: null, // ws连接
wsStatus: false, // websocket连接状态 true为连接
wsPingTimer: null, // 心跳定时器
wsPingTime: 60000, // 心跳定时时长
@@ -59,6 +59,7 @@
}
// 监听socket消息接收s
socket.onmessage = (msg) => {
+ console.log(msg, 'websocket初始')
// 转换为json对象
const data = JSON.parse(msg.data)
console.log(data, 'websocket 返回消息')
@@ -93,7 +94,9 @@
// 断开websocket
destroyWebSocket() {
this.wsIsReconnect = false
- this.websocket.close()
+ if (this.websocket) {
+ this.websocket.close()
+ }
if (this.wsPingTimer) {
console.log('停止定时器')
clearInterval(this.wsPingTimer)
diff --git a/src/views/measure/person/components/addPerson.vue b/src/views/measure/person/components/addPerson.vue
index 733efc3..c750426 100644
--- a/src/views/measure/person/components/addPerson.vue
+++ b/src/views/measure/person/components/addPerson.vue
@@ -761,7 +761,7 @@
-
+
diff --git a/src/views/measure/person/components/userListDialog.vue b/src/views/measure/person/components/userListDialog.vue
index 91058ac..303f239 100644
--- a/src/views/measure/person/components/userListDialog.vue
+++ b/src/views/measure/person/components/userListDialog.vue
@@ -8,6 +8,12 @@
import { toTreeList } from '@/utils/structure'
import type { TableColumn } from '@/components/NormalTable/table_interface'
+const props = defineProps({
+ needAdmin: { // 是否展示admin用户
+ type: Boolean,
+ default: true,
+ },
+})
const emits = defineEmits(['add'])
const dialogFormVisible = ref(false)
// 查询条件
@@ -43,8 +49,14 @@
select.value = -1
getUserList(listQuery.value).then((res) => {
if (res.code === 200) {
- list.value = res.data.rows
- total.value = res.data.total
+ if (props.needAdmin) {
+ list.value = res.data.rows
+ total.value = res.data.total
+ }
+ else {
+ list.value = res.data.rows.filter((item: any) => item.account !== 'admin')
+ total.value = res.data.total - 1
+ }
}
})
}
diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue
index 13377a4..130ee5d 100644
--- a/src/layouts/components/Tools/index.vue
+++ b/src/layouts/components/Tools/index.vue
@@ -30,6 +30,10 @@
{ id: '2', message: '收到一条证书到期提醒', time: '2022-07-20 18:32:00' },
{ id: '3', message: '有新的借用申请待审批', time: '2022-07-20 18:32:00' },
{ id: '4', message: '您的请假申请已通过', time: '2022-07-20 18:32:00' },
+ { id: '1', message: '示例消息', time: '2022-07-20 18:32:00' },
+ { id: '2', message: '收到一条证书到期提醒', time: '2022-07-20 18:32:00' },
+ { id: '3', message: '有新的借用申请待审批', time: '2022-07-20 18:32:00' },
+ { id: '4', message: '您的请假申请已通过', time: '2022-07-20 18:32:00' },
]
function userCommand(command: 'dashboard' | 'resetPassword' | 'setting' | 'hotkeys' | 'logout') {
@@ -66,6 +70,10 @@
// 连接 websocket
websocket.initWebSocket()
})
+onBeforeMount(() => {
+ // 断开 websocket
+ // websocket.destroyWebSocket()
+})
@@ -110,7 +118,7 @@
-
消息({{ messageList.length }})
+
消息({{ messageList.length }})
diff --git a/src/store/modules/websocket.ts b/src/store/modules/websocket.ts
index 17f6d1c..9ac4510 100644
--- a/src/store/modules/websocket.ts
+++ b/src/store/modules/websocket.ts
@@ -6,7 +6,7 @@
{
state: () => ({
wsUrl: `ws://${import.meta.env.VITE_APP_API_BASEURL.split('://')[1]}/websocket/${useUserStore().id}`,
- websocket: '', // ws连接
+ websocket: null, // ws连接
wsStatus: false, // websocket连接状态 true为连接
wsPingTimer: null, // 心跳定时器
wsPingTime: 60000, // 心跳定时时长
@@ -59,6 +59,7 @@
}
// 监听socket消息接收s
socket.onmessage = (msg) => {
+ console.log(msg, 'websocket初始')
// 转换为json对象
const data = JSON.parse(msg.data)
console.log(data, 'websocket 返回消息')
@@ -93,7 +94,9 @@
// 断开websocket
destroyWebSocket() {
this.wsIsReconnect = false
- this.websocket.close()
+ if (this.websocket) {
+ this.websocket.close()
+ }
if (this.wsPingTimer) {
console.log('停止定时器')
clearInterval(this.wsPingTimer)
diff --git a/src/views/measure/person/components/addPerson.vue b/src/views/measure/person/components/addPerson.vue
index 733efc3..c750426 100644
--- a/src/views/measure/person/components/addPerson.vue
+++ b/src/views/measure/person/components/addPerson.vue
@@ -761,7 +761,7 @@
-
+
diff --git a/src/views/measure/person/components/userListDialog.vue b/src/views/measure/person/components/userListDialog.vue
index 91058ac..303f239 100644
--- a/src/views/measure/person/components/userListDialog.vue
+++ b/src/views/measure/person/components/userListDialog.vue
@@ -8,6 +8,12 @@
import { toTreeList } from '@/utils/structure'
import type { TableColumn } from '@/components/NormalTable/table_interface'
+const props = defineProps({
+ needAdmin: { // 是否展示admin用户
+ type: Boolean,
+ default: true,
+ },
+})
const emits = defineEmits(['add'])
const dialogFormVisible = ref(false)
// 查询条件
@@ -43,8 +49,14 @@
select.value = -1
getUserList(listQuery.value).then((res) => {
if (res.code === 200) {
- list.value = res.data.rows
- total.value = res.data.total
+ if (props.needAdmin) {
+ list.value = res.data.rows
+ total.value = res.data.total
+ }
+ else {
+ list.value = res.data.rows.filter((item: any) => item.account !== 'admin')
+ total.value = res.data.total - 1
+ }
}
})
}
diff --git a/src/views/system/tool/fileConfiguration/addDDialog.vue b/src/views/system/tool/fileConfiguration/addDDialog.vue
index 69b5832..469f2ae 100644
--- a/src/views/system/tool/fileConfiguration/addDDialog.vue
+++ b/src/views/system/tool/fileConfiguration/addDDialog.vue
@@ -5,10 +5,8 @@
import dayjs from 'dayjs'
import showPhoto from '../showPhoto.vue'
import { getDictByCode } from '@/api/system/dict'
-import userListComp from '@/views/measure/person/components/userListDialog.vue'
-import { getUserList } from '@/api/system/user'
import { uploadApi } from '@/api/system/notice'
-import { addeFileListPage } from '@/api/system/tool'
+import { addeFileListPage, updateFileListPage } from '@/api/system/tool'
const emits = defineEmits(['resetData'])
const ruleFormRef = ref
() // from组件
const updateTime = ref('')
@@ -85,18 +83,25 @@
type: 'success',
message: '添加成功',
})
+ close()
})
}
else {
- console.log('编辑')
+ updateFileListPage(ruleForm.value).then((res) => {
+ ElMessage({
+ type: 'success',
+ message: '修改成功',
+ })
+ close()
+ })
}
}
})
}
// 获取文件类型
-const fileTypeList = ref([])
+const fileTypeList = ref([])
const getFileType = () => {
- getDictByCode('').then((res) => {
+ getDictByCode('configFileType').then((res) => {
fileTypeList.value = res.data
})
}
@@ -126,7 +131,7 @@
uploadApi(fd).then((res) => {
if (res.code === 200) {
ruleFormRef.value?.clearValidate('minioFileName')
- ruleForm.minioFileName = res.data[0]
+ ruleForm.value.minioFileName = res.data[0]
ElMessage.success('上传成功')
}
else {
@@ -141,15 +146,15 @@
-
+
-
-
+
+
-
+
@@ -159,10 +164,11 @@
-->
-
+
-
+
-
+
-
+
@@ -199,10 +205,10 @@
-
+
-
+
{{ ruleForm.minioFileName === '' ? '上传' : '更换附件' }}
@@ -220,8 +226,6 @@
-
-
diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue
index 13377a4..130ee5d 100644
--- a/src/layouts/components/Tools/index.vue
+++ b/src/layouts/components/Tools/index.vue
@@ -30,6 +30,10 @@
{ id: '2', message: '收到一条证书到期提醒', time: '2022-07-20 18:32:00' },
{ id: '3', message: '有新的借用申请待审批', time: '2022-07-20 18:32:00' },
{ id: '4', message: '您的请假申请已通过', time: '2022-07-20 18:32:00' },
+ { id: '1', message: '示例消息', time: '2022-07-20 18:32:00' },
+ { id: '2', message: '收到一条证书到期提醒', time: '2022-07-20 18:32:00' },
+ { id: '3', message: '有新的借用申请待审批', time: '2022-07-20 18:32:00' },
+ { id: '4', message: '您的请假申请已通过', time: '2022-07-20 18:32:00' },
]
function userCommand(command: 'dashboard' | 'resetPassword' | 'setting' | 'hotkeys' | 'logout') {
@@ -66,6 +70,10 @@
// 连接 websocket
websocket.initWebSocket()
})
+onBeforeMount(() => {
+ // 断开 websocket
+ // websocket.destroyWebSocket()
+})
@@ -110,7 +118,7 @@
-
消息({{ messageList.length }})
+
消息({{ messageList.length }})
diff --git a/src/store/modules/websocket.ts b/src/store/modules/websocket.ts
index 17f6d1c..9ac4510 100644
--- a/src/store/modules/websocket.ts
+++ b/src/store/modules/websocket.ts
@@ -6,7 +6,7 @@
{
state: () => ({
wsUrl: `ws://${import.meta.env.VITE_APP_API_BASEURL.split('://')[1]}/websocket/${useUserStore().id}`,
- websocket: '', // ws连接
+ websocket: null, // ws连接
wsStatus: false, // websocket连接状态 true为连接
wsPingTimer: null, // 心跳定时器
wsPingTime: 60000, // 心跳定时时长
@@ -59,6 +59,7 @@
}
// 监听socket消息接收s
socket.onmessage = (msg) => {
+ console.log(msg, 'websocket初始')
// 转换为json对象
const data = JSON.parse(msg.data)
console.log(data, 'websocket 返回消息')
@@ -93,7 +94,9 @@
// 断开websocket
destroyWebSocket() {
this.wsIsReconnect = false
- this.websocket.close()
+ if (this.websocket) {
+ this.websocket.close()
+ }
if (this.wsPingTimer) {
console.log('停止定时器')
clearInterval(this.wsPingTimer)
diff --git a/src/views/measure/person/components/addPerson.vue b/src/views/measure/person/components/addPerson.vue
index 733efc3..c750426 100644
--- a/src/views/measure/person/components/addPerson.vue
+++ b/src/views/measure/person/components/addPerson.vue
@@ -761,7 +761,7 @@
-
+
diff --git a/src/views/measure/person/components/userListDialog.vue b/src/views/measure/person/components/userListDialog.vue
index 91058ac..303f239 100644
--- a/src/views/measure/person/components/userListDialog.vue
+++ b/src/views/measure/person/components/userListDialog.vue
@@ -8,6 +8,12 @@
import { toTreeList } from '@/utils/structure'
import type { TableColumn } from '@/components/NormalTable/table_interface'
+const props = defineProps({
+ needAdmin: { // 是否展示admin用户
+ type: Boolean,
+ default: true,
+ },
+})
const emits = defineEmits(['add'])
const dialogFormVisible = ref(false)
// 查询条件
@@ -43,8 +49,14 @@
select.value = -1
getUserList(listQuery.value).then((res) => {
if (res.code === 200) {
- list.value = res.data.rows
- total.value = res.data.total
+ if (props.needAdmin) {
+ list.value = res.data.rows
+ total.value = res.data.total
+ }
+ else {
+ list.value = res.data.rows.filter((item: any) => item.account !== 'admin')
+ total.value = res.data.total - 1
+ }
}
})
}
diff --git a/src/views/system/tool/fileConfiguration/addDDialog.vue b/src/views/system/tool/fileConfiguration/addDDialog.vue
index 69b5832..469f2ae 100644
--- a/src/views/system/tool/fileConfiguration/addDDialog.vue
+++ b/src/views/system/tool/fileConfiguration/addDDialog.vue
@@ -5,10 +5,8 @@
import dayjs from 'dayjs'
import showPhoto from '../showPhoto.vue'
import { getDictByCode } from '@/api/system/dict'
-import userListComp from '@/views/measure/person/components/userListDialog.vue'
-import { getUserList } from '@/api/system/user'
import { uploadApi } from '@/api/system/notice'
-import { addeFileListPage } from '@/api/system/tool'
+import { addeFileListPage, updateFileListPage } from '@/api/system/tool'
const emits = defineEmits(['resetData'])
const ruleFormRef = ref
() // from组件
const updateTime = ref('')
@@ -85,18 +83,25 @@
type: 'success',
message: '添加成功',
})
+ close()
})
}
else {
- console.log('编辑')
+ updateFileListPage(ruleForm.value).then((res) => {
+ ElMessage({
+ type: 'success',
+ message: '修改成功',
+ })
+ close()
+ })
}
}
})
}
// 获取文件类型
-const fileTypeList = ref([])
+const fileTypeList = ref([])
const getFileType = () => {
- getDictByCode('').then((res) => {
+ getDictByCode('configFileType').then((res) => {
fileTypeList.value = res.data
})
}
@@ -126,7 +131,7 @@
uploadApi(fd).then((res) => {
if (res.code === 200) {
ruleFormRef.value?.clearValidate('minioFileName')
- ruleForm.minioFileName = res.data[0]
+ ruleForm.value.minioFileName = res.data[0]
ElMessage.success('上传成功')
}
else {
@@ -141,15 +146,15 @@
-
+
-
-
+
+
-
+
@@ -159,10 +164,11 @@
-->
-
+
-
+
-
+
-
+
@@ -199,10 +205,10 @@
-
+
-
+
{{ ruleForm.minioFileName === '' ? '上传' : '更换附件' }}
@@ -220,8 +226,6 @@
-
-
diff --git a/src/views/system/tool/fileConfiguration/configuration.vue b/src/views/system/tool/fileConfiguration/configuration.vue
index 21b4230..d699e65 100644
--- a/src/views/system/tool/fileConfiguration/configuration.vue
+++ b/src/views/system/tool/fileConfiguration/configuration.vue
@@ -1,12 +1,9 @@