唐润平:模型接口重写
This commit is contained in:
@@ -36,7 +36,6 @@ export const saveEquipment = (equipmentInfo, pointGap) => {
|
|||||||
} = originData;
|
} = originData;
|
||||||
let tempModelEquipmentList = [...modelEquipmentList]; //数组克隆
|
let tempModelEquipmentList = [...modelEquipmentList]; //数组克隆
|
||||||
tempModelEquipmentList.push(toRaw(equipmentInfo));
|
tempModelEquipmentList.push(toRaw(equipmentInfo));
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
apiSaveEquipment({
|
apiSaveEquipment({
|
||||||
constructionLength: autoComputeConstructionLength(
|
constructionLength: autoComputeConstructionLength(
|
||||||
@@ -70,6 +69,13 @@ export const deleteEquipment = (equipmentId, pointGap) => {
|
|||||||
tempModelEquipmentList = tempModelEquipmentList.filter(
|
tempModelEquipmentList = tempModelEquipmentList.filter(
|
||||||
(item) => item.equipmentId != equipmentId
|
(item) => item.equipmentId != equipmentId
|
||||||
);
|
);
|
||||||
|
console.log(
|
||||||
|
"del",
|
||||||
|
modelEquipmentList,
|
||||||
|
tempModelEquipmentList,
|
||||||
|
"id",
|
||||||
|
equipmentId
|
||||||
|
);
|
||||||
const {
|
const {
|
||||||
constructionLength,
|
constructionLength,
|
||||||
isDefault,
|
isDefault,
|
||||||
@@ -123,6 +129,5 @@ function autoComputeConstructionLength(modelEquipmentList, pointGap) {
|
|||||||
maxLength = length;
|
maxLength = length;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
console.log("max", maxLength);
|
|
||||||
return maxLength;
|
return maxLength;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,40 +67,40 @@ function handleOtherEqu(targetPoint, equipmentInfo) {
|
|||||||
targetPoint.scale.set(0.03, 0.06, 0.05);
|
targetPoint.scale.set(0.03, 0.06, 0.05);
|
||||||
this.scene.add(equMesh);
|
this.scene.add(equMesh);
|
||||||
targetPoint.visible = false;
|
targetPoint.visible = false;
|
||||||
targetPoint.hasWall = true;
|
// targetPoint.hasWall = true;
|
||||||
//处理风压阀的代码片段
|
// //处理风压阀的代码片段
|
||||||
let lineIndex = targetPoint.name.slice(7, 9);
|
// let lineIndex = targetPoint.name.slice(7, 9);
|
||||||
for (let line = Number(lineIndex); line <= 20; line++) {
|
// for (let line = Number(lineIndex); line <= 20; line++) {
|
||||||
if (line < 10) {
|
// if (line < 10) {
|
||||||
let wall = "wall_" + "0" + line;
|
// let wall = "wall_" + "0" + line;
|
||||||
this.scene.getObjectByName(wall).visible = true;
|
// this.scene.getObjectByName(wall).visible = true;
|
||||||
let point = "point_" + "00" + line + "_tc";
|
// let point = "point_" + "00" + line + "_tc";
|
||||||
this.scene.getObjectByName(point).visible = false;
|
// this.scene.getObjectByName(point).visible = false;
|
||||||
this.scene.getObjectByName(point).layers.set(-2);
|
// this.scene.getObjectByName(point).layers.set(-2);
|
||||||
if (this.scene.getObjectByName(point).hasDevice == true) {
|
// if (this.scene.getObjectByName(point).hasDevice == true) {
|
||||||
let EquID = this.scene.getObjectByName(point).info.id;
|
// let EquID = this.scene.getObjectByName(point).info.id;
|
||||||
this.scene.getObjectById(EquID).visible = false;
|
// this.scene.getObjectById(EquID).visible = false;
|
||||||
}
|
// }
|
||||||
} else if (line >= 10) {
|
// } else if (line >= 10) {
|
||||||
let wall = "wall_" + line;
|
// let wall = "wall_" + line;
|
||||||
this.scene.getObjectByName(wall).visible = true;
|
// this.scene.getObjectByName(wall).visible = true;
|
||||||
let point = "point_" + "0" + line + "_tc";
|
// let point = "point_" + "0" + line + "_tc";
|
||||||
this.scene.getObjectByName(point).visible = false;
|
// this.scene.getObjectByName(point).visible = false;
|
||||||
this.scene.getObjectByName(point).layers.set(-2);
|
// this.scene.getObjectByName(point).layers.set(-2);
|
||||||
if (this.scene.getObjectByName(point).hasDevice == true) {
|
// if (this.scene.getObjectByName(point).hasDevice == true) {
|
||||||
let EquID = this.scene.getObjectByName(point).info.id;
|
// let EquID = this.scene.getObjectByName(point).info.id;
|
||||||
this.scene.getObjectById(EquID).visible = false;
|
// this.scene.getObjectById(EquID).visible = false;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
//处理21行的设备和附着点
|
// //处理21行的设备和附着点
|
||||||
let point = "point_" + "0" + 21 + "_tc";
|
// let point = "point_" + "0" + 21 + "_tc";
|
||||||
this.scene.getObjectByName(point).visible = false;
|
// this.scene.getObjectByName(point).visible = false;
|
||||||
this.scene.getObjectByName(point).layers.set(-2);
|
// this.scene.getObjectByName(point).layers.set(-2);
|
||||||
if (this.scene.getObjectByName(point).hasDevice == true) {
|
// if (this.scene.getObjectByName(point).hasDevice == true) {
|
||||||
let EquID = this.scene.getObjectByName(point).info.id;
|
// let EquID = this.scene.getObjectByName(point).info.id;
|
||||||
this.scene.getObjectById(EquID).visible = false;
|
// this.scene.getObjectById(EquID).visible = false;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
// this.scene.getObjectByName('wall_01').visible = true
|
// this.scene.getObjectByName('wall_01').visible = true
|
||||||
// console.log(this.scene);
|
// console.log(this.scene);
|
||||||
// 保存该设备模型id,后期直接从附附着点进行删除
|
// 保存该设备模型id,后期直接从附附着点进行删除
|
||||||
|
|||||||
@@ -1,21 +1,6 @@
|
|||||||
export function editTunnelInit(equipmentList) {
|
export function editTunnelInit(equipmentList) {
|
||||||
//初始化将墙壁隐藏起来
|
//初始化将墙壁隐藏起来
|
||||||
// for (let line = 1; line <= 20; line++) {
|
|
||||||
// if (line < 10) {
|
|
||||||
// let wall = 'wall_' + '0' + line
|
|
||||||
// this.scene.getObjectByName(wall).visible = false
|
|
||||||
// } else if (line >= 10) {
|
|
||||||
// let wall = 'wall_' + line
|
|
||||||
// this.scene.getObjectByName(wall).visible = false
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
equipmentList.forEach((item) => {
|
equipmentList.forEach((item) => {
|
||||||
const formInfo = {
|
this.addEquipment(this.scene.getObjectByName(item.position), item);
|
||||||
equipmentType: item.equipmentType, //设备类型
|
|
||||||
chooseEquipment: item.chooseEquipment, //设备选择(设备名称)
|
|
||||||
threshold: item.threshold,
|
|
||||||
};
|
|
||||||
this.addEquipment(this.scene.getObjectByName(item.position), formInfo);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -484,6 +484,8 @@ const handleEditFan = () => {
|
|||||||
if (res.code === 1000) {
|
if (res.code === 1000) {
|
||||||
ElMessage.success('修改成功')
|
ElMessage.success('修改成功')
|
||||||
router.push('/tunnel/' + siteId.value + '/' + type + '/' + userId)
|
router.push('/tunnel/' + siteId.value + '/' + type + '/' + userId)
|
||||||
|
}else {
|
||||||
|
ElMessage.error(res.msg)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,12 +97,14 @@ const handleSave = async () => {
|
|||||||
constructionLength: 500,
|
constructionLength: 500,
|
||||||
tunnelLength: form.value.totalLength,
|
tunnelLength: form.value.totalLength,
|
||||||
isDefault: form.value.isDefault,
|
isDefault: form.value.isDefault,
|
||||||
tunnelThreeConfig: JSON.stringify(await store.getEquipmentList()),
|
modelEquipmentList: await store.getEquipmentList(),
|
||||||
};
|
};
|
||||||
editTunnel(data).then((res) => {
|
editTunnel(data).then((res) => {
|
||||||
if (res?.code === 1000) {
|
if (res?.code === 1000) {
|
||||||
ElMessage.success(res.msg);
|
ElMessage.success(res.msg);
|
||||||
router.push("/tunnel/" + form.value.siteId + "/" + type + "/" + userId);
|
router.push("/tunnel/" + form.value.siteId + "/" + type + "/" + userId);
|
||||||
|
} else {
|
||||||
|
ElMessage.error(res.msg);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -47,6 +47,8 @@ const authStore = useAuthStore();
|
|||||||
const loginForm = reactive({
|
const loginForm = reactive({
|
||||||
username: "admin",
|
username: "admin",
|
||||||
password: "123456",
|
password: "123456",
|
||||||
|
// username: "",
|
||||||
|
// password: "",
|
||||||
code: "",
|
code: "",
|
||||||
uuid: "",
|
uuid: "",
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -93,11 +93,11 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<div class="pagination">
|
<div class="pagination">
|
||||||
<span>首页</span>
|
<span @click="firstPage" v-if="showFirst">首页</span>
|
||||||
<el-pagination background v-model:current-page="pageInfo.pageNum" v-model:page-size="pageInfo.pageSize"
|
<el-pagination background v-model:current-page="pageInfo.pageNum" v-model:page-size="pageInfo.pageSize"
|
||||||
:total="total" prev-text="上一页" next-text="下一页" layout="prev, pager, next"
|
:total="total" prev-text="上一页" next-text="下一页" layout="prev, pager, next"
|
||||||
@current-change="handleCurrentChange"/>
|
@current-change="handleCurrentChange" :hide-on-single-page="true"/>
|
||||||
<span>尾页</span>
|
<span @click="lastPage" v-if="showFirst">尾页</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -146,6 +146,7 @@ const info = ref({
|
|||||||
})
|
})
|
||||||
const title = ref('新增站点')
|
const title = ref('新增站点')
|
||||||
const isVisited = ref(false);
|
const isVisited = ref(false);
|
||||||
|
const showFirst = ref(true)
|
||||||
const total = ref(10);
|
const total = ref(10);
|
||||||
const showAddIcon = ref(true)
|
const showAddIcon = ref(true)
|
||||||
const pageInfo = reactive({
|
const pageInfo = reactive({
|
||||||
@@ -169,6 +170,7 @@ const getList = () => {
|
|||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
total.value = res.data.total;
|
total.value = res.data.total;
|
||||||
showAddIcon.value = total.value % 6!==0;
|
showAddIcon.value = total.value % 6!==0;
|
||||||
|
showFirst.value = total.value / pageInfo.pageSize > 1;
|
||||||
res.data.rows.map(item => {
|
res.data.rows.map(item => {
|
||||||
if (item.tunnelList === null || item.tunnelList.length === 0) {
|
if (item.tunnelList === null || item.tunnelList.length === 0) {
|
||||||
item.info = info.value
|
item.info = info.value
|
||||||
@@ -186,7 +188,6 @@ const handleClickSite = (type) => {
|
|||||||
if (type.checked) {
|
if (type.checked) {
|
||||||
siteIds.value.push(type.siteId)
|
siteIds.value.push(type.siteId)
|
||||||
siteNameList.value.push(type.siteName)
|
siteNameList.value.push(type.siteName)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
siteIds.value.map((item, index) => {
|
siteIds.value.map((item, index) => {
|
||||||
if (item === type.siteId) {
|
if (item === type.siteId) {
|
||||||
@@ -234,15 +235,23 @@ const handleSubmit = (instance) => {
|
|||||||
if (!valid) return
|
if (!valid) return
|
||||||
if (title.value === '编辑站点') {
|
if (title.value === '编辑站点') {
|
||||||
editSite(form.value).then((res) => {
|
editSite(form.value).then((res) => {
|
||||||
isVisited.value = false
|
if(res.code===1000){
|
||||||
getList()
|
isVisited.value = false
|
||||||
ElMessage.success(res.msg)
|
getList()
|
||||||
|
ElMessage.success(res.msg)
|
||||||
|
}else {
|
||||||
|
ElMessage.warning(res.msg)
|
||||||
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
addSite(form.value).then((res) => {
|
addSite(form.value).then((res) => {
|
||||||
isVisited.value = false
|
if(res.code===1000){
|
||||||
getList()
|
isVisited.value = false
|
||||||
ElMessage.success(res.msg)
|
getList()
|
||||||
|
ElMessage.success(res.msg)
|
||||||
|
}else {
|
||||||
|
ElMessage.warning(res.msg)
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -250,6 +259,15 @@ const handleSubmit = (instance) => {
|
|||||||
const handleChooseAll=()=>{
|
const handleChooseAll=()=>{
|
||||||
siteList.value.map(item=>{
|
siteList.value.map(item=>{
|
||||||
item.checked=!item.checked
|
item.checked=!item.checked
|
||||||
|
if(item.checked&&!item.isDefault){
|
||||||
|
siteIds.value.push(item.siteId)
|
||||||
|
}else if(!item.checked&&!item.isDefault){
|
||||||
|
siteIds.value.map((newItem, index) => {
|
||||||
|
if (newItem === item.siteId) {
|
||||||
|
siteIds.value.splice(index, 1)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const handleMoreDelete = () => {
|
const handleMoreDelete = () => {
|
||||||
@@ -290,7 +308,14 @@ const handleMoreDelete = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const firstPage=()=>{
|
||||||
|
pageInfo.pageNum = 1
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
const lastPage=()=>{
|
||||||
|
pageInfo.pageNum = total.value/pageInfo.pageSize
|
||||||
|
getList()
|
||||||
|
}
|
||||||
//点击页码进行分页功能
|
//点击页码进行分页功能
|
||||||
const handleCurrentChange = (val) => {
|
const handleCurrentChange = (val) => {
|
||||||
pageInfo.pageNum = val
|
pageInfo.pageNum = val
|
||||||
|
|||||||
@@ -96,11 +96,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<div class="pagination">
|
<div class="pagination">
|
||||||
<span>首页</span>
|
<span @click="firstPage" v-if="showFirst">首页</span>
|
||||||
<el-pagination background v-model:current-page="pageInfo.pageNum" v-model:page-size="pageInfo.pageSize"
|
<el-pagination background v-model:current-page="pageInfo.pageNum" v-model:page-size="pageInfo.pageSize"
|
||||||
:total="total" prev-text="上一页" next-text="下一页" layout="prev, pager, next"
|
:total="total" prev-text="上一页" next-text="下一页" layout="prev, pager, next"
|
||||||
@current-change="handleCurrentChange"/>
|
@current-change="handleCurrentChange" :hide-on-single-page="true"/>
|
||||||
<span>尾页</span>
|
<span @click="lastPage" v-if="showFirst">尾页</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -120,6 +120,7 @@ const formRules = ref({
|
|||||||
tunnelName: [{required: true, message: '请输入隧道名称', trigger: 'blur'}],
|
tunnelName: [{required: true, message: '请输入隧道名称', trigger: 'blur'}],
|
||||||
serialNumber: [{required: true, message: '请输入序列号', trigger: 'blur'}]
|
serialNumber: [{required: true, message: '请输入序列号', trigger: 'blur'}]
|
||||||
})
|
})
|
||||||
|
const showFirst = ref(true)
|
||||||
const formInstance = ref()
|
const formInstance = ref()
|
||||||
const tunnelList = ref([
|
const tunnelList = ref([
|
||||||
{
|
{
|
||||||
@@ -268,7 +269,6 @@ const handleGoSiteOrIndex = () => {
|
|||||||
} else if (type === 'i') {
|
} else if (type === 'i') {
|
||||||
router.push('/')
|
router.push('/')
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
const getList = () => {
|
const getList = () => {
|
||||||
getTunnelList({
|
getTunnelList({
|
||||||
@@ -278,10 +278,19 @@ const getList = () => {
|
|||||||
if (res.code === 1000) {
|
if (res.code === 1000) {
|
||||||
total.value = res.data.total
|
total.value = res.data.total
|
||||||
tunnelList.value = res.data.rows
|
tunnelList.value = res.data.rows
|
||||||
|
showFirst.value = total.value / pageInfo.pageSize >= 1;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
getList()
|
getList()
|
||||||
|
const firstPage=()=>{
|
||||||
|
pageInfo.pageNum = 1
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
const lastPage=()=>{
|
||||||
|
pageInfo.pageNum = total.value/pageInfo.pageSize
|
||||||
|
getList()
|
||||||
|
}
|
||||||
//点击页码进行分页功能
|
//点击页码进行分页功能
|
||||||
const handleCurrentChange = (val) => {
|
const handleCurrentChange = (val) => {
|
||||||
pageInfo.pageNum = val
|
pageInfo.pageNum = val
|
||||||
@@ -303,6 +312,8 @@ const handleSubmit = (instance) => {
|
|||||||
ElMessage.success('新增成功')
|
ElMessage.success('新增成功')
|
||||||
getList()
|
getList()
|
||||||
isVisited.value = false
|
isVisited.value = false
|
||||||
|
}else {
|
||||||
|
ElMessage.warning(res.msg)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
@@ -321,6 +332,15 @@ const handleGoToEditTunnel = (tunnelId) => {
|
|||||||
const handleChooseAll = () => {
|
const handleChooseAll = () => {
|
||||||
tunnelList.value.map(item => {
|
tunnelList.value.map(item => {
|
||||||
item.checked = !item.checked
|
item.checked = !item.checked
|
||||||
|
if(item.checked&&!item.isDefault){
|
||||||
|
tunnelIds.value.push(item.tunnelId)
|
||||||
|
}else if(!item.checked&&!item.isDefault){
|
||||||
|
tunnelIds.value.map((newItem, index) => {
|
||||||
|
if (newItem === item.tunnelId) {
|
||||||
|
tunnelIds.value.splice(index, 1)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const handleEditDevice = (tunnelId) => {
|
const handleEditDevice = (tunnelId) => {
|
||||||
|
|||||||
@@ -10,9 +10,9 @@
|
|||||||
<!-- <div class="all-btn" @click="handleAll">-->
|
<!-- <div class="all-btn" @click="handleAll">-->
|
||||||
<!-- 全选-->
|
<!-- 全选-->
|
||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
<div class="all-btn del-btn" @click="handleDelete">
|
<!-- <div class="all-btn del-btn" @click="handleDelete">-->
|
||||||
删除
|
<!-- 删除-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="user-content">
|
<div class="user-content">
|
||||||
@@ -24,12 +24,18 @@
|
|||||||
v-model="username"
|
v-model="username"
|
||||||
clearable
|
clearable
|
||||||
placeholder="输入搜索内容"
|
placeholder="输入搜索内容"
|
||||||
|
@clear="getInfo"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<el-button type="primary" :icon="Search" style="margin-left: 20px" @click="getInfo">搜索</el-button>
|
<el-button type="primary" :icon="Search" style="margin-left: 20px" @click="getInfo">搜索</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div>用户管理</div>
|
<div>用户管理</div>
|
||||||
<div class="add-btn" @click="handleAddUser">添加用户</div>
|
<div class="all-del-btn">
|
||||||
|
<div class="add-btn" @click="handleAddUser">添加用户</div>
|
||||||
|
<div class="all-btn del-btn" @click="handleDelete">
|
||||||
|
删除
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="device-table">
|
<div class="device-table">
|
||||||
<el-table stripe ref="multipleTable" @select="handleSelect"
|
<el-table stripe ref="multipleTable" @select="handleSelect"
|
||||||
@@ -61,18 +67,19 @@
|
|||||||
<el-form-item label="当前站点">
|
<el-form-item label="当前站点">
|
||||||
<div class="current-site">{{ currentSite }}<span>如果需要切换站点,请返回首屏切换</span></div>
|
<div class="current-site">{{ currentSite }}<span>如果需要切换站点,请返回首屏切换</span></div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="输入用户名称">
|
<el-form-item label="输入账户">
|
||||||
<el-input v-model="form.userName" placeholder="请输入用户名称"/>
|
<el-input v-model="form.userName" placeholder="请输入账户"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="输入用户昵称">
|
<el-form-item label="输入密码" v-if="title==='添加用户'">
|
||||||
<el-input v-model="form.nickName" placeholder="请输入用户昵称"/>
|
<el-input type="password" show-password v-model="form.password" placeholder="请输入密码"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="输入昵称">
|
||||||
|
<el-input v-model="form.nickName" placeholder="请输入昵称"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="输入电话号码">
|
<el-form-item label="输入电话号码">
|
||||||
<el-input v-model="form.phoneNumber" placeholder="输入电话号码"/>
|
<el-input v-model="form.phoneNumber" placeholder="输入电话号码"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="输入密码" v-if="title==='添加用户'">
|
|
||||||
<el-input v-model="form.password" placeholder="请输入密码"/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="选择身份">
|
<el-form-item label="选择身份">
|
||||||
<el-radio-group v-model="form.roleId" @change="(val) => {
|
<el-radio-group v-model="form.roleId" @change="(val) => {
|
||||||
console.log('vaaa',val)
|
console.log('vaaa',val)
|
||||||
@@ -112,11 +119,11 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<div class="pagination">
|
<div class="pagination">
|
||||||
<span>首页</span>
|
<span @click="firstPage" v-if="showFirst">首页</span>
|
||||||
<el-pagination background v-model:current-page="pageInfo.pageNum" v-model:page-size="pageInfo.pageSize"
|
<el-pagination background v-model:current-page="pageInfo.pageNum" v-model:page-size="pageInfo.pageSize"
|
||||||
:total="total" prev-text="上一页" next-text="下一页" layout="prev, pager, next"
|
:total="total" prev-text="上一页" next-text="下一页" layout="prev, pager, next"
|
||||||
@current-change="handleCurrentChange"/>
|
@current-change="handleCurrentChange" :hide-on-single-page="true"/>
|
||||||
<span>尾页</span>
|
<span @click="lastPage" v-if="showFirst">尾页</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -135,12 +142,13 @@ const siteId = reactive(router.currentRoute.value.params.siteId)
|
|||||||
const tunnelIndex = ref()
|
const tunnelIndex = ref()
|
||||||
const username = ref()
|
const username = ref()
|
||||||
const userIds = ref()
|
const userIds = ref()
|
||||||
const currentSite = ref()
|
const showFirst = ref(true)
|
||||||
|
const currentSite = ref('')
|
||||||
const formInstance = ref()
|
const formInstance = ref()
|
||||||
const userData = ref([])
|
const userData = ref([])
|
||||||
const pageInfo = reactive({
|
const pageInfo = reactive({
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 6
|
pageSize: 10
|
||||||
});
|
});
|
||||||
const total = ref(10);
|
const total = ref(10);
|
||||||
const isVisited = ref(false);
|
const isVisited = ref(false);
|
||||||
@@ -190,18 +198,23 @@ const handleAll = () => {
|
|||||||
multipleTable.value.toggleAllSelection()
|
multipleTable.value.toggleAllSelection()
|
||||||
}
|
}
|
||||||
const handleDelete = () => {
|
const handleDelete = () => {
|
||||||
ElMessageBox.confirm(`是否确认删除该用户吗?`, '系统提示', {
|
console.log('userIds.value',userIds.value)
|
||||||
confirmButtonText: '确定',
|
if (userIds.value ===undefined) {
|
||||||
cancelButtonText: '取消',
|
ElMessage.warning('请先选择用户进行删除')
|
||||||
type: 'warning'
|
} else {
|
||||||
}).then(() => {
|
ElMessageBox.confirm(`是否确认删除该用户吗?`, '系统提示', {
|
||||||
deleteUser(userIds.value).then(res => {
|
confirmButtonText: '确定',
|
||||||
if (res.code === 1000) {
|
cancelButtonText: '取消',
|
||||||
ElMessage.success(res.msg)
|
type: 'warning'
|
||||||
getInfo()
|
}).then(() => {
|
||||||
}
|
deleteUser(userIds.value).then(res => {
|
||||||
|
if (res.code === 1000) {
|
||||||
|
ElMessage.success(res.msg)
|
||||||
|
getInfo()
|
||||||
|
}
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
const reset = () => {
|
const reset = () => {
|
||||||
form.value = {
|
form.value = {
|
||||||
@@ -224,16 +237,30 @@ getRoleOptionInfo()
|
|||||||
const getInfo = () => {
|
const getInfo = () => {
|
||||||
getUser({
|
getUser({
|
||||||
siteId: siteId,
|
siteId: siteId,
|
||||||
userName: username.value
|
userName: username.value,
|
||||||
|
...pageInfo
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.code === 1000) {
|
if (res.code === 1000) {
|
||||||
console.log('res', res)
|
|
||||||
userData.value = res.data.rows
|
userData.value = res.data.rows
|
||||||
total.value = res.data.total
|
total.value = res.data.total
|
||||||
|
showFirst.value = total.value / pageInfo.pageSize >= 1;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
getInfo()
|
getInfo()
|
||||||
|
const firstPage = () => {
|
||||||
|
pageInfo.pageNum = 1
|
||||||
|
getInfo()
|
||||||
|
}
|
||||||
|
const lastPage = () => {
|
||||||
|
pageInfo.pageNum = total.value / pageInfo.pageSize
|
||||||
|
getInfo()
|
||||||
|
}
|
||||||
|
//点击页码进行分页功能
|
||||||
|
const handleCurrentChange = (val) => {
|
||||||
|
pageInfo.pageNum = val
|
||||||
|
getInfo()
|
||||||
|
}
|
||||||
const handleSubmit = async (formInstance) => {
|
const handleSubmit = async (formInstance) => {
|
||||||
if (!formInstance) return;
|
if (!formInstance) return;
|
||||||
formInstance.validate(async (valid) => {
|
formInstance.validate(async (valid) => {
|
||||||
@@ -248,6 +275,7 @@ const handleSubmit = async (formInstance) => {
|
|||||||
if (res.code === 1000) {
|
if (res.code === 1000) {
|
||||||
getInfo()
|
getInfo()
|
||||||
isVisited.value = false
|
isVisited.value = false
|
||||||
|
ElMessage.success(res.msg)
|
||||||
} else {
|
} else {
|
||||||
ElMessage.warning(res.msg)
|
ElMessage.warning(res.msg)
|
||||||
}
|
}
|
||||||
@@ -257,6 +285,7 @@ const handleSubmit = async (formInstance) => {
|
|||||||
if (res.code === 1000) {
|
if (res.code === 1000) {
|
||||||
getInfo()
|
getInfo()
|
||||||
isVisited.value = false
|
isVisited.value = false
|
||||||
|
ElMessage.success(res.msg)
|
||||||
} else {
|
} else {
|
||||||
ElMessage.warning(res.msg)
|
ElMessage.warning(res.msg)
|
||||||
}
|
}
|
||||||
@@ -279,15 +308,26 @@ const handleSelect = async (selection, row) => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.current-site{
|
:deep(.el-input .el-input__password) {
|
||||||
font-size: 38px;color: #FFFFFF;
|
font-size: 60px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-input__clear) {
|
||||||
|
font-size: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.current-site {
|
||||||
|
font-size: 41px;
|
||||||
|
color: #FFFFFF;
|
||||||
margin-top: 12px;
|
margin-top: 12px;
|
||||||
>span{
|
|
||||||
font-size: 30px!important;
|
> span {
|
||||||
color: darkgray!important;
|
font-size: 38px !important;
|
||||||
|
color: darkgray !important;
|
||||||
margin-left: 20px;
|
margin-left: 20px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
:deep(.el-table__header-wrapper .el-checkbox) {
|
:deep(.el-table__header-wrapper .el-checkbox) {
|
||||||
display: none
|
display: none
|
||||||
}
|
}
|
||||||
@@ -375,31 +415,32 @@ const handleSelect = async (selection, row) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.all-del-btn {
|
|
||||||
display: flex;
|
|
||||||
|
|
||||||
.del-btn {
|
}
|
||||||
width: 168px;
|
|
||||||
height: 60px;
|
|
||||||
background: #08B7B8;
|
|
||||||
border-radius: 11px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.all-btn {
|
.all-del-btn {
|
||||||
cursor: pointer;
|
display: flex;
|
||||||
padding-left: 53px;
|
|
||||||
width: 178px;
|
|
||||||
height: 70px;
|
|
||||||
line-height: 70px;
|
|
||||||
border-radius: 11px;
|
|
||||||
border: 2px solid #08B7B8;
|
|
||||||
color: #FFFFFF;
|
|
||||||
font-size: 38px;
|
|
||||||
|
|
||||||
&:last-child {
|
.del-btn {
|
||||||
margin-left: 40px;
|
width: 168px;
|
||||||
margin-right: 70px;
|
height: 60px;
|
||||||
}
|
background: #08B7B8;
|
||||||
|
border-radius: 11px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.all-btn {
|
||||||
|
cursor: pointer;
|
||||||
|
padding-left: 53px;
|
||||||
|
width: 178px;
|
||||||
|
height: 70px;
|
||||||
|
line-height: 70px;
|
||||||
|
border-radius: 11px;
|
||||||
|
border: 2px solid #08B7B8;
|
||||||
|
color: #FFFFFF;
|
||||||
|
font-size: 38px;
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
margin-left: 40px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -418,7 +459,7 @@ const handleSelect = async (selection, row) => {
|
|||||||
border-radius: 20px;
|
border-radius: 20px;
|
||||||
border: 2px solid #05FEFF;
|
border: 2px solid #05FEFF;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 73px 98px;
|
padding: 73px 58px;
|
||||||
|
|
||||||
.user-top {
|
.user-top {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -437,14 +478,15 @@ const handleSelect = async (selection, row) => {
|
|||||||
|
|
||||||
.add-btn {
|
.add-btn {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
width: 170px;
|
width: 180px;
|
||||||
height: 60px;
|
height: 70px;
|
||||||
line-height: 60px;
|
line-height: 70px;
|
||||||
background: #08B7B8;
|
background: #08B7B8;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
font-size: 35px;
|
font-size: 38px;
|
||||||
padding-left: 19px;
|
padding-left: 19px;
|
||||||
|
//margin-left: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-box {
|
.search-box {
|
||||||
@@ -452,25 +494,25 @@ const handleSelect = async (selection, row) => {
|
|||||||
|
|
||||||
:deep(.el-button) {
|
:deep(.el-button) {
|
||||||
width: 140px;
|
width: 140px;
|
||||||
height: 60px;
|
height: 70px;
|
||||||
background: #08B7B8;
|
background: #08B7B8;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
border: none;
|
border: none;
|
||||||
font-size: 35px;
|
font-size: 38px;
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep(.el-input__wrapper) {
|
:deep(.el-input__wrapper) {
|
||||||
width: 292px;
|
width: 300px;
|
||||||
height: 60px;
|
height: 70px;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
border: 1px solid #05FEFF;
|
border: 1px solid #05FEFF;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
font-size: 35px;
|
font-size: 38px;
|
||||||
|
|
||||||
.el-input__inner {
|
.el-input__inner {
|
||||||
height: 60px;
|
height: 70px;
|
||||||
line-height: 60px;
|
line-height: 70px;
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -478,7 +520,7 @@ const handleSelect = async (selection, row) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
:deep(.el-table--fit) {
|
:deep(.el-table--fit) {
|
||||||
width: 2000px !important;
|
width: 2110px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep(.cell) {
|
:deep(.cell) {
|
||||||
|
|||||||
Reference in New Issue
Block a user