下发接口调试完成
This commit is contained in:
parent
e8eafc514e
commit
e1723eb26a
|
|
@ -1,4 +1,5 @@
|
|||
import { service } from '@/http/request'
|
||||
|
||||
// 获取token
|
||||
export const getTokenApi = (data) => {
|
||||
return service.post('/robot-screen-api/getToken', data)
|
||||
|
|
@ -59,26 +60,6 @@ export const deleteTaskApi = (data) => {
|
|||
return service.post('/robot-screen-api/robot/instruct/delTaskData', data)
|
||||
}
|
||||
|
||||
// 新增人员
|
||||
export const addPersonApi = (data) => {
|
||||
return service.post('/robot-screen-api/robot/sbdUser/addSbdUser', data)
|
||||
}
|
||||
|
||||
// 修改人员
|
||||
export const updatePersonApi = (data) => {
|
||||
return service.post('/robot-screen-api/robot/sbdUser/updateSbdUser', data)
|
||||
}
|
||||
|
||||
// 删除人员
|
||||
export const deletePersonApi = (data) => {
|
||||
return service.post('/robot-screen-api/robot/sbdUser/delUser', data)
|
||||
}
|
||||
|
||||
// 人员详情
|
||||
export const getDetailsApi = (data) => {
|
||||
return service.get('/robot-screen-api/robot/sbdUser/getDetails', { params: data })
|
||||
}
|
||||
|
||||
// 现场定点巡检拍照 一级列表
|
||||
export const getImageLimitApi = (data) => {
|
||||
return service.get('/robot-screen-api/robot/image/getImageLimit', { params: data })
|
||||
|
|
@ -118,3 +99,28 @@ export const getUserListPageApi = (data) => {
|
|||
export const getUserInfoListApi = (data) => {
|
||||
return service.get('/robot-screen-api/robot/sbdUser/list', { params: data })
|
||||
}
|
||||
|
||||
// 人员动态 二级级页面人员下发接口
|
||||
export const sendUserImageApi = (data) => {
|
||||
return service.post('/robot-screen-api/robot/sbdUser/sendUserImage', data)
|
||||
}
|
||||
|
||||
// 人员动态 二级级页面 新增人员
|
||||
export const addPersonApi = (data) => {
|
||||
return service.post('/robot-screen-api/robot/sbdUser/addSbdUser', data)
|
||||
}
|
||||
|
||||
// 人员动态 二级级页面 修改人员
|
||||
export const updatePersonApi = (data) => {
|
||||
return service.post('/robot-screen-api/robot/sbdUser/updateSbdUser', data)
|
||||
}
|
||||
|
||||
// 人员动态 二级级页面 删除人员
|
||||
export const deletePersonApi = (data) => {
|
||||
return service.post('/robot-screen-api/robot/sbdUser/delUser', data)
|
||||
}
|
||||
|
||||
// 人员动态 二级级页面 人员详情
|
||||
export const getDetailsApi = (data) => {
|
||||
return service.get('/robot-screen-api/robot/sbdUser/getDetails', { params: data })
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,6 +53,19 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
style="
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
transform: translateY(-100%);
|
||||
"
|
||||
v-if="imgOuterList.length === 0"
|
||||
>
|
||||
<n-empty size="large" description="暂无数据"> </n-empty>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 模态框 -->
|
||||
|
|
|
|||
|
|
@ -336,8 +336,8 @@
|
|||
<n-form-item label="播放类型:">
|
||||
<n-radio-group v-model:value="playParams.playType" name="radiogroup">
|
||||
<n-space>
|
||||
<n-radio :value="0"> 循环播放 </n-radio>
|
||||
<n-radio :value="1"> 次数播放 </n-radio>
|
||||
<n-radio :value="0"> 循环播放 </n-radio>
|
||||
</n-space>
|
||||
</n-radio-group>
|
||||
</n-form-item>
|
||||
|
|
@ -408,7 +408,7 @@ const audioValue = ref('')
|
|||
const audioInfo = ref(null)
|
||||
|
||||
const playParams = ref({
|
||||
playType: 0,
|
||||
playType: 1,
|
||||
playCount: 1,
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -55,6 +55,19 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
style="
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
transform: translateY(-200%);
|
||||
"
|
||||
v-if="outerUserList.length === 0"
|
||||
>
|
||||
<n-empty size="large" description="暂无数据"> </n-empty>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 弹框内容 更多数据 -->
|
||||
|
|
@ -176,13 +189,28 @@
|
|||
v-model:value="innerQueryParams_2.workType"
|
||||
/>
|
||||
</n-form-item>
|
||||
<n-form-item>
|
||||
<n-select
|
||||
clearable
|
||||
placeholder="是否下发"
|
||||
style="width: 240px"
|
||||
:options="isSendOptions"
|
||||
v-model:value="innerQueryParams_2.isSend"
|
||||
/>
|
||||
</n-form-item>
|
||||
|
||||
<n-button type="info" @click="getProjectPersonList"> 查询</n-button>
|
||||
<n-button color="#6E90A9" style="margin-left: 8px" @click="onHandleReset_2">
|
||||
重置
|
||||
</n-button>
|
||||
<n-button type="info" style="margin-left: 10px" @click="onHandleAddPerson">
|
||||
新增项目部人员
|
||||
新增
|
||||
</n-button>
|
||||
<n-button type="info" style="margin-left: 10px" @click="onHandleBatchSend">
|
||||
下发
|
||||
</n-button>
|
||||
<n-button type="info" style="margin-left: 10px" @click="onHandlePartSend">
|
||||
部分下发
|
||||
</n-button>
|
||||
</n-form>
|
||||
|
||||
|
|
@ -326,7 +354,7 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import { NButton, NImage, useMessage, useDialog } from 'naive-ui'
|
||||
import { NButton, NImage, useMessage, useDialog, NCheckbox } from 'naive-ui'
|
||||
import TitleBackground from '@/components/TitleBackground/index.vue'
|
||||
import { ref, onMounted, onUpdated, nextTick, h } from 'vue'
|
||||
import {
|
||||
|
|
@ -337,6 +365,7 @@ import {
|
|||
getDetailsApi,
|
||||
updatePersonApi,
|
||||
deletePersonApi,
|
||||
sendUserImageApi,
|
||||
} from '@/api/home'
|
||||
|
||||
const morePanelVisible = ref(false) // 更多数据弹框
|
||||
|
|
@ -348,10 +377,14 @@ const activeIndex = ref(0) // 当前选中的tab
|
|||
const message = useMessage()
|
||||
const dialog = useDialog()
|
||||
const outerUserList = ref([]) // 外侧一级列表数据
|
||||
const imgPreviewUrl = ref('http://192.168.0.38:21999/robot') // 图片预览地址
|
||||
const imgPreviewUrl = ref('http://192.168.0.38:58080/robot') // 图片预览地址
|
||||
const ranger_1 = ref(null) // 人员动态时间选择器
|
||||
const ranger_2 = ref(null) // 人员信息时间选择器
|
||||
const previewFileList = ref([]) // 预览文件列表
|
||||
const isSendOptions = ref([
|
||||
{ label: '是', value: 1 },
|
||||
{ label: '否', value: 0 },
|
||||
])
|
||||
const addOrEditPersonForm = ref({
|
||||
userName: '', // 姓名
|
||||
mobile: '', // 联系方式
|
||||
|
|
@ -413,6 +446,38 @@ const checkIfShouldScroll = () => {
|
|||
}
|
||||
}
|
||||
|
||||
const onHandleBatchSend = async () => {
|
||||
console.log('批量下发')
|
||||
|
||||
const { data: res } = await sendUserImageApi({
|
||||
ids: 'ALL',
|
||||
})
|
||||
if (res.code == 200) {
|
||||
message.success('下发成功')
|
||||
getProjectPersonList()
|
||||
} else {
|
||||
message.error(res.message)
|
||||
}
|
||||
}
|
||||
const onHandlePartSend = async () => {
|
||||
if (selectList.value.length === 0) {
|
||||
message.warning('请选择要下发的人员')
|
||||
return
|
||||
}
|
||||
|
||||
const { data: res } = await sendUserImageApi({
|
||||
ids: selectList.value.map((item) => item.id).join(','),
|
||||
})
|
||||
if (res.code == 200) {
|
||||
message.success('下发成功')
|
||||
getProjectPersonList()
|
||||
} else {
|
||||
message.error(res.message)
|
||||
}
|
||||
}
|
||||
|
||||
const selectList = ref([])
|
||||
|
||||
const tableData_1 = ref([])
|
||||
const tableTotal_1 = ref(0)
|
||||
const tableColumns_1 = ref([
|
||||
|
|
@ -425,6 +490,7 @@ const tableColumns_1 = ref([
|
|||
return index + 1
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
title: '姓名',
|
||||
key: 'userName',
|
||||
|
|
@ -588,6 +654,7 @@ const innerQueryParams_2 = ref({
|
|||
endDay: '',
|
||||
userName: '',
|
||||
workType: '',
|
||||
isSend: null,
|
||||
})
|
||||
|
||||
const btnList = ref([
|
||||
|
|
@ -602,7 +669,7 @@ const btnList = ref([
|
|||
btnType: 2,
|
||||
},
|
||||
])
|
||||
|
||||
const allSelect = ref(false)
|
||||
const tableData_2 = ref([])
|
||||
const tableTotal_2 = ref(0)
|
||||
const tableColumns_2 = ref([
|
||||
|
|
@ -616,6 +683,52 @@ const tableColumns_2 = ref([
|
|||
},
|
||||
},
|
||||
|
||||
{
|
||||
title: () => {
|
||||
return h(NCheckbox, {
|
||||
checked: allSelect.value,
|
||||
onUpdateChecked: (value) => {
|
||||
allSelect.value = value
|
||||
tableData_2.value.forEach((item) => {
|
||||
item.select = value
|
||||
// 更新selectList
|
||||
if (value) {
|
||||
if (!selectList.value.some((selected) => selected.id === item.id)) {
|
||||
selectList.value.push(item)
|
||||
}
|
||||
} else {
|
||||
selectList.value = selectList.value.filter(
|
||||
(selected) => selected.id !== item.id,
|
||||
)
|
||||
}
|
||||
})
|
||||
},
|
||||
})
|
||||
},
|
||||
key: 'select',
|
||||
align: 'center',
|
||||
width: 55,
|
||||
render(row) {
|
||||
return h(NCheckbox, {
|
||||
checked: row.select,
|
||||
onUpdateChecked: (value) => {
|
||||
row.select = value
|
||||
if (value) {
|
||||
if (!selectList.value.some((item) => item.id === row.id)) {
|
||||
selectList.value.push(row)
|
||||
}
|
||||
} else {
|
||||
selectList.value = selectList.value.filter((item) => item.id !== row.id)
|
||||
}
|
||||
// 更新全选状态
|
||||
allSelect.value =
|
||||
tableData_2.value.length > 0 &&
|
||||
tableData_2.value.every((item) => item.select)
|
||||
},
|
||||
})
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
title: '姓名',
|
||||
key: 'userName',
|
||||
|
|
@ -650,6 +763,22 @@ const tableColumns_2 = ref([
|
|||
return row.sex == 1 ? '男' : '女' || '-'
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '是否下发',
|
||||
key: 'isSend',
|
||||
align: 'center',
|
||||
render(row) {
|
||||
return row.isSend == 1 ? '是' : '否' || '-'
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '数据来源',
|
||||
key: 'dataSource',
|
||||
align: 'center',
|
||||
render(row) {
|
||||
return row.dataSource == 0 ? '新增' : '其他' || '-'
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '人脸照片',
|
||||
key: 'image',
|
||||
|
|
@ -672,6 +801,7 @@ const tableColumns_2 = ref([
|
|||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
width: 160,
|
||||
// 增加编辑和删除
|
||||
render(row) {
|
||||
const buttonS = btnList.value.map((btn) => {
|
||||
|
|
@ -770,6 +900,7 @@ const onHandleReset_2 = () => {
|
|||
endDay: '',
|
||||
userName: '',
|
||||
workType: '',
|
||||
isSend: null,
|
||||
}
|
||||
getProjectPersonList()
|
||||
}
|
||||
|
|
@ -921,7 +1052,7 @@ onUpdated(() => {
|
|||
}
|
||||
|
||||
.more-panel-card {
|
||||
width: 70%;
|
||||
width: 80%;
|
||||
height: 90vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
|
|
|||
Loading…
Reference in New Issue