Compare commits
63 Commits
Author | SHA1 | Date |
---|---|---|
|
8ffb77634f | 1 year ago |
|
c2797030dc | 1 year ago |
|
c9a84a7eb3 | 1 year ago |
|
5c3ce1f285 | 1 year ago |
|
e3b3e08682 | 1 year ago |
|
2dc62f2d57 | 1 year ago |
|
c30be6e10c | 1 year ago |
|
dd7fc8b9e4 | 1 year ago |
|
6197c53804 | 1 year ago |
|
4f7c960e6b | 1 year ago |
|
c9f58fb9ce | 1 year ago |
|
e58d1c07cb | 1 year ago |
|
fcdde8aa33 | 1 year ago |
|
fa46e54a1d | 1 year ago |
|
818214d10d | 1 year ago |
|
d3ea703444 | 1 year ago |
|
e5bf15f4a2 | 1 year ago |
|
bbed91b05e | 1 year ago |
|
8ff60d0a52 | 1 year ago |
|
4e4cfc26e0 | 1 year ago |
|
c6c82dc570 | 1 year ago |
|
ce1b533423 | 1 year ago |
|
bd9b11294c | 1 year ago |
|
88edc135a9 | 1 year ago |
|
fa1d3650dd | 1 year ago |
|
92994a3ef0 | 1 year ago |
|
7970f3e4b3 | 1 year ago |
|
733715a903 | 2 years ago |
|
ff7556dabe | 2 years ago |
|
be998f5ced | 2 years ago |
|
5bc7261752 | 2 years ago |
|
ba823ee505 | 2 years ago |
|
25ca61b79e | 2 years ago |
|
d2249ca1d0 | 2 years ago |
|
0806ead733 | 2 years ago |
|
70df922e2a | 2 years ago |
|
4b33b2fb93 | 2 years ago |
|
a2d0bde682 | 2 years ago |
|
9f6463bfd6 | 2 years ago |
|
f734489a79 | 2 years ago |
|
aa9b6a4f09 | 2 years ago |
|
05037ccc6d | 2 years ago |
|
df63fb7b81 | 2 years ago |
|
83a531be52 | 2 years ago |
|
4aa18787c3 | 2 years ago |
|
a7a0b600f2 | 2 years ago |
|
b17f4424a6 | 2 years ago |
|
25342a89e9 | 2 years ago |
|
f606b9003e | 2 years ago |
|
96a75a4e6b | 2 years ago |
|
56e425f513 | 2 years ago |
|
a8c6a339c5 | 2 years ago |
|
c50d9597a0 | 2 years ago |
|
08bb06f78c | 2 years ago |
|
1e63720f56 | 2 years ago |
|
e9cb3bcbbf | 2 years ago |
|
3fe5f93838 | 2 years ago |
|
82f60a0fa9 | 2 years ago |
|
c46203b0c1 | 2 years ago |
|
d8bb891ba2 | 2 years ago |
|
42a7c92543 | 2 years ago |
|
1f9476a5c3 | 2 years ago |
|
bca647a736 | 2 years ago |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 7.9 KiB |
@ -0,0 +1,61 @@
|
||||
@font-face {
|
||||
font-family: "iconfont"; /* Project id */
|
||||
src: url('iconfont.ttf?t=1690188947515') format('truetype');
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
font-family: "iconfont" !important;
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-paizhao:before {
|
||||
content: "\e6ba";
|
||||
}
|
||||
|
||||
.icon-paizhao-xianxing:before {
|
||||
content: "\e8d1";
|
||||
}
|
||||
|
||||
.icon-tuiguanglishitupianjinqun:before {
|
||||
content: "\e613";
|
||||
}
|
||||
|
||||
.icon-gongsi:before {
|
||||
content: "\e62e";
|
||||
}
|
||||
|
||||
.icon-dianli:before {
|
||||
content: "\e649";
|
||||
}
|
||||
|
||||
.icon-dianlihangye:before {
|
||||
content: "\e791";
|
||||
}
|
||||
|
||||
.icon-shexiangtoulixian:before {
|
||||
content: "\e7b2";
|
||||
}
|
||||
|
||||
.icon-video-camera:before {
|
||||
content: "\e962";
|
||||
}
|
||||
|
||||
.icon-shexiangtou-lixian:before {
|
||||
content: "\ef1c";
|
||||
}
|
||||
|
||||
.icon-shexiangtou-zaixian:before {
|
||||
content: "\ef1d";
|
||||
}
|
||||
|
||||
.icon-shudianxianlu_2722010801:before {
|
||||
content: "\efed";
|
||||
}
|
||||
|
||||
.icon-tupian_normal:before {
|
||||
content: "\e681";
|
||||
}
|
||||
|
Binary file not shown.
Binary file not shown.
@ -0,0 +1,57 @@
|
||||
import Vue from "vue";
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
caches: [],
|
||||
},
|
||||
actions: {
|
||||
// 添加缓存的路由组件
|
||||
addCache({ state, dispatch }, componentName) {
|
||||
if (Array.isArray(componentName)) {
|
||||
componentName.forEach((item) => {
|
||||
dispatch("addCache", item);
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const { caches } = state;
|
||||
if (!componentName || caches.includes(componentName)) return;
|
||||
|
||||
caches.push(componentName);
|
||||
console.log("缓存路由组件:", componentName);
|
||||
},
|
||||
|
||||
// 移除缓存的路由组件
|
||||
removeCache({ state, dispatch }, componentName) {
|
||||
if (Array.isArray(componentName)) {
|
||||
componentName.forEach((item) => {
|
||||
dispatch("removeCache", item);
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const { caches } = state;
|
||||
const index = caches.indexOf(componentName);
|
||||
if (index > -1) {
|
||||
console.log("清除缓存的路由组件:", componentName);
|
||||
return caches.splice(index, 1)[0];
|
||||
}
|
||||
},
|
||||
// 移除缓存的路由组件的实例
|
||||
async removeCacheEntry({ dispatch }, componentName) {
|
||||
const cacheRemoved = await dispatch("removeCache", componentName);
|
||||
if (cacheRemoved) {
|
||||
await Vue.nextTick();
|
||||
dispatch("addCache", componentName);
|
||||
}
|
||||
},
|
||||
// 清除缓存的路由组件的实例
|
||||
clearEntry({ state, dispatch }) {
|
||||
const { caches } = state;
|
||||
caches.slice().forEach((key) => {
|
||||
dispatch("removeCacheEntry", key);
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
@ -0,0 +1,4 @@
|
||||
import Vue from 'vue'
|
||||
|
||||
const EventBus = new Vue()
|
||||
export default EventBus
|
@ -0,0 +1,326 @@
|
||||
<template>
|
||||
<div class="icingBox">
|
||||
<div class="icingContain">
|
||||
<leftTree ref="sideTree"></leftTree>
|
||||
<div class="rightTable">
|
||||
<div class="dataBox">
|
||||
<div class="childBox">
|
||||
<div class="searchBox" ref="searchref">
|
||||
<el-form
|
||||
:inline="true"
|
||||
:model="formdata"
|
||||
class="demo-form-inline"
|
||||
>
|
||||
<el-form-item label="开始日期">
|
||||
<el-date-picker
|
||||
v-model="formdata.starttime"
|
||||
type="date"
|
||||
placeholder="开始日期"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="结束日期">
|
||||
<el-date-picker
|
||||
v-model="formdata.endtime"
|
||||
type="date"
|
||||
placeholder="结束日期"
|
||||
class="ml10"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit">查询</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit"
|
||||
>导出数据</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="childTableShowBox">
|
||||
<el-table :data="tableData" style="width: 100%">
|
||||
<el-table-column
|
||||
prop="terminalNumber"
|
||||
label="监测终端编号"
|
||||
></el-table-column>
|
||||
<el-table-column prop="time" label="时间"></el-table-column>
|
||||
<el-table-column
|
||||
prop="functionalUnitIdentifier"
|
||||
label="功能单元识别码"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="maxPullForceKg"
|
||||
label="最大拉力(Kg)"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="maxPullForceWindBiasAngle"
|
||||
label="最大拉力时风偏角(°)"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="maxPullForceTiltAngle"
|
||||
label="最大拉力时倾斜角(°)"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="minPullForceKg"
|
||||
label="最小拉力(Kg)"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="minPullForceWindBiasAngle"
|
||||
label="最小拉力时风偏角(°)"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="minPullForceTiltAngle"
|
||||
label="最小拉力时倾斜角(°)"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="maxWindBiasAngle"
|
||||
label="最大风偏角(°)"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="maxWindBiasAngleTiltAngle"
|
||||
label="最大风偏角时倾斜角(°)"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="maxWindBiasAnglePullForceKg"
|
||||
label="最大风偏角时拉力(Kg)"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="minWindBiasAngle"
|
||||
label="最小风偏角(°)"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="minWindBiasAngleTiltAngle"
|
||||
label="最小风偏角时倾斜角(°)"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="minWindBiasAnglePullForceKg"
|
||||
label="最小风偏角时拉力(Kg)"
|
||||
></el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<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"
|
||||
>
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import leftTree from "../../fubingCommon/leftTree";
|
||||
export default {
|
||||
name: "icing",
|
||||
components: {
|
||||
leftTree,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
msg: "",
|
||||
childFlag: false,
|
||||
tableData: [],
|
||||
formdata: {},
|
||||
page: 1, // 当前页数
|
||||
pageSize: 20, // 每页数量
|
||||
total: 0, //总条数
|
||||
};
|
||||
},
|
||||
created() {
|
||||
var that = this;
|
||||
document.onkeydown = function (e) {
|
||||
var key = window.event.keyCode;
|
||||
if (key === 13) {
|
||||
that.onSubmit(); // 触发事件
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.$set(
|
||||
this.formdata,
|
||||
"starttime",
|
||||
new Date(new Date().toLocaleDateString()).getTime()
|
||||
);
|
||||
this.$set(this.formdata, "endtime", new Date().getTime());
|
||||
},
|
||||
methods: {
|
||||
getCurrentData(data) {
|
||||
console.log("执行父组件", data);
|
||||
if (data.dyValue) {
|
||||
console.log("电压");
|
||||
|
||||
this.tableData = [
|
||||
{
|
||||
terminalNumber: "终端A",
|
||||
time: "2023-03-15 08:00:00",
|
||||
functionalUnitIdentifier: "功能单元1",
|
||||
maxPullForceKg: "20Kg",
|
||||
maxPullForceWindBiasAngle: "60°",
|
||||
maxPullForceTiltAngle: "30°",
|
||||
minPullForceKg: "5Kg",
|
||||
minPullForceWindBiasAngle: "30°",
|
||||
minPullForceTiltAngle: "20°",
|
||||
maxWindBiasAngle: "70°",
|
||||
maxWindBiasAngleTiltAngle: "45°",
|
||||
maxWindBiasAnglePullForceKg: "15Kg",
|
||||
minWindBiasAngle: "20°",
|
||||
minWindBiasAngleTiltAngle: "30°",
|
||||
minWindBiasAnglePullForceKg: "8Kg",
|
||||
},
|
||||
{
|
||||
terminalNumber: "终端A",
|
||||
time: "2023-03-15 08:00:00",
|
||||
functionalUnitIdentifier: "功能单元1",
|
||||
maxPullForceKg: "20Kg",
|
||||
maxPullForceWindBiasAngle: "60°",
|
||||
maxPullForceTiltAngle: "30°",
|
||||
minPullForceKg: "5Kg",
|
||||
minPullForceWindBiasAngle: "30°",
|
||||
minPullForceTiltAngle: "20°",
|
||||
maxWindBiasAngle: "70°",
|
||||
maxWindBiasAngleTiltAngle: "45°",
|
||||
maxWindBiasAnglePullForceKg: "15Kg",
|
||||
minWindBiasAngle: "20°",
|
||||
minWindBiasAngleTiltAngle: "30°",
|
||||
minWindBiasAnglePullForceKg: "8Kg",
|
||||
},
|
||||
{
|
||||
terminalNumber: "终端A",
|
||||
time: "2023-03-15 08:00:00",
|
||||
functionalUnitIdentifier: "功能单元1",
|
||||
maxPullForceKg: "20Kg",
|
||||
maxPullForceWindBiasAngle: "60°",
|
||||
maxPullForceTiltAngle: "30°",
|
||||
minPullForceKg: "5Kg",
|
||||
minPullForceWindBiasAngle: "30°",
|
||||
minPullForceTiltAngle: "20°",
|
||||
maxWindBiasAngle: "70°",
|
||||
maxWindBiasAngleTiltAngle: "45°",
|
||||
maxWindBiasAnglePullForceKg: "15Kg",
|
||||
minWindBiasAngle: "20°",
|
||||
minWindBiasAngleTiltAngle: "30°",
|
||||
minWindBiasAnglePullForceKg: "8Kg",
|
||||
},
|
||||
];
|
||||
} else if (data.bsManufacturer) {
|
||||
this.tableData = [
|
||||
{
|
||||
terminalNumber: "终端A",
|
||||
time: "2023-03-15 08:00:00",
|
||||
functionalUnitIdentifier: "功能单元1",
|
||||
maxPullForceKg: "20Kg",
|
||||
maxPullForceWindBiasAngle: "60°",
|
||||
maxPullForceTiltAngle: "30°",
|
||||
minPullForceKg: "5Kg",
|
||||
minPullForceWindBiasAngle: "30°",
|
||||
minPullForceTiltAngle: "20°",
|
||||
maxWindBiasAngle: "70°",
|
||||
maxWindBiasAngleTiltAngle: "45°",
|
||||
maxWindBiasAnglePullForceKg: "15Kg",
|
||||
minWindBiasAngle: "20°",
|
||||
minWindBiasAngleTiltAngle: "30°",
|
||||
minWindBiasAnglePullForceKg: "8Kg",
|
||||
},
|
||||
{
|
||||
terminalNumber: "终端A",
|
||||
time: "2023-03-15 08:00:00",
|
||||
functionalUnitIdentifier: "功能单元1",
|
||||
maxPullForceKg: "20Kg",
|
||||
maxPullForceWindBiasAngle: "60°",
|
||||
maxPullForceTiltAngle: "30°",
|
||||
minPullForceKg: "5Kg",
|
||||
minPullForceWindBiasAngle: "30°",
|
||||
minPullForceTiltAngle: "20°",
|
||||
maxWindBiasAngle: "70°",
|
||||
maxWindBiasAngleTiltAngle: "45°",
|
||||
maxWindBiasAnglePullForceKg: "15Kg",
|
||||
minWindBiasAngle: "20°",
|
||||
minWindBiasAngleTiltAngle: "30°",
|
||||
minWindBiasAnglePullForceKg: "8Kg",
|
||||
},
|
||||
];
|
||||
} else {
|
||||
console.log("杆塔");
|
||||
this.tableData = [
|
||||
{
|
||||
terminalNumber: "终端A",
|
||||
time: "2023-03-15 08:00:00",
|
||||
functionalUnitIdentifier: "功能单元1",
|
||||
maxPullForceKg: "20Kg",
|
||||
maxPullForceWindBiasAngle: "60°",
|
||||
maxPullForceTiltAngle: "30°",
|
||||
minPullForceKg: "5Kg",
|
||||
minPullForceWindBiasAngle: "30°",
|
||||
minPullForceTiltAngle: "20°",
|
||||
maxWindBiasAngle: "70°",
|
||||
maxWindBiasAngleTiltAngle: "45°",
|
||||
maxWindBiasAnglePullForceKg: "15Kg",
|
||||
minWindBiasAngle: "20°",
|
||||
minWindBiasAngleTiltAngle: "30°",
|
||||
minWindBiasAnglePullForceKg: "8Kg",
|
||||
},
|
||||
];
|
||||
}
|
||||
},
|
||||
onSubmit() {},
|
||||
//点击分页
|
||||
handleCurrentChange(val) {
|
||||
this.page = val;
|
||||
// this.picList = [];
|
||||
// this.getPicData();
|
||||
},
|
||||
//每页条数
|
||||
handleSizeChange(val) {
|
||||
this.pageSize = val;
|
||||
//this.getPicData();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="less">
|
||||
.icingBox {
|
||||
width: calc(100% - 24px);
|
||||
height: calc(100% - 24px);
|
||||
padding: 12px 12px;
|
||||
background: #fff;
|
||||
.icingContain {
|
||||
display: flex;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
background: #fff;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.rightTable {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
border-left: 1px solid #ddd;
|
||||
.dataBox {
|
||||
width: calc(100% - 24px);
|
||||
height: calc(100% - 24px);
|
||||
padding: 12px 12px;
|
||||
background: #fff;
|
||||
}
|
||||
// .fatherTableShowBox {
|
||||
// height: calc(100% - 0px);
|
||||
// }
|
||||
.childBox {
|
||||
height: calc(100% - 50px);
|
||||
.childTableShowBox {
|
||||
height: calc(100% - 50px);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,34 @@
|
||||
<template>
|
||||
<div class="buttonBox">
|
||||
<el-button type="primary" @click="handleSetChannel">APP设置 </el-button>
|
||||
<setAppDialog ref="setChannelDialog_ref"></setAppDialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {} from "@/utils/api/index";
|
||||
import setAppDialog from "./setAppDialog.vue";
|
||||
export default {
|
||||
components: { setAppDialog },
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
watch: {},
|
||||
mounted() {},
|
||||
computed: {
|
||||
termId() {
|
||||
return this.$store.state.termId;
|
||||
},
|
||||
channelIdList() {
|
||||
return this.$store.state.channelIdList;
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
handleSetChannel() {
|
||||
this.$refs.setChannelDialog_ref.display();
|
||||
},
|
||||
},
|
||||
destroyed() {},
|
||||
beforeRouteLeave(to, from, next) {},
|
||||
};
|
||||
</script>
|
@ -0,0 +1,34 @@
|
||||
<template>
|
||||
<div class="buttonBox">
|
||||
<el-button type="primary" @click="handleSetChannel">通道设置 </el-button>
|
||||
<setChannelDialog ref="setChannelDialog_ref"></setChannelDialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {} from "@/utils/api/index";
|
||||
import setChannelDialog from "./setChannelDialog.vue";
|
||||
export default {
|
||||
components: { setChannelDialog },
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
watch: {},
|
||||
mounted() {},
|
||||
computed: {
|
||||
termId() {
|
||||
return this.$store.state.termId;
|
||||
},
|
||||
channelIdList() {
|
||||
return this.$store.state.channelIdList;
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
handleSetChannel() {
|
||||
this.$refs.setChannelDialog_ref.display();
|
||||
},
|
||||
},
|
||||
destroyed() {},
|
||||
beforeRouteLeave(to, from, next) {},
|
||||
};
|
||||
</script>
|
@ -0,0 +1,143 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
class="uploadPic"
|
||||
title="上传图片"
|
||||
:visible.sync="isShow"
|
||||
:close-on-click-modal="false"
|
||||
width="600px"
|
||||
@close="handleclose"
|
||||
>
|
||||
<div class="uploadBox">
|
||||
<el-form ref="form" :model="form" label-width="80px">
|
||||
<el-form-item label="装置编号">
|
||||
<el-input v-model="form.cmdid"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="装置Id">
|
||||
<el-input v-model="form.termid"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="通道选择">
|
||||
<el-select v-model="form.channel" placeholder="选择通道">
|
||||
<el-option label="通道一" :value="1"></el-option>
|
||||
<el-option label="通道二" :value="2"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="选择时间">
|
||||
<el-date-picker
|
||||
v-model="form.phototime"
|
||||
value-format="timestamp"
|
||||
type="datetime"
|
||||
placeholder="选择日期时间"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="">
|
||||
<el-upload
|
||||
class="upload-demo"
|
||||
ref="upload"
|
||||
action="#"
|
||||
:http-request="httpRequest"
|
||||
>
|
||||
<el-button slot="trigger" size="small" type="primary"
|
||||
>选取图片</el-button
|
||||
>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="isShow = false">取 消</el-button>
|
||||
<el-button type="primary" @click="handlesure">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { uploadPicApi } from "@/utils/api/index";
|
||||
export default {
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
isShow: false,
|
||||
form: {},
|
||||
fileList: [], //上传列表
|
||||
};
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
httpRequest(raw) {
|
||||
this.fileList.push(raw);
|
||||
},
|
||||
//数据库获取最新数据
|
||||
display(data) {
|
||||
console.log(data);
|
||||
this.$set(this.form, "cmdid", data.cmdid);
|
||||
this.$set(this.form, "termid", data.id);
|
||||
this.isShow = true;
|
||||
},
|
||||
handleclose() {
|
||||
this.isShow = false;
|
||||
this.fileList = [];
|
||||
},
|
||||
handlesure() {
|
||||
this.isShow = false;
|
||||
//console.log(this.fileList[0].file);
|
||||
this.$set(this.form, "file", this.fileList[0].file);
|
||||
console.log(this.form);
|
||||
uploadPicApi(this.form)
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
this.$message({
|
||||
duration: 1500,
|
||||
showClose: true,
|
||||
message: "上传成功",
|
||||
type: "success",
|
||||
});
|
||||
this.fileList = [];
|
||||
})
|
||||
.catch((err) => {});
|
||||
},
|
||||
},
|
||||
destroyed() {
|
||||
this.isShow = false;
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="less">
|
||||
.uploadPic {
|
||||
.uploadBox {
|
||||
}
|
||||
.upload-demo {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: row-reverse;
|
||||
margin-right: 16px;
|
||||
.el-upload-list {
|
||||
width: 370px;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
border: 1px solid #dcdfe6;
|
||||
background: #fff;
|
||||
margin-right: 12px;
|
||||
border-radius: 4px;
|
||||
.el-upload-list__item-name {
|
||||
margin-right: 0px;
|
||||
}
|
||||
.el-upload-list__item {
|
||||
transition: none;
|
||||
font-size: 14px;
|
||||
color: #606266;
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
border-radius: 4px;
|
||||
width: 100%;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
margin-top: 0px !important;
|
||||
.el-icon-close {
|
||||
top: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -0,0 +1,129 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
class="addUserDialog"
|
||||
:title="title"
|
||||
:visible.sync="isShow"
|
||||
:close-on-click-modal="false"
|
||||
width="470px"
|
||||
@close="handleclose"
|
||||
>
|
||||
<el-form
|
||||
label-position="left"
|
||||
ref="formInfo"
|
||||
label-width="100px"
|
||||
:rules="title == '新增' ? rules : xgrules"
|
||||
:model="formdata"
|
||||
>
|
||||
<el-form-item label="角色名称:" prop="roleName">
|
||||
<el-input
|
||||
placeholder="请输入角色名称"
|
||||
v-model="formdata.roleName"
|
||||
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 { addUserApi, updateUserApi } from "@/utils/api/index";
|
||||
export default {
|
||||
props: {
|
||||
title: String,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
roleUser: "",
|
||||
isShow: false,
|
||||
|
||||
formdata: {},
|
||||
rules: {
|
||||
roleName: [
|
||||
{ required: true, message: "请输入用户名", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
xgrules: {
|
||||
roleName: [
|
||||
{ required: true, message: "请输入用户名", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
//判断
|
||||
getdataform(val) {
|
||||
console.log(val);
|
||||
if (val == null) {
|
||||
return (this.formdata = {
|
||||
role: 2,
|
||||
});
|
||||
}
|
||||
//this.formdata = val;
|
||||
this.formdata = JSON.parse(JSON.stringify(val));
|
||||
},
|
||||
// 保存确定操作
|
||||
submitForm() {
|
||||
this.$refs.formInfo.validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.title == "新增") {
|
||||
addUserApi(this.formdata)
|
||||
.then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.$message({
|
||||
duration: 1500,
|
||||
showClose: true,
|
||||
message: "添加成功",
|
||||
type: "success",
|
||||
});
|
||||
this.isShow = false;
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
})
|
||||
.catch((err) => {});
|
||||
} else {
|
||||
updateUserApi(this.formdata)
|
||||
.then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.$message.success("修改成功");
|
||||
this.isShow = false;
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
})
|
||||
.catch((err) => {});
|
||||
}
|
||||
} else {
|
||||
console.log("error submit!!");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
display() {
|
||||
this.isShow = true;
|
||||
this.roleUser = localStorage.getItem("role");
|
||||
},
|
||||
hide() {
|
||||
this.isShow = false;
|
||||
},
|
||||
handleclose() {
|
||||
this.$parent.roleListAll();
|
||||
},
|
||||
},
|
||||
mounted() {},
|
||||
};
|
||||
</script>
|
||||
<style lang="less">
|
||||
.addUserDialog {
|
||||
.el-form-item {
|
||||
.el-input,
|
||||
.el-select,
|
||||
.el-input-number {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -0,0 +1,190 @@
|
||||
<template>
|
||||
<div class="rolemanagement">
|
||||
<div class="deviceBox">
|
||||
<div class="deviceBtnGroup">
|
||||
<h4>角色管理</h4>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="handleAdddevice()"
|
||||
>新增</el-button
|
||||
>
|
||||
</div>
|
||||
<div class="deviceTable">
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="roleTableData"
|
||||
stripe
|
||||
tooltip-effect="dark"
|
||||
style="width: 100%"
|
||||
height="calc(100% - 40px)"
|
||||
@row-click="handleRowClick"
|
||||
>
|
||||
<template slot="empty">
|
||||
<el-empty :image-size="160" description="暂无数据"></el-empty>
|
||||
</template>
|
||||
<el-table-column
|
||||
label="角色"
|
||||
show-overflow-tooltip
|
||||
prop="userName"
|
||||
></el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
show-overflow-tooltip
|
||||
prop="createTime"
|
||||
>
|
||||
<template slot-scope="scope">{{
|
||||
$moment(scope.row.createTime).format("yy-MM-DD HH:mm:ss")
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column fixed="right" label="操作" width="200">
|
||||
<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>
|
||||
<!-- 新增 -->
|
||||
<addRole :title="title" ref="adduserref"></addRole>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import addRole from "./components/addRole.vue";
|
||||
import { getRoleList, deleteRole } from "@/utils/api/index";
|
||||
|
||||
export default {
|
||||
name: "roleManagement",
|
||||
components: {
|
||||
addRole,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: "", //弹窗标题
|
||||
roleTableData: [],
|
||||
//multipleSelection: [], //获取当前选中
|
||||
page: 1, // 当前页数
|
||||
pageSize: 20, // 每页数量
|
||||
total: 0, //总条数
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.roleListAll();
|
||||
},
|
||||
methods: {
|
||||
//获取线路列表数据
|
||||
roleListAll() {
|
||||
getRoleList()
|
||||
.then((res) => {
|
||||
this.roleTableData = res.data.list;
|
||||
this.total = res.data.total;
|
||||
})
|
||||
.catch((err) => {});
|
||||
},
|
||||
//点击行选中
|
||||
handleRowClick(row, column, event) {
|
||||
this.$refs.multipleTable.toggleRowSelection(row);
|
||||
},
|
||||
//获取选中的行
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
// 新建
|
||||
handleAdddevice() {
|
||||
this.title = "新增";
|
||||
this.$refs.adduserref.display();
|
||||
this.$refs.adduserref.getdataform(null);
|
||||
},
|
||||
|
||||
//修改
|
||||
handleResive(data) {
|
||||
this.title = "修改";
|
||||
this.$refs.adduserref.display();
|
||||
this.$refs.adduserref.getdataform(data);
|
||||
},
|
||||
|
||||
//删除数据
|
||||
handleDelete(data) {
|
||||
this.$confirm("确定要删除记录吗,同时删除关联关系?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
deleteRole({ uid: data.userId }).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.$message.success("删除成功");
|
||||
this.roleListAll(); //刷新
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message({
|
||||
duration: 1500,
|
||||
showClose: true,
|
||||
type: "info",
|
||||
message: "已取消删除",
|
||||
});
|
||||
});
|
||||
},
|
||||
//点击分页
|
||||
handleCurrentChange(val) {
|
||||
this.page = val;
|
||||
this.roleListAll();
|
||||
},
|
||||
//每页条数
|
||||
handleSizeChange(val) {
|
||||
this.pageSize = val;
|
||||
this.roleListAll();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="less">
|
||||
.rolemanagement {
|
||||
width: calc(100% - 24px);
|
||||
height: calc(100% - 24px);
|
||||
padding: 12px 12px;
|
||||
background: #fff;
|
||||
|
||||
.deviceBox {
|
||||
border: 1px solid #dddddd;
|
||||
height: calc(100% - 24px);
|
||||
padding: 12px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.deviceBtnGroup {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.deviceTable {
|
||||
margin-top: 16px;
|
||||
height: calc(100% - 48px);
|
||||
//background: #fcc;
|
||||
}
|
||||
}
|
||||
</style>
|
Loading…
Reference in New Issue