This commit is contained in:
邱贞招 2024-10-22 21:49:01 +08:00
parent 49b87991ec
commit 8ac555cff8
6 changed files with 68 additions and 28 deletions

View File

@ -9,6 +9,14 @@ export function listModel(query) {
})
}
// 查询所有车辆型号列表
export function listAllModel() {
return request({
url: '/system/model/allList',
method: 'get'
})
}
// 查询车辆型号详细
export function getModel(modelId) {
return request({

View File

@ -431,9 +431,11 @@ export default {
created() {},
mounted() {
this.userName = this.$store.state.user.name;
if(this.userName === 'admin'){
this.AdminStatistics();
window.addEventListener("resize", this.handleResize);
this.getlibord();
}
window.addEventListener("resize", this.handleResize);
},
beforeDestroy() {
window.removeEventListener("resize", this.handleResize);

View File

@ -231,7 +231,7 @@
<script>
import { listFlow, getFlow, delFlow, addFlow, updateFlow } from "@/api/system/flow";
import { optionselect as getAreaOptionselect } from '@/api/system/area'
import { listModel } from '@/api/system/model'
import { listAllModel, listModel } from '@/api/system/model'
export default {
name: "Flow",
@ -294,9 +294,9 @@ export default {
this.getModelList();
},
methods: {
getModelList() { // getAreaOptionselect()
listModel(this.queryParams).then(response => {
this.modelOptions = response.rows;
getModelList() {
listAllModel().then(response => {
this.modelOptions = response.data;
});
},
/** 查询字典类型列表 */

View File

@ -103,7 +103,7 @@
import AMapLoader from "@amap/amap-jsapi-loader";
import globalConfig from "@/utils/config/globalConfig";
import { getDevice, getDeviceLists ,listDevice} from '@/api/system/device'
import { listArea, optionselect as getAreaOptionselect } from '@/api/system/area'
import { getArealist, listArea, optionselect as getAreaOptionselect } from '@/api/system/area'
import { listParking } from '@/api/system/parking'
import LocationMap from '@/components/Map/location/LocationMap'
import OrderRecord from '@/views/system/device/components/orderRecord'
@ -179,7 +179,6 @@ export default {
mounted() {
console.log("当前用户信息:", this.$store.state.user.name)
this.userName = this.$store.state.user.name;
this.getAreaList(this.areaId);
this.getAreaOptions();
},
unmounted() {
@ -203,13 +202,20 @@ export default {
this.cluster = null;
}
await this.getAreaList(this.areaId);
this.getAreaList(this.areaId);
},
getAreaOptions() {
getAreaOptionselect().then(response => {
getArealist().then(response => {
this.areaOptions = response.data;
this.areaId = response.data[0].areaId;
console.log("this.areaId===================", this.areaId)
console.log("areaOptions", this.areaOptions)
if(this.userName == 'admin'){
this.getAreaList(14);
}else{
this.getAreaList(this.areaId);
}
});
},
@ -263,7 +269,7 @@ export default {
});
},
async getAreaList(areaId) {
getAreaList(areaId) {
listArea({ areaId: areaId }).then(response => {
this.areaList = response.rows;
if (this.areaList.length > 0) {

View File

@ -678,7 +678,9 @@ export default {
this.reset2();
this.getList();
this.getAreaList();
if(this.userName === 'admin'){
this.getDeptList();
}
},
watch: {
open(val) {

View File

@ -174,6 +174,13 @@
class-name="small-padding fixed-width"
>
<template slot-scope="scope" v-if="scope.row.userId !== 1">
<el-button
size="mini"
type="text"
icon="el-icon-copy"
@click="copy(scope.row)"
v-hasPermi="['system:user:edit']"
>复制</el-button>
<el-button
size="mini"
type="text"
@ -188,15 +195,6 @@
@click="handleDelete(scope.row)"
v-hasPermi="['system:user:remove']"
>删除</el-button>
<el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['system:user:resetPwd', 'system:user:edit']">
<el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="handleResetPwd" icon="el-icon-key"
v-hasPermi="['system:user:resetPwd']">重置密码</el-dropdown-item>
<el-dropdown-item command="handleAuthRole" icon="el-icon-circle-check"
v-hasPermi="['system:user:edit']">分配角色</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
@ -247,7 +245,7 @@
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="角色">
<el-form-item label="角色" prop="roleIds">
<el-select v-model="form.roleIds" placeholder="请选择角色">
<el-option
v-for="item in roleOptions"
@ -497,6 +495,9 @@ export default {
],
deptId: [
{ required: true, message: "所属代理商不能为空", trigger: "blur" }
],
roleIds: [
{ required: true, message: "用户角色不能为空", trigger: "blur" }
]
}
};
@ -519,11 +520,27 @@ export default {
}
this.getList();
this.getDeptTree();
this.getConfigKey("sys.user.initPassword").then(response => {
this.initPassword = response.msg;
});
// 8
this.initPassword = Math.random().toString(36).slice(-8);
console.log("initPassword---------"+this.initPassword)
},
methods: {
copy(row) {
const account = `账号:${row.userName}`; //
const password = `密码:${row.initPassword}`; //
const fixedUrl = "https://dche.ccttiot.com/"; //
//
const textToCopy = `${fixedUrl}\n${account}\n${password}`;
// 使 Clipboard API
navigator.clipboard.writeText(textToCopy).then(() => {
this.$modal.msgSuccess("已复制到剪贴板"); //
}).catch(err => {
console.error("复制失败:", err);
this.$modal.msgError("复制失败,请手动复制"); //
});
},
getAreaListByDeptId(deptId){
if(deptId) {
selectAreaListByDeptId(deptId).then(response => {
@ -766,6 +783,11 @@ export default {
submitForm: function() {
this.form.userName = this.form.phonenumber;
this.form.userType = '00';
//
if (!this.form.roleIds || this.form.roleIds.length === 0) {
this.$modal.msgError("请选择角色"); //
return; // 退
}
this.form.roleIds = [this.form.roleIds];
console.log("roleIds"+this.form.roleIds)
this.$refs["form"].validate(valid => {