Commit 24d24f17 by 张杰

新增v1.15.0版本需求

1 parent db75cdf8
...@@ -44,4 +44,34 @@ function dictInfo (params) { ...@@ -44,4 +44,34 @@ function dictInfo (params) {
function resetPassword(params) { function resetPassword(params) {
return request(params, '/usercenter/user/resetPassword') return request(params, '/usercenter/user/resetPassword')
} }
// 获取车辆树列表
export const GET_VEHICLE_TREE = params => {
return request(params,'/trialdrive/vehicle/tree')
}
// 获取车辆树列表-查询用户下面的车辆
export const GET_USER_VEHICLE_LIST = params => {
return request(params,'/trialdrive/vehicle/uvlist')
}
// 获取车辆树列表-查询组织下面的车辆
export const GET_ORGANIZATION_VEHICLE_LIST = params => {
return request(params,'/trialdrive/vehicle/ovlist')
}
// 用户管理-指定数据-保存数据
export const SAVE_USER_ASSIGN_INFO = params => {
return request(params,'/trialdrive/vehicle/permit/assign','post')
}
// 用户管理-指定数据-获取用户指定数据
export const GET_USER_ASSIGN_INFO = params => {
return request(params,'/trialdrive/vehicle/permit/assigndetails')
}
// 用户管理-指定数据-文件导入接口
export const IMPORT_VEHICLE_TEMPLATE = '/trialdrive/vehicle/permit/import'
export { getUserList, getSuperUser, addUser, editUser, detailUser, deleteUser, roleList, dictInfo, resetPassword} export { getUserList, getSuperUser, addUser, editUser, detailUser, deleteUser, roleList, dictInfo, resetPassword}
...@@ -23,4 +23,9 @@ export default { ...@@ -23,4 +23,9 @@ export default {
updateOrganizationTree(state, list) { updateOrganizationTree(state, list) {
state.organizationTree = list; state.organizationTree = list;
}, },
// 更新用户组织树数据
updateUserOrganizationTree(state, list) {
state.userVehicleTree = list;
},
}; };
...@@ -16,6 +16,7 @@ const state = { ...@@ -16,6 +16,7 @@ const state = {
vehicleCustomTree:[], // 新增工单-新增车辆-车型数据 vehicleCustomTree:[], // 新增工单-新增车辆-车型数据
deviceAssembly:[], // 新增工单-新增车辆-设备组合 deviceAssembly:[], // 新增工单-新增车辆-设备组合
organizationTree:[], // 组织树 organizationTree:[], // 组织树
userVehicleTree:[], // 用户管理-指定数据-组织树
} }
try { try {
......
<template>
<div class="">
<el-tabs v-model="activeTabs">
<el-tab-pane label="选择数据" name="1">
<select-info ref="selectInfo" :id="id"></select-info>
</el-tab-pane>
<el-tab-pane label="导入数据" name="2">
<import-vehicle :id="id"></import-vehicle>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import SelectInfo from "./select.vue";
import ImportVehicle from "./import.vue";
export default {
name: "AssignInfo",
components: {
SelectInfo,
ImportVehicle,
},
props: {
id: {
type: [String, Number],
default: "",
},
},
data() {
return {
activeTabs: "2",
userId: "",
};
},
mounted() {
this.userId = this.id;
},
methods: {
// 保存数据
saveInfo() {
let id = this.id;
this.$refs.selectInfo.saveInfo(id);
},
},
};
</script>
<style lang="scss" scoped>
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="imort_page">
<div class="choose_box">
<div class="upload_wrap">
<el-input placeholder="请选择需要导入的车辆表格" v-model="uploadFile.name" readonly>
<el-button slot="append" @click="chooseFiles">选择文件</el-button>
</el-input>
<!-- 隐藏上传文件按钮 开始 -->
<el-upload ref="uploadBox" class="upload_box" :auto-upload="false" :headers="uploadHead" :data="uploadParams" :action="uploadPath" multiple :limit="1" :show-file-list="false" :on-change="onChange">
<el-button type="primary">点击上传</el-button>
</el-upload>
<!-- 隐藏上传文件按钮 end -->
</div>
<el-link type="primary" class="el_link">下载模版</el-link>
</div>
<div class="btn_group">
<el-button type="default" size="small">取消</el-button>
<el-button type="primary" size="small">确定</el-button>
</div>
<!-- 导入结果 开始 -->
<div class="upload_result">
<h2 class="title">导入结果</h2>
<div class="result_box">
<div class="cell">
<div class="name">
<span>成功记录</span>
</div>
<span class="txt">11071</span>
</div>
<div class="cell">
<div class="name">
<span>失败记录</span>
<span class="btn">导出记录</span>
</div>
<span class="txt">29</span>
</div>
</div>
</div>
<!-- 导入结果 end -->
</div>
</template>
<script>
import { IMPORT_VEHICLE_TEMPLATE } from "@/services/user";
export default {
name: "ImportVehicle",
props: {
id: {
type: [String, Number],
default: "",
},
},
data() {
return {
fileInfo: "",
uploadPath: "",
uploadHead: {},
uploadFile:{}
};
},
mounted() {
let id = this.id;
let token = localStorage.getItem("token");
this.uploadPath =
this.$root.parentVuex.getters.baseURL + IMPORT_VEHICLE_TEMPLATE;
this.uploadHead = { Authorization: token };
this.uploadParams = { receiverId: id };
},
methods: {
// 选择文件
chooseFiles() {
console.log(this.$refs.uploadBox.$el);
this.$refs.uploadBox.$el.click();
},
// 监听文件选择
onChange(file) {
console.log(file);
this.uploadFile = file;
},
},
};
</script>
<style lang="scss" scoped>
.choose_box {
display: flex;
align-items: center;
padding: 10px 72px;
.el_link {
flex-shrink: 0;
text-align: left;
margin: 0 10px;
}
.upload_wrap {
flex: 1;
position: relative;
.upload_box {
position: absolute;
right: 0;
bottom: 0;
top: 0;
opacity: 0;
}
}
}
.btn_group {
padding: 20px 0 10px 0;
text-align: center;
}
.upload_result {
border-top: 1px solid #eee;
margin-top: 30px;
.title {
font-family: PingFangSC-Medium;
font-size: 20px;
color: #333333;
font-weight: 500;
}
.result_box {
display: flex;
align-items: center;
justify-content: center;
padding-bottom: 30px;
.cell {
width: 248px;
height: 108px;
background: #fbfbfb;
border: 1px solid rgba(215, 215, 215, 1);
border-radius: 4px;
margin: 0 20px;
display: flex;
flex-direction: column;
justify-content: center;
padding: 20px;
box-sizing: border-box;
.name {
font-family: PingFangSC-Medium;
font-size: 14px;
color: #666666;
font-weight: 500;
display: flex;
align-items: center;
.btn {
width: 76px;
height: 30px;
border: 1px solid rgba(33, 150, 243, 1);
border-radius: 4px;
text-align: center;
line-height: 28px;
font-family: PingFangSC-Regular;
font-size: 14px;
color: #409eff;
font-weight: 400;
cursor: pointer;
margin-left: 10px;
}
.btn:hover {
opacity: 0.8;
}
}
.txt {
font-family: PingFangSC-Medium;
font-size: 30px;
color: #333333;
font-weight: 500;
line-height: 1.5;
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!