添加收藏夹功能

hn2.0
fanluyan 1 year ago
parent 111bc433df
commit 49eaf122a8

@ -106,6 +106,11 @@ export default {
index: "/devicePhotoSchedule",
title: "拍照时间表设置",
},
{
index: "/favorInformation",
title: "收藏夹管理",
},
// {
// index: "/deviceUpgrade",
// title: "",
@ -187,6 +192,10 @@ export default {
index: "/devicePhotoSchedule",
title: "拍照时间表设置",
},
{
index: "/favorInformation",
title: "收藏夹管理",
},
// {
// index: "/deviceUpgrade",
// title: "",
@ -267,6 +276,10 @@ export default {
index: "/devicePhotoSchedule",
title: "拍照时间表设置",
},
{
index: "/favorInformation",
title: "收藏夹管理",
},
// {
// index: "/deviceUpgrade",
// title: "",

@ -84,6 +84,14 @@ const routes = [
),
meta: { title: "杆塔信息管理", icon: "" },
},
{
path: "/favorInformation",
component: () =>
import(
/* webpackChunkName: "tabs" */ "../views/management/userEquipment/favorInformation/index.vue"
),
meta: { title: "收藏夹管理", icon: "" },
},
{
path: "/photographicDevice",
component: () =>

@ -833,3 +833,37 @@ export function addFavorList(data) {
data,
});
}
//获取收藏夹列表
export function listFavorApi(data) {
return request({
url: "/api/listFavor",
method: "post",
data,
});
}
//新增收藏夹列表
export function addFavorApi(data) {
return request({
url: "/api/addFavor",
method: "post",
data,
});
}
//修改收藏夹列表
export function updateFavorApi(data) {
return request({
url: "/api/updateFavor",
method: "post",
data,
});
}
//删除收藏夹列表
export function deleteFavorApi(data) {
return request({
url: "/api/deleteFavor",
method: "post",
data,
});
}

@ -1,154 +0,0 @@
<template>
<div class="simCardcontain">
<div class="simBtnGroup">
<el-button type="primary">新增</el-button>
<el-button type="primary">修改</el-button>
<el-button type="primary">删除</el-button>
<el-button type="primary">查询</el-button>
<el-button type="primary">质保延期</el-button>
<el-button type="primary">导入</el-button>
<el-button type="primary">导入模板下载</el-button>
<el-button type="primary">导出</el-button>
</div>
<div class="searchForm">
<el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-form-item label="单位:">
<el-select v-model="formInline.region" placeholder="活动区域">
<el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option>
</el-select>
</el-form-item>
<el-form-item label="网络类型:">
<el-select v-model="formInline.region" placeholder="活动区域">
<el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option>
</el-select>
</el-form-item>
<el-form-item label="状态:">
<el-input v-model="formInline.user" placeholder="审批人"></el-input>
</el-form-item>
<el-form-item label="是否已使用">
<el-select v-model="formInline.region" placeholder="活动区域">
<el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option>
</el-select>
</el-form-item>
<el-form-item label="电话号码:">
<el-input v-model="formInline.user" placeholder="审批人"></el-input>
</el-form-item>
</el-form>
</div>
<div class="simTable">
<el-table
ref="multipleTable"
:data="tableData"
stripe
tooltip-effect="dark"
style="width: 100%"
@selection-change="handleSelectionChange"
>
<el-table-column type="index" width="55"> </el-table-column>
<el-table-column type="selection" width="55"> </el-table-column>
<el-table-column label="单位">
<template slot-scope="scope">{{ scope.row.date }}</template>
</el-table-column>
<el-table-column prop="name" label="电话号码"> </el-table-column>
<el-table-column prop="address" label="网络类型" show-overflow-tooltip>
</el-table-column>
<el-table-column prop="name" label="质保到期日"> </el-table-column>
<el-table-column prop="name" label="流量包(M)"> </el-table-column>
<el-table-column prop="name" label="告警阀值(%)"> </el-table-column>
<el-table-column prop="name" label="状态"> </el-table-column>
<el-table-column prop="name" label="是否已使用"> </el-table-column>
</el-table>
</div>
</div>
</template>
<script>
export default {
data() {
return {
formInline: {
user: "",
region: "",
},
tableData: [
{
date: "2016-05-03",
name: "王小虎",
address: "上海市普陀区金沙江路 1518 弄",
},
{
date: "2016-05-02",
name: "王小虎",
address: "上海市普陀区金沙江路 1518 弄",
},
{
date: "2016-05-04",
name: "王小虎",
address: "上海市普陀区金沙江路 1518 弄",
},
{
date: "2016-05-01",
name: "王小虎",
address: "上海市普陀区金沙江路 1518 弄",
},
{
date: "2016-05-08",
name: "王小虎",
address: "上海市普陀区金沙江路 1518 弄",
},
{
date: "2016-05-06",
name: "王小虎",
address: "上海市普陀区金沙江路 1518 弄",
},
{
date: "2016-05-07",
name: "王小虎",
address: "上海市普陀区金沙江路 1518 弄",
},
],
multipleSelection: [],
};
},
methods: {
onSubmit() {
console.log("submit!");
},
toggleSelection(rows) {
if (rows) {
rows.forEach((row) => {
this.$refs.multipleTable.toggleRowSelection(row);
});
} else {
this.$refs.multipleTable.clearSelection();
}
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
},
};
</script>
<style lang="less">
.simCardcontain {
width: 100%;
height: 100%;
background: @color-white;
.simBtnGroup {
padding: 16px 8px;
}
.searchForm {
padding: 0px 8px;
.el-form {
.el-form-item {
margin-bottom: 0px;
}
}
}
.simTable {
padding: 16px 8px 0 8px;
}
}
</style>

@ -1,8 +0,0 @@
<template>
<div>装置分布可视化</div>
</template>
<script>
export default {};
</script>
<style lang="less">
</style>

@ -169,7 +169,8 @@ export default {
.then((res) => {
console.log(res);
this.markId = res.data.markId;
this.color = res.data.color;
this.num = res.data.boderWidth;
if (res.data.path !== null) {
this.picsrc = res.data.path;
if (res.data.list.length !== 0) {

@ -0,0 +1,135 @@
<template>
<el-dialog
class="addFavorDialog"
:title="title"
:visible.sync="isShow"
:close-on-click-modal="false"
width="470px"
@close="handleClose"
>
<el-form
label-position="left"
ref="formInfo"
:rules="rules"
:model="formdata"
>
<el-form-item label="收藏夹名称:" prop="name">
<el-input v-model="formdata.name" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="isShow = false"> </el-button>
<el-button type="primary" @click="submitForm()"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { addFavorApi, updateFavorApi } from "@/utils/api/index";
export default {
props: {
title: String,
},
data() {
return {
isShow: false,
lineOptions: [],
formdata: {},
rules: {
name: [{ required: true, message: "请输入杆塔名称", trigger: "blur" }],
},
};
},
mounted() {},
methods: {
//
getdataform(val) {
if (val == null) {
return (this.formdata = {});
}
//this.formdata = val;
this.formdata = JSON.parse(JSON.stringify(val));
},
//
submitForm() {
this.$refs.formInfo.validate((valid) => {
if (valid) {
if (this.title == "新增") {
addFavorApi({ name: this.formdata.name })
.then((res) => {
if (res.code == 200) {
this.isShow = false;
this.$message({
duration: 1500,
showClose: true,
message: "添加成功",
type: "success",
});
this.$parent.favorList();
} else {
this.$message({
duration: 1500,
showClose: true,
message: "添加失败",
type: "error",
});
}
})
.catch((err) => {});
} else {
console.log(this.formdata);
updateFavorApi({ id: this.formdata.id, name: this.formdata.name })
.then((res) => {
if (res.code == 200) {
this.isShow = false;
//this.$message.success("");
this.$message({
duration: 1500,
showClose: true,
message: "修改成功",
type: "success",
});
this.$parent.favorList();
} else {
//this.$message.error("");
this.$message({
duration: 1500,
showClose: true,
message: "修改失败",
type: "error",
});
}
})
.catch((err) => {});
}
} else {
console.log("error submit!!");
return false;
}
});
},
display() {
this.isShow = true;
},
hide() {
this.isShow = false;
},
handleClose() {
this.$parent.favorList();
},
},
};
</script>
<style lang="less">
.addFavorDialog {
.el-select {
width: 100%;
}
.el-input-number {
width: 100%;
}
.el-input-number .el-input__inner {
text-align: left;
}
}
</style>

@ -0,0 +1,194 @@
<template>
<div class="favorInfoBox">
<div class="deviceBox">
<div class="deviceBtnGroup">
<h4>收藏夹管理</h4>
<el-button
type="primary"
icon="el-icon-plus"
@click.native.stop="handleAddFaove()"
>新增</el-button
>
</div>
<div class="favorTable">
<el-table
ref="multipleTable"
:data="tableDate"
tooltip-effect="dark"
stripe
style="width: 100%"
height="calc(100% - 40px)"
v-loading="loading"
>
<template slot="empty">
<el-empty :image-size="160" description="暂无数据"></el-empty>
</template>
<el-table-column type="index" label="序号" width="100" align="center">
</el-table-column>
<el-table-column
prop="name"
label="收藏夹名称"
show-overflow-tooltip
min-width="280"
align="center"
>
</el-table-column>
<el-table-column fixed="right" label="操作" align="center">
<template slot-scope="scope">
<el-button
@click.native.stop="handleResive(scope.row)"
type="text"
>修改</el-button
>
<el-button
type="text"
class="deleteText"
@click.native.stop="handleDelete(scope.row)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<div class="pageNation">
<el-pagination
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
:current-page="page"
:page-size="pageSize"
layout="sizes, prev, pager, next, jumper,total"
:total="total"
background
>
</el-pagination>
</div>
</div>
</div>
<!-- 新增时间表 -->
<favoraddDialog :title="title" ref="favoraddDialogref"></favoraddDialog>
</div>
</template>
<script>
import { listFavorApi, deleteFavorApi } from "@/utils/api/index";
import favoraddDialog from "./components/favoraddDialog.vue";
export default {
components: {
favoraddDialog,
},
data() {
return {
title: "", //
tableDate: [],
//multipleSelection: [], //
page: 1, //
pageSize: 20, //
total: 0, //
loading: true,
};
},
created() {
var that = this;
document.onkeydown = function (e) {
var key = window.event.keyCode;
if (key === 13) {
that.onSubmit(); //
}
};
},
mounted() {
this.favorList();
},
methods: {
//
favorList() {
this.loading = true;
listFavorApi()
.then((res) => {
this.loading = false;
this.tableDate = res.data;
})
.catch((err) => {});
},
//
handleAddFaove() {
this.title = "新增";
this.$refs.favoraddDialogref.display();
this.$refs.favoraddDialogref.getdataform(null);
},
//
handleResive(data) {
this.title = "修改";
this.$refs.favoraddDialogref.display();
this.$refs.favoraddDialogref.getdataform(data);
},
//
handleDelete(data) {
this.$confirm("确定要删除记录吗,同时删除关联关系?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
deleteFavorApi({ id: data.id }).then((res) => {
if (res.code == 200) {
this.$message({
duration: 1500,
showClose: true,
type: "success",
message: "删除成功!",
});
this.favorList(); //
}
});
})
.catch(() => {
this.$message({
duration: 1500,
showClose: true,
type: "info",
message: "已取消删除",
});
});
},
//
handleCurrentChange(val) {
this.page = val;
this.favorList();
},
//
handleSizeChange(val) {
this.pageSize = val;
this.favorList();
},
},
};
</script>
<style lang="less">
.favorInfoBox {
width: calc(100% - 24px);
height: calc(100% - 24px);
padding: 12px 12px;
background: @color-white;
.deviceBox {
border: 1px solid #dddddd;
height: calc(100% - 24px);
padding: 12px;
border-radius: 4px;
}
.deviceBtnGroup {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 12px;
}
.favorTable {
height: calc(100% - 44px);
//background: #fcc;
}
}
</style>

@ -1,12 +0,0 @@
<template>
<div>分组信息管理</div>
</template>
<script>
export default {
data() {
return {};
}
};
</script>
<style lang="less">
</style>

@ -1,8 +0,0 @@
<template>
<div>杆塔班组用户</div>
</template>
<script>
export default {};
</script>
<style lang="less">
</style>

@ -49,6 +49,12 @@
<span class="custom-tree-node" slot-scope="{ node, data }">
<span v-if="node.level === 1">
<span
v-if="node.label == '收藏夹'"
class="el-icon-folder"
style="margin-right: 6px"
></span>
<span
v-else
class="iconfont icon-dianli"
style="margin-right: 6px"
></span>
@ -306,6 +312,30 @@
<info-dialog ref="infodialog_ref"></info-dialog>
<gps-position ref="gpsdialog_ref"></gps-position>
<morePicPreveiw ref="morePicPreveiw_ref"></morePicPreveiw>
<!-- 收藏弹窗 -->
<el-dialog title="选择收藏夹" :visible.sync="favorListDialog" width="30%">
<el-form :model="favorform" @change="changeFavAl">
<el-form-item label="收藏夹列表">
<el-select
style="width: 244px"
v-model="favorform.favorVal"
placeholder="请选择收藏夹"
>
<el-option
v-for="item in favorOptions"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="favorListDialog = false"> </el-button>
<el-button type="primary" @click="confimFavorBtn"> </el-button>
</span>
</el-dialog>
</div>
</template>
@ -322,6 +352,7 @@ import {
setTermGPSJoggle,
updateTermCamera,
addFavorList,
listFavorApi,
} from "@/utils/api/index";
import previewContain from "./previewContain.vue";
import carouselChart from "../components/carouselChart.vue";
@ -396,6 +427,12 @@ export default {
currentData: "", //
zzradio: -1,
collectFlag: false, //
favorListDialog: false, //
favorform: {
favorVal: "",
}, //
favorOptions: [], //
};
},
watch: {
@ -456,8 +493,12 @@ export default {
handleNodeClick(data) {
this.clearfun();
console.log(data);
if (data.name == "收藏夹") {
// this.$refs.tree.setCurrentKey(this.selectData.id);
if (
(data.dyValue == null || data.dyValue == bsManufacturer) &&
data.hasOwnProperty("list")
) {
this.$refs.tree.setCurrentKey(this.selectData.id);
return;
}
this.selectData = data;
@ -723,21 +764,15 @@ export default {
},
addCollectClick() {
if (!this.collectFlag) {
this.$confirm("此操作将添加至收藏夹, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
this.collectFlag = true;
addFavorList({ list: [this.zztermId], type: 1 }).then((res) => {
this.getLineTreeStatus();
});
this.$message({
type: "success",
message: "添加成功!",
});
});
this.favorListDialog = true;
listFavorApi()
.then((res) => {
if (res.code == 200) {
this.favorOptions = res.data;
this.favorform.favorVal = res.data[0].id;
}
})
.catch((err) => {});
} else {
this.$confirm("此操作将取消收藏, 是否继续?", "提示", {
confirmButtonText: "确定",
@ -745,7 +780,10 @@ export default {
type: "warning",
}).then(() => {
this.collectFlag = false;
addFavorList({ list: [this.zztermId], type: 0 }).then((res) => {
addFavorList({
termid: this.zztermId,
id: 0,
}).then((res) => {
this.getLineTreeStatus();
});
@ -756,6 +794,28 @@ export default {
});
}
},
//
changeFavAl(val) {
console.log(val);
},
//
confimFavorBtn() {
this.collectFlag = true;
console.log(this.favorform.favorVal);
addFavorList({
termid: this.zztermId,
id: this.favorform.favorVal,
}).then((res) => {
if (res.code == 200) {
this.favorListDialog = false;
this.getLineTreeStatus();
this.$message({
type: "success",
message: "添加成功!",
});
}
});
},
//
jumpTowerPic(data) {
console.log("我是从子组件过来的数据");

@ -31,7 +31,7 @@ module.exports = defineConfig({
//表示拦截以/api开头的请求路径
// target: "http://180.166.218.222:40080", //dell服务器环境
target: "http://192.168.50.42:8093/", //湖南
target: "http://192.168.50.7:8094/", //湖南
changOrigin: true, //是否开启跨域
pathRewrite: {
"^/api": "", //重写api把api变成空字符因为我们真正请求的路径是没有api的

Loading…
Cancel
Save