修改后台管理初始化查询逻辑
parent
ff270ee0c1
commit
3761fc833d
|
@ -64,6 +64,7 @@ export default {
|
|||
}
|
||||
},
|
||||
mounted() {
|
||||
window.mtree = this
|
||||
this.modelTrees = [
|
||||
{
|
||||
title: '项目模型',
|
||||
|
@ -140,15 +141,24 @@ export default {
|
|||
onCheckTree(heckedKeys, e) {
|
||||
const checkNode = e.node.dataRef
|
||||
const checked = e.checked
|
||||
const halfChecked = e.node.halfChecked
|
||||
if (checkNode.type == 'root') {
|
||||
if (checked) {
|
||||
checkNode.children.forEach((m) => {
|
||||
if (halfChecked) {
|
||||
if (api.m_model.has(m.modelId)) {
|
||||
api.Model.remove(m.modelId)
|
||||
}
|
||||
this.addModel(m.modelId)
|
||||
this.$emit('change')
|
||||
} else {
|
||||
if (api.m_model.has(m.modelId)) {
|
||||
api.Model.setVisible(m.modelId, true)
|
||||
this.$emit('change')
|
||||
} else {
|
||||
this.addModel(m.modelId)
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
if (api.m_model.size == 0) {
|
||||
|
@ -156,7 +166,7 @@ export default {
|
|||
}
|
||||
checkNode.children.forEach((m) => {
|
||||
if (api.m_model.has(m.modelId)) {
|
||||
api.Model.setVisible(m.modelId, false)
|
||||
api.Model.remove(m.modelId)
|
||||
this.$emit('change')
|
||||
}
|
||||
})
|
||||
|
@ -165,15 +175,23 @@ export default {
|
|||
}
|
||||
if (checkNode.type == 'model') {
|
||||
if (checked) {
|
||||
if (halfChecked) {
|
||||
if (api.m_model.has(checkNode.modelId)) {
|
||||
api.Model.remove(checkNode.modelId)
|
||||
}
|
||||
this.addModel(checkNode.modelId)
|
||||
this.$emit('change')
|
||||
} else {
|
||||
if (api.m_model.has(checkNode.modelId)) {
|
||||
api.Model.setVisible(checkNode.modelId, true)
|
||||
this.$emit('change')
|
||||
} else {
|
||||
this.addModel(checkNode.modelId)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (api.m_model.has(checkNode.modelId)) {
|
||||
api.Model.setVisible(checkNode.modelId, false)
|
||||
api.Model.remove(checkNode.modelId)
|
||||
this.$emit('change')
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
</el-form-item>
|
||||
<el-form-item label="所属单位" prop="subDeptId">
|
||||
<el-select v-model="queryParams.subDeptId" style="width:192px;" placeholder="请选择所属单位" clearable @change="()=>{handleQuery();subDeptChange();}">
|
||||
<el-option v-for="(it, idx) in data.subdepts" :key="it.id" :label="it.subDeptName" :value="it.id" />
|
||||
<el-option v-for="(it) in data.subdepts" :key="it.id" :label="it.subDeptName" :value="it.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="姓名" prop="userName">
|
||||
|
@ -229,6 +229,7 @@ function getProjectList() {
|
|||
/** 查询考勤管理列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
queryParams.value.projectId = userStore.currentPrjId;
|
||||
listAttendanceUbiData(queryParams.value).then(response => {
|
||||
attendanceUbiDataList.value = response.rows;
|
||||
total.value = response.total;
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<el-form-item label="所属单位" prop="subDeptId">
|
||||
<el-select v-model="queryParams.subDeptId" style="width:192px;" placeholder="请选择所属单位" clearable
|
||||
@change="() => { handleQuery(); }">
|
||||
<el-option v-for="(it, idx) in data.subdepts" :key="it.id" :label="it.subDeptName" :value="it.id" />
|
||||
<el-option v-for="(it) in data.subdepts" :key="it.id" :label="it.subDeptName" :value="it.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="显示方式" prop="showType">
|
||||
|
@ -131,6 +131,7 @@ function handleExport(){
|
|||
}
|
||||
|
||||
function getList() {
|
||||
queryParams.value.projectId=userStore.currentPrjId;
|
||||
let queryData={
|
||||
pageNum:queryParams.value.pageNum,
|
||||
pageSize:queryParams.value.pageSize,
|
||||
|
|
|
@ -262,6 +262,7 @@ function getProjectList() {
|
|||
/** 查询考勤配置列表 */
|
||||
function getList() {
|
||||
loading.value = true
|
||||
queryParams.value.projectId = userStore.currentPrjId
|
||||
listAttendance_cfg(queryParams.value).then((response) => {
|
||||
attendance_cfgList.value = (response.rows || []).map((it) => {
|
||||
it.info = proxy.$tryToJson(it.vendorsParameter)
|
||||
|
|
|
@ -1,12 +1,9 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="90px">
|
||||
|
||||
<el-form-item label="项目" prop="projectId">
|
||||
<el-select :disabled="data.currentPrjId != ''" v-model="queryParams.projectId" placeholder="请选择项目" clearable
|
||||
@change="handleQuery">
|
||||
<el-option v-for="prj in data.projects" :key="prj.id" :label="prj.projectName" :value="prj.id">
|
||||
</el-option>
|
||||
<el-select :disabled="data.currentPrjId != ''" v-model="queryParams.projectId" placeholder="请选择项目" clearable @change="handleQuery">
|
||||
<el-option v-for="prj in data.projects" :key="prj.id" :label="prj.projectName" :value="prj.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="name">
|
||||
|
@ -26,26 +23,21 @@
|
|||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd"
|
||||
v-hasPermi="['manage:attendance_ubi_device:add']">新增</el-button>
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['manage:attendance_ubi_device:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate"
|
||||
v-hasPermi="['manage:attendance_ubi_device:edit']">修改</el-button>
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate" v-hasPermi="['manage:attendance_ubi_device:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete"
|
||||
v-hasPermi="['manage:attendance_ubi_device:remove']">删除</el-button>
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete" v-hasPermi="['manage:attendance_ubi_device:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport"
|
||||
v-hasPermi="['manage:attendance_ubi_device:export']">导出</el-button>
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['manage:attendance_ubi_device:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="attendance_ubi_deviceList" @selection-change="handleSelectionChange">
|
||||
|
||||
<el-table-column label="公司" align="center" prop="compName" />
|
||||
<el-table-column label="所属项目" align="center" prop="projectName" />
|
||||
<el-table-column label="设备名称" align="center" prop="name" />
|
||||
|
@ -85,23 +77,19 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="150">
|
||||
<template #default="scope">111
|
||||
<el-button link type="primary" icon="ChromeFilled" @click="handleAuth(scope.row)"
|
||||
v-hasPermi="['manage:attendance_ubi_device:edit']">同步</el-button>
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['manage:attendance_ubi_device:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['manage:attendance_ubi_device:remove']">删除</el-button>
|
||||
<template #default="scope">
|
||||
111
|
||||
<el-button link type="primary" icon="ChromeFilled" @click="handleAuth(scope.row)" v-hasPermi="['manage:attendance_ubi_device:edit']">同步</el-button>
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['manage:attendance_ubi_device:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['manage:attendance_ubi_device:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<!-- 添加或修改宇泛的设备信息对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="600px" append-to-body :close-on-click-modal="false"
|
||||
:close-on-press-escape="false">
|
||||
<el-dialog :title="title" v-model="open" width="600px" append-to-body :close-on-click-modal="false" :close-on-press-escape="false">
|
||||
<el-form ref="attendance_ubi_deviceRef" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="所属项目">
|
||||
<el-tag effect="plain">{{ form.projectName }}</el-tag>
|
||||
|
@ -114,9 +102,7 @@
|
|||
</el-form-item>
|
||||
<el-form-item label="设备来源" prop="source">
|
||||
<el-select v-model="form.source" placeholder="请选择设备来源" clearable>
|
||||
<el-option
|
||||
v-for="dict in ubi_device_source"
|
||||
:key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
<el-option v-for="dict in ubi_device_source" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备序列号" prop="deviceNo">
|
||||
|
@ -137,22 +123,28 @@
|
|||
</template>
|
||||
|
||||
<script setup name="Attendance_ubi_device">
|
||||
import { listAttendance_ubi_device, getAttendance_ubi_device, delAttendance_ubi_device, addAttendance_ubi_device,
|
||||
updateAttendance_ubi_device,authAttendance_ubi_device } from "@/api/manage/attendanceubidevice";
|
||||
import {
|
||||
listAttendance_ubi_device,
|
||||
getAttendance_ubi_device,
|
||||
delAttendance_ubi_device,
|
||||
addAttendance_ubi_device,
|
||||
updateAttendance_ubi_device,
|
||||
authAttendance_ubi_device,
|
||||
} from '@/api/manage/attendanceubidevice'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import { findMyProjectList } from "@/api/publics";
|
||||
const { proxy } = getCurrentInstance();
|
||||
import { findMyProjectList } from '@/api/publics'
|
||||
const { proxy } = getCurrentInstance()
|
||||
const userStore = useUserStore()
|
||||
const {ubi_device_source}=proxy.useDict('ubi_device_source');
|
||||
const attendance_ubi_deviceList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
const { ubi_device_source } = proxy.useDict('ubi_device_source')
|
||||
const attendance_ubi_deviceList = ref([])
|
||||
const open = ref(false)
|
||||
const loading = ref(true)
|
||||
const showSearch = ref(true)
|
||||
const ids = ref([])
|
||||
const single = ref(true)
|
||||
const multiple = ref(true)
|
||||
const total = ref(0)
|
||||
const title = ref('')
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
|
@ -181,54 +173,55 @@ const data = reactive({
|
|||
isDel: null,
|
||||
},
|
||||
rules: {
|
||||
name: [{ required: true, trigger: ['blur', 'change'], message: "请输入设备名称" }],
|
||||
tag: [{ required: true, trigger: ['blur', 'change'], message: "请输入设备标签" }],
|
||||
source: [{ required: true, trigger: ['blur', 'change'], message: "请选择设备来源" }],
|
||||
deviceNo: [{ required: true, trigger: ['blur', 'change'], message: "请输入设备序列号" }],
|
||||
name: [{ required: true, trigger: ['blur', 'change'], message: '请输入设备名称' }],
|
||||
tag: [{ required: true, trigger: ['blur', 'change'], message: '请输入设备标签' }],
|
||||
source: [{ required: true, trigger: ['blur', 'change'], message: '请选择设备来源' }],
|
||||
deviceNo: [{ required: true, trigger: ['blur', 'change'], message: '请输入设备序列号' }],
|
||||
},
|
||||
projects: [],
|
||||
currentPrjId: '',
|
||||
mode: '',
|
||||
});
|
||||
})
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
const { queryParams, form, rules } = toRefs(data)
|
||||
/**
|
||||
* 设备人员同步
|
||||
*/
|
||||
function handleAuth(row) {
|
||||
authAttendance_ubi_device(row).then(d=>{
|
||||
authAttendance_ubi_device(row).then((d) => {
|
||||
if (d.code == 200) {
|
||||
proxy.$modal.msgSuccess("同步成功!");
|
||||
proxy.$modal.msgSuccess('同步成功!')
|
||||
} else {
|
||||
proxy.$modal.msgError("同步失败!");
|
||||
proxy.$modal.msgError('同步失败!')
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
/** 查询项目列表 */
|
||||
function getProjectList() {
|
||||
findMyProjectList({ pageNum: 1, pageSize: 100 }).then(response => {
|
||||
data.projects = response.rows;
|
||||
findMyProjectList({ pageNum: 1, pageSize: 100 }).then((response) => {
|
||||
data.projects = response.rows
|
||||
if (userStore.currentPrjId) {
|
||||
queryParams.value.projectId = userStore.currentPrjId
|
||||
data.currentPrjId = userStore.currentPrjId;
|
||||
data.currentPrjId = userStore.currentPrjId
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
/** 查询宇泛的设备信息列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listAttendance_ubi_device(queryParams.value).then(response => {
|
||||
attendance_ubi_deviceList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
loading.value = true
|
||||
queryParams.value.projectId = userStore.currentPrjId
|
||||
listAttendance_ubi_device(queryParams.value).then((response) => {
|
||||
attendance_ubi_deviceList.value = response.rows
|
||||
total.value = response.total
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
open.value = false
|
||||
reset()
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
|
@ -239,7 +232,7 @@ function reset() {
|
|||
projectId: null,
|
||||
name: null,
|
||||
tag: null,
|
||||
sceneGuid: "",
|
||||
sceneGuid: '',
|
||||
source: null,
|
||||
deviceNo: null,
|
||||
addition: null,
|
||||
|
@ -259,99 +252,107 @@ function reset() {
|
|||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
};
|
||||
proxy.resetForm("attendance_ubi_deviceRef");
|
||||
updateTime: null,
|
||||
}
|
||||
proxy.resetForm('attendance_ubi_deviceRef')
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
queryParams.value.pageNum = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
proxy.resetForm('queryRef')
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
ids.value = selection.map((item) => item.id)
|
||||
single.value = selection.length != 1
|
||||
multiple.value = !selection.length
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
if (!userStore.currentPrjId) {
|
||||
proxy.$modal.msgWarning("请切换到项目数据!!!");
|
||||
return false;
|
||||
proxy.$modal.msgWarning('请切换到项目数据!!!')
|
||||
return false
|
||||
}
|
||||
reset();
|
||||
form.value.projectId = userStore.currentPrjId;
|
||||
form.value.projectName = userStore.currentProName;
|
||||
form.value.source=ubi_device_source.value[0].value;
|
||||
open.value = true;
|
||||
title.value = "添加宇泛的设备信息";
|
||||
reset()
|
||||
form.value.projectId = userStore.currentPrjId
|
||||
form.value.projectName = userStore.currentProName
|
||||
form.value.source = ubi_device_source.value[0].value
|
||||
open.value = true
|
||||
title.value = '添加宇泛的设备信息'
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
if (!userStore.currentPrjId) {
|
||||
proxy.$modal.msgWarning("请切换到项目数据!!!");
|
||||
return false;
|
||||
proxy.$modal.msgWarning('请切换到项目数据!!!')
|
||||
return false
|
||||
}
|
||||
reset();
|
||||
reset()
|
||||
const _id = row.id || ids.value
|
||||
getAttendance_ubi_device(_id).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改宇泛的设备信息";
|
||||
});
|
||||
getAttendance_ubi_device(_id).then((response) => {
|
||||
form.value = response.data
|
||||
open.value = true
|
||||
title.value = '修改宇泛的设备信息'
|
||||
})
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["attendance_ubi_deviceRef"].validate(valid => {
|
||||
proxy.$refs['attendance_ubi_deviceRef'].validate((valid) => {
|
||||
if (valid) {
|
||||
form.value.comId=userStore.currentComId;
|
||||
form.value.comId = userStore.currentComId
|
||||
if (form.value.id != null) {
|
||||
updateAttendance_ubi_device(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
updateAttendance_ubi_device(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess('修改成功')
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
} else {
|
||||
addAttendance_ubi_device(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
addAttendance_ubi_device(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess('新增成功')
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _ids = row.id || ids.value;
|
||||
proxy.$modal.confirm('是否确认删除宇泛的设备信息编号为"' + _ids + '"的数据项?').then(function () {
|
||||
return delAttendance_ubi_device(_ids);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => { });
|
||||
const _ids = row.id || ids.value
|
||||
proxy.$modal
|
||||
.confirm('是否确认删除宇泛的设备信息编号为"' + _ids + '"的数据项?')
|
||||
.then(function () {
|
||||
return delAttendance_ubi_device(_ids)
|
||||
})
|
||||
.then(() => {
|
||||
getList()
|
||||
proxy.$modal.msgSuccess('删除成功')
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('manage/attendance_ubi_device/export', {
|
||||
...queryParams.value
|
||||
}, `attendance_ubi_device_${new Date().getTime()}.xlsx`)
|
||||
proxy.download(
|
||||
'manage/attendance_ubi_device/export',
|
||||
{
|
||||
...queryParams.value,
|
||||
},
|
||||
`attendance_ubi_device_${new Date().getTime()}.xlsx`
|
||||
)
|
||||
}
|
||||
|
||||
getList();
|
||||
getProjectList();
|
||||
getList()
|
||||
getProjectList()
|
||||
</script>
|
||||
|
|
|
@ -108,6 +108,7 @@ const { queryParams, form, rules } = toRefs(data);
|
|||
/** 查询项目里程碑列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
queryParams.value.projectId = userStore.currentPrjId;
|
||||
listMilestone(queryParams.value).then(response => {
|
||||
data.milestoneList = response.rows;
|
||||
total.value = response.total;
|
||||
|
|
|
@ -1,29 +1,11 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryRef"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="项目名称" prop="projectName" v-if="!userStore.currentPrjId">
|
||||
<el-input
|
||||
v-model="queryParams.projectName"
|
||||
placeholder="请输入项目名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.projectName" placeholder="请输入项目名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" style="width: 308px">
|
||||
<el-date-picker
|
||||
v-model="daterangeCreateDate"
|
||||
value-format="YYYY-MM-DD"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
></el-date-picker>
|
||||
<el-date-picker v-model="daterangeCreateDate" value-format="YYYY-MM-DD" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
|
@ -33,58 +15,21 @@
|
|||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['manage:photography:add']"
|
||||
>新增</el-button
|
||||
>
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['manage:photography:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['manage:photography:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate" v-hasPermi="['manage:photography:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['manage:photography:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete" v-hasPermi="['manage:photography:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['manage:photography:export']"
|
||||
>导出</el-button
|
||||
>
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['manage:photography:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="photographyList"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table v-loading="loading" :data="photographyList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="所属公司" align="center" prop="comName" />
|
||||
<el-table-column label="项目名称" align="center" prop="projectName" />
|
||||
|
@ -96,20 +41,14 @@
|
|||
<el-table-column label="视频路径" align="center" prop="videoUrl">
|
||||
<template #default="scope">
|
||||
<video height="100" controls :key="scope.row.videoUrl" v-if="scope.row.videoUrl">
|
||||
<source :src="scope.row.videoUrl" type="video/mp4" />
|
||||
您的浏览器不支持Video标签。
|
||||
<source :src="scope.row.videoUrl" type="video/mp4" />您的浏览器不支持Video标签。
|
||||
</video>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否启用" align="center" prop="state">
|
||||
<template #default="scope">
|
||||
<el-tooltip :content="scope.row.state == 0 ? '启用' : '停用'" placement="top">
|
||||
<el-switch
|
||||
:active-value="parseInt(0)"
|
||||
:inactive-value="parseInt(1)"
|
||||
v-model="scope.row.state"
|
||||
@change="setStatus($event, scope.row)"
|
||||
/>
|
||||
<el-switch :active-value="parseInt(0)" :inactive-value="parseInt(1)" v-model="scope.row.state" @change="setStatus($event, scope.row)" />
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -120,33 +59,13 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="250" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['manage:photography:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['manage:photography:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['manage:photography:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['manage:photography:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<!-- 添加或修改项目全景对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="680px" append-to-body>
|
||||
|
@ -161,14 +80,7 @@
|
|||
<file-upload v-model="form.videoUrl" :limit="1" :fileType="['mp4']" :fileSize="500" />
|
||||
</el-form-item>
|
||||
<el-form-item label="视频日期" prop="videoDate">
|
||||
<el-date-picker
|
||||
clearable
|
||||
v-model="form.videoDate"
|
||||
type="month"
|
||||
value-format="YYYY-MM"
|
||||
placeholder="请选择视频日期"
|
||||
>
|
||||
</el-date-picker>
|
||||
<el-date-picker clearable v-model="form.videoDate" type="month" value-format="YYYY-MM" placeholder="请选择视频日期"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
|
@ -182,28 +94,22 @@
|
|||
</template>
|
||||
|
||||
<script setup name="Photography">
|
||||
import {
|
||||
listPhotography,
|
||||
getPhotography,
|
||||
delPhotography,
|
||||
addPhotography,
|
||||
updatePhotography,
|
||||
} from "@/api/manage/photography";
|
||||
import { listPhotography, getPhotography, delPhotography, addPhotography, updatePhotography } from '@/api/manage/photography'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { proxy } = getCurrentInstance()
|
||||
|
||||
const userStore = useUserStore()
|
||||
const photographyList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
const daterangeCreateDate = ref([]);
|
||||
const photographyList = ref([])
|
||||
const open = ref(false)
|
||||
const loading = ref(true)
|
||||
const showSearch = ref(true)
|
||||
const ids = ref([])
|
||||
const single = ref(true)
|
||||
const multiple = ref(true)
|
||||
const total = ref(0)
|
||||
const title = ref('')
|
||||
const daterangeCreateDate = ref([])
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
|
@ -217,33 +123,35 @@ const data = reactive({
|
|||
createDate: null,
|
||||
},
|
||||
rules: {
|
||||
imageUrl: [{ required: true, message: "全景图片不能为空", trigger: "change" }],
|
||||
videoUrl: [{ required: true, message: "全景视频不能为空", trigger: "change" }],
|
||||
videoDate: [{ required: true, message: "视频日期不能为空", trigger: "change" }]
|
||||
imageUrl: [{ required: true, message: '全景图片不能为空', trigger: 'change' }],
|
||||
videoUrl: [{ required: true, message: '全景视频不能为空', trigger: 'change' }],
|
||||
videoDate: [{ required: true, message: '视频日期不能为空', trigger: 'change' }],
|
||||
},
|
||||
});
|
||||
})
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
const { queryParams, form, rules } = toRefs(data)
|
||||
|
||||
/** 查询项目全景列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
queryParams.value.params = {};
|
||||
if (null != daterangeCreateDate && "" != daterangeCreateDate) {
|
||||
queryParams.value.params["beginCreateDate"] = daterangeCreateDate.value[0];
|
||||
queryParams.value.params["endCreateDate"] = daterangeCreateDate.value[1];
|
||||
loading.value = true
|
||||
queryParams.value.params = {}
|
||||
queryParams.value.projectId = userStore.currentPrjId
|
||||
queryParams.value.comId = userStore.currentComId
|
||||
if (null != daterangeCreateDate && '' != daterangeCreateDate) {
|
||||
queryParams.value.params['beginCreateDate'] = daterangeCreateDate.value[0]
|
||||
queryParams.value.params['endCreateDate'] = daterangeCreateDate.value[1]
|
||||
}
|
||||
listPhotography(queryParams.value).then((response) => {
|
||||
photographyList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
photographyList.value = response.rows
|
||||
total.value = response.total
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
open.value = false
|
||||
reset()
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
|
@ -262,124 +170,124 @@ function reset() {
|
|||
createDate: null,
|
||||
updateBy: null,
|
||||
updateDate: null,
|
||||
};
|
||||
proxy.resetForm("photographyRef");
|
||||
}
|
||||
proxy.resetForm('photographyRef')
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
queryParams.value.pageNum = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
daterangeCreateDate.value = [];
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
daterangeCreateDate.value = []
|
||||
proxy.resetForm('queryRef')
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
ids.value = selection.map((item) => item.id)
|
||||
single.value = selection.length != 1
|
||||
multiple.value = !selection.length
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
if (!userStore.currentPrjId) {
|
||||
proxy.$modal.msgWarning("请切换到项目数据!!!");
|
||||
return false;
|
||||
proxy.$modal.msgWarning('请切换到项目数据!!!')
|
||||
return false
|
||||
}
|
||||
reset();
|
||||
form.value.comId = userStore.currentComId;
|
||||
form.value.comName = userStore.currentComName;
|
||||
form.value.projectId = userStore.currentPrjId;
|
||||
form.value.projectName = userStore.currentProName;
|
||||
open.value = true;
|
||||
title.value = "添加项目全景";
|
||||
reset()
|
||||
form.value.comId = userStore.currentComId
|
||||
form.value.comName = userStore.currentComName
|
||||
form.value.projectId = userStore.currentPrjId
|
||||
form.value.projectName = userStore.currentProName
|
||||
open.value = true
|
||||
title.value = '添加项目全景'
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const _id = row.id || ids.value;
|
||||
reset()
|
||||
const _id = row.id || ids.value
|
||||
getPhotography(_id).then((response) => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改项目全景";
|
||||
});
|
||||
form.value = response.data
|
||||
open.value = true
|
||||
title.value = '修改项目全景'
|
||||
})
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["photographyRef"].validate((valid) => {
|
||||
proxy.$refs['photographyRef'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (form.value.id != null) {
|
||||
updatePhotography(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
proxy.$modal.msgSuccess('修改成功')
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
} else {
|
||||
addPhotography(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
proxy.$modal.msgSuccess('新增成功')
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
/** 状态滑块控制 */
|
||||
function setStatus(val, row) {
|
||||
proxy.$modal
|
||||
.confirm(`是否确认${val == 0 ? "启用" : "停用"}当前数据项?`)
|
||||
.confirm(`是否确认${val == 0 ? '启用' : '停用'}当前数据项?`)
|
||||
.then(function () {
|
||||
let _data = { id: row.id, state: val };
|
||||
return updatePhotography(_data);
|
||||
let _data = { id: row.id, state: val }
|
||||
return updatePhotography(_data)
|
||||
})
|
||||
.then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
getList()
|
||||
proxy.$modal.msgSuccess('修改成功')
|
||||
})
|
||||
.catch(() => {
|
||||
// 取消时恢复原始开关状态
|
||||
if (val == 0) {
|
||||
row.state = 1;
|
||||
row.state = 1
|
||||
} else {
|
||||
row.state = 0;
|
||||
row.state = 0
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _ids = row.id || ids.value;
|
||||
const _ids = row.id || ids.value
|
||||
proxy.$modal
|
||||
.confirm('是否确认删除项目全景编号为"' + _ids + '"的数据项?')
|
||||
.then(function () {
|
||||
return delPhotography(_ids);
|
||||
return delPhotography(_ids)
|
||||
})
|
||||
.then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
getList()
|
||||
proxy.$modal.msgSuccess('删除成功')
|
||||
})
|
||||
.catch(() => {});
|
||||
.catch(() => {})
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download(
|
||||
"manage/photography/export",
|
||||
'manage/photography/export',
|
||||
{
|
||||
...queryParams.value,
|
||||
},
|
||||
`photography_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
)
|
||||
}
|
||||
|
||||
getList();
|
||||
getList()
|
||||
</script>
|
||||
|
|
|
@ -145,6 +145,7 @@ function buildTree(all,id){
|
|||
|
||||
/** 查询计划管理列表 */
|
||||
function getList() {
|
||||
queryParams.value.projectId=userStore.currentPrjId;
|
||||
if(!queryParams.value.projectId){
|
||||
planList.value=[];
|
||||
loading.value = false;
|
||||
|
|
|
@ -141,10 +141,10 @@
|
|||
|
||||
<script setup name="ProProjectInfoDepts">
|
||||
import { listProProjectInfoDepts, getProProjectInfoDepts, delProProjectInfoDepts, addProProjectInfoDepts, updateProProjectInfoDepts } from "@/api/manage/proProjectInfoDepts";
|
||||
|
||||
import useUserStore from '@/store/modules/user'
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { pro_dept_type, sys_is_del } = proxy.useDict('pro_dept_type', 'sys_is_del');
|
||||
|
||||
const userStore = useUserStore()
|
||||
const proProjectInfoDeptsList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
|
@ -173,6 +173,7 @@ const { queryParams, form, rules } = toRefs(data);
|
|||
/** 查询参建单位列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
queryParams.value.projectId = userStore.currentPrjId;
|
||||
listProProjectInfoDepts(queryParams.value).then(response => {
|
||||
proProjectInfoDeptsList.value = response.rows;
|
||||
total.value = response.total;
|
||||
|
|
|
@ -244,9 +244,10 @@ const data = reactive({
|
|||
pageSize: 10,
|
||||
projectName: null,
|
||||
subDeptType: null,
|
||||
projectId: null,
|
||||
subDeptName: null,
|
||||
subDeptCode: null,
|
||||
activeTags: 'finished',
|
||||
activeTags: '',
|
||||
approveStatus: null,
|
||||
},
|
||||
rules: {
|
||||
|
@ -266,6 +267,7 @@ const { queryParams, form, rules } = toRefs(data)
|
|||
/** 查询分包单位列表 */
|
||||
function getList() {
|
||||
loading.value = true
|
||||
queryParams.value.projectId = userStore.currentPrjId
|
||||
listProProjectInfoSubdepts(queryParams.value).then((response) => {
|
||||
proProjectInfoSubdeptsList.value = response.rows
|
||||
total.value = response.total
|
||||
|
|
|
@ -336,6 +336,7 @@ const { queryParams, form, rules } = toRefs(data);
|
|||
/** 查询项目进度列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
queryParams.value.projectId=userStore.currentPrjId;
|
||||
listSchedule(queryParams.value).then((response) => {
|
||||
scheduleList.value = response.rows;
|
||||
total.value = response.total;
|
||||
|
|
|
@ -157,6 +157,7 @@ function buildTree(all, id) {
|
|||
|
||||
/** 查询计划管理列表 */
|
||||
function getList() {
|
||||
queryParams.value.projectId=userStore.currentPrjId;
|
||||
if (!queryParams.value.projectId) {
|
||||
planList.value = [];
|
||||
proxy.$modal.msgWarning("请切换到项目数据!!!");
|
||||
|
|
Loading…
Reference in New Issue