Commit d58ff614 authored by Administrator's avatar Administrator

添加用户

parent 9903a482
Pipeline #105 failed with stages
...@@ -133,7 +133,7 @@ ...@@ -133,7 +133,7 @@
</el-form> </el-form>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="设备uuid" prop="deviceuuid"></el-table-column> <el-table-column label="设备UUID" prop="deviceuuid" width="380px"></el-table-column>
<el-table-column label="设备联系人" prop="devicelinkman"></el-table-column> <el-table-column label="设备联系人" prop="devicelinkman"></el-table-column>
<el-table-column label="设备手机号" prop="devicephone"></el-table-column> <el-table-column label="设备手机号" prop="devicephone"></el-table-column>
</el-table> </el-table>
......
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
<el-card class="box-card" style="height: 20000px;"> <el-card class="box-card" style="height: 20000px;">
<div v-loading="userCreating" class="form-container"> <div v-loading="userCreating" class="form-container">
<el-form ref="userForm" :rules="rules" :model="newUser" label-position="left" label-width="150px" style="max-width: 500px;"> <el-form ref="userForm" :rules="rules" :model="newUser" label-position="left" label-width="150px" style="max-width: 500px;">
<el-form-item label="选择权限" prop="role"> <el-form-item label="选择角色" prop="role">
<el-select v-model="newUser.role" class="filter-item" placeholder="Please select role"> <el-select v-model="newUser.role" class="filter-item" placeholder="Please select role">
<el-option v-for="item in nonAdminRoles" :key="item" :label="item | uppercaseFirst" :value="item" /> <el-option v-for="item in nonAdminRoles" :key="item" :label="item | uppercaseFirst" :value="item" />
</el-select> </el-select>
...@@ -115,7 +115,9 @@ ...@@ -115,7 +115,9 @@
</el-form-item> </el-form-item>
<el-form-item label="坐标" prop="mapcenter"> <el-form-item label="坐标" prop="mapcenter">
<el-input v-model="newUser.mapcenter" style="width:155px" /> <el-input v-model="newUser.mapcenter" style="width:155px" />
<el-button type="primary" size="small" plain @click="positionUrl">拾取坐标</el-button> <el-button type="primary" @click="drawerMap = true">
拾取坐标
</el-button>
</el-form-item> </el-form-item>
<el-form-item label="选择地址" prop="role"> <el-form-item label="选择地址" prop="role">
<el-select v-model="newUser.province" class="filter-item" placeholder="省" @change="postcity"> <el-select v-model="newUser.province" class="filter-item" placeholder="省" @change="postcity">
...@@ -147,6 +149,9 @@ ...@@ -147,6 +149,9 @@
</div> </div>
</div> </div>
</el-card> </el-card>
<el-drawer title="拾取坐标" :visible.sync="drawerMap" :modal="false" :direction="directionMap" :before-close="handleClose" size="70%" :with-header="false">
<div><CoordinateMap @map-confirm="mapConfirmData" @giveLnglat="getLnglat"></CoordinateMap></div>
</el-drawer>
</el-drawer> </el-drawer>
</div> </div>
</template> </template>
...@@ -159,13 +164,14 @@ import Resource from '@/api/resource'; ...@@ -159,13 +164,14 @@ import Resource from '@/api/resource';
import waves from '@/directive/waves'; // Waves directive import waves from '@/directive/waves'; // Waves directive
import permission from '@/directive/permission'; // Permission directive import permission from '@/directive/permission'; // Permission directive
import checkPermission from '@/utils/permission'; // Permission checking import checkPermission from '@/utils/permission'; // Permission checking
import CoordinateMap from '@/components/coordinateMap';
const userResource = new UserResource(); const userResource = new UserResource();
const permissionResource = new Resource('permissions'); const permissionResource = new Resource('permissions');
export default { export default {
name: 'UserList', name: 'UserList',
components: { Pagination }, components: { Pagination, CoordinateMap },
directives: { waves, permission }, directives: { waves, permission },
data() { data() {
var validateConfirmPassword = (rule, value, callback) => { var validateConfirmPassword = (rule, value, callback) => {
...@@ -176,10 +182,12 @@ export default { ...@@ -176,10 +182,12 @@ export default {
} }
}; };
return { return {
drawerMap: false,
directionMap: 'rtl',
list: null, list: null,
total: 0, total: 0,
drawer: false, drawer: false,
direction: 'rtl', direction: 'ltr',
loading: true, loading: true,
downloading: false, downloading: false,
userCreating: false, userCreating: false,
...@@ -302,6 +310,18 @@ export default { ...@@ -302,6 +310,18 @@ export default {
} }
}, },
methods: { methods: {
mapConfirmData(text) {
if (text.state === true) {
this.newUser.mapcenter = text.location;
this.drawerMap = false;
}
if (text.state === false) {
this.drawerMap = false;
}
},
getLnglat(lnglnt) {
console.log(lnglnt);
},
checkPermission, checkPermission,
async getPermissions() { async getPermissions() {
const { data } = await permissionResource.list({}); const { data } = await permissionResource.list({});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment