123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402 |
- <!-- 个人信息 -->
- <template>
- <div>
- <div class="block">
- <div class="titlePanel">
- <div class="titlePanelBor">个人信息</div>
- </div>
- <div class="flexBox">
- <div class="flexItem"><span class="label">用户名:</span>{{userInfo.username}}</div>
- <div class="flexItem"><span class="label">账户类型:</span>{{roleType}}</div>
- <div class="flexItem"><span class="label">独占类型:</span>{{userInfo.useTypeName}}</div>
- <div class="flexItem"><span class="label">所属公司:</span>{{userInfo.company}}</div>
- <div class="flexItem"><span class="label">联系人:</span>{{userInfo.nickname}}</div>
- <div class="flexItem"><span class="label">联系方式:</span>{{userInfo.phone}}<span class="textButton" @click="changePhone">修改联系方式</span></div>
- <div class="flexItem"><span class="label">密码:</span>{{"***********"}}<span class="textButton" @click="changePassword">修改密码</span></div>
- </div>
- </div>
- <div class="block">
- <div class="titlePanel">
- <div class="titlePanelBor">配置信息</div>
- </div>
- <div class="flexBox">
- <div class="flexItem"><span class="label2">可创建子账户数量:</span>{{configInfo.numCreateUser}}</div>
- <div class="flexItem"><span class="label2">可创建测试包数量:</span>{{configInfo.numCreateScenePackage}}</div>
- <div class="flexItem"><span class="label2">测试包最大场景数量:</span>{{configInfo.numScenePerPackage}}</div>
- <div class="flexItem"></div>
- <div class="flexItem"><span class="label2">仿真软件license:</span>{{clusterInfo.numSimulationLicense}}</div>
- <div class="flexItem"><span class="label2">到期时间:</span>{{clusterInfo.dateSimulationLicense}}</div>
- <div class="flexItem"><span class="label2">动力学软件license:</span>{{clusterInfo.numDynamicLicense}}</div>
- <div class="flexItem"><span class="label2">到期时间:</span>{{clusterInfo.dateDynamicLicense}}</div>
- </div>
- </div>
- <div class="block">
- <div class="titlePanel">
- <div class="titlePanelBor">场景资源</div>
- <tableList
- ref="table"
- style="min-width: 900px;margin: auto;"
- :columns="columns"
- :getDataWay="getDataWay"
- index
- >
- </tableList>
- </div>
- </div>
- <el-dialog
- title="修改联系方式"
- :visible.sync="phoneDialogVisible"
- width="690px"
- :close-on-click-modal="false"
- :close-on-press-escape="false"
- >
- <el-form
- ref="phoneForm"
- :model="phoneForm"
- :rules="phoneRules"
- label-width="108px"
- >
- <el-form-item label="联系人:" prop="nickname">
- <el-input
- v-autoTrim="{
- obj: phoneForm,
- key: 'nickname',
- }"
- v-model="phoneForm.nickname"
- placeholder="请输入"
- maxlength="20"
- ></el-input>
- </el-form-item>
- <el-form-item label="联系方式:" prop="phone">
- <el-input
- v-autoTrim="{
- obj: phoneForm,
- key: 'phone',
- }"
- v-model="phoneForm.phone"
- placeholder="请输入"
- maxlength="20"
- ></el-input>
- </el-form-item>
- </el-form>
- <span slot="footer">
- <el-button type="primary" @click="confirmChangePhone">确 定</el-button>
- <el-button @click="phoneDialogVisible = false">取 消</el-button>
- </span>
- </el-dialog>
- <el-dialog
- title="修改密码"
- :visible.sync="passwordDialogVisible"
- width="690px"
- :close-on-click-modal="false"
- :close-on-press-escape="false"
- >
- <el-form
- ref="passwordForm"
- :model="passwordForm"
- :rules="passwordRules"
- label-width="108px"
- >
- <el-form-item label="原密码:" prop="oldPassword">
- <el-input
- type="password"
- v-model="passwordForm.oldPassword"
- placeholder="请输入"
- maxlength="20"
- ></el-input>
- </el-form-item>
- <el-form-item label="新密码:" prop="newPassword">
- <el-input
- type="password"
- v-model="passwordForm.newPassword"
- placeholder="请输入"
- maxlength="20"
- ></el-input>
- </el-form-item>
- <el-form-item label="确认密码:" prop="confirmPassword">
- <el-input
- type="password"
- v-model="passwordForm.confirmPassword"
- placeholder="请输入"
- maxlength="20"
- ></el-input>
- </el-form-item>
- </el-form>
- <span slot="footer">
- <el-button type="primary" @click="confirmChangePassword">确 定</el-button>
- <el-button @click="passwordDialogVisible = false ">取 消</el-button>
- </span>
- </el-dialog>
- </div>
- </template>
- <script>
- import tableList from "@/components/grid/TableList";
- export default {
- components: {tableList},
- data(){
- return {
- userInfo: {
- id: "",
- username: "",
- nickname: "",
- password: "",
- phone: "",
- photo: "",
- company: "",
- roleCode: "",
- useType: "",
- visible: "",
- createTime: "",
- createUserName: "",
- },
- configInfo: {
- numCreateScenePackage: "",
- numCreateUser: "",
- numScenePerPackage: "",
- },
- clusterInfo: {
- numSimulationLicense: '',
- dateSimulationLicense: '',
- numDynamicLicense: '',
- dateDynamicLicense: ''
- },
- roleCodeList:[],
- getDataWay: {
- dataType: "url",
- type: "post",
- data: this.$api.userInfo.getSceneResource,
- param: {
- //userId: this.$route.query.userId
- },
- },
- columns: [
- {
- label: "场景包名称",
- prop: "packageName",
- },
- {
- label: "自然驾驶仿真场景",
- prop: "zrCount",
- },
- {
- label: "交通事故仿真场景",
- prop: "jtCount",
- },
- {
- label: "标准法规仿真场景",
- prop: "bzCount",
- },
- {
- label: "泛化场景",
- prop: "fhCount"
- },
- {
- label: "合计",
- prop: "totalCount"
- }
- ],
- phoneDialogVisible: false,
- passwordDialogVisible: false,
- phoneForm: {
- nickname: '',
- phone: ''
- },
- phoneRules: {
- nickname: [
- { required: true, message: "请输入", trigger: "blur" },
- ],
- phone: [
- { required: true, message: "请输入", trigger: "blur" },
- {
- validator: (rule, value, callback) => {
- if(this.$validatePhone(value)){
- callback()
- }else{
- callback(new Error('格式错误'))
- }
- },
- trigger: "blur"
- }
- ]
- },
- passwordForm: {
- oldPassword: '',
- newPassword: '',
- confirmPassword: '',
- },
- passwordRules: {
- oldPassword: [{ required: true, message: "请输入", trigger: "blur" },],
- newPassword: [{ required: true, message: "请输入", trigger: "blur" },],
- confirmPassword: [{ required: true, message: "请输入", trigger: "blur" },]
- }
- }
- },
- async mounted(){
- await this.$dicsListsInit({
- roleCodeList: "roleCode"
- });
- this.getUserInfo()
- this.getParameter()
- this.getCluster()
- },
- computed: {
- roleType(){
- let label = ''
- this.roleCodeList.map(item => {
- if(item.code == this.userInfo.roleCode){
- label = item.caption
- }
- })
- return label
- }
- },
- methods: {
- getUserInfo(){
- this.$axios({
- method: "POST",
- url: this.$api.userInfo.getCurrentUserInfo,
- data: {}
- }).then(res => {
- if (res.code == 200 && res.info) {
- this.userInfo = res.info
- }else{
- this.$message.error(res.message || '获取用户信息失败')
- }
- })
- },
- getParameter(){
- this.$axios({
- method: "POST",
- url: this.$api.userInfo.getParameterByUserId,
- data: {}
- }).then(res => {
- if (res.code == 200) {
- if(res.info){
- this.configInfo = res.info
- }
- }else{
- this.$message.error(res.message || '获取配置信息失败')
- }
- })
- },
- getCluster(){
- this.$axios({
- method: "POST",
- url: this.$api.userInfo.getClusterByUserId,
- data: {}
- }).then(res => {
- if (res.code == 200) {
- if(res.info){
- this.clusterInfo = res.info
- }
- }else{
- this.$message.error(res.message || '获取配置信息失败')
- }
- })
- },
- changePhone(){
- this.phoneForm = {
- nickname: this.userInfo.nickname,
- phone: this.userInfo.phone
- }
- this.phoneDialogVisible = true
- },
- changePassword(){
- this.passwordForm = {
- oldPassword: '',
- newPassword: '',
- confirmPassword: ''
- }
- this.passwordDialogVisible = true
- },
- confirmChangePhone(){
- this.$refs.phoneForm.validate(valid => {
- if(valid){
- this.$axios({
- method: 'POST',
- url: this.$api.userInfo.savePhone,
- data: {
- id: this.userInfo.id,
- nickname: this.phoneForm.nickname,
- phone: this.phoneForm.phone
- }
- }).then(res => {
- if (res.code == 200) {
- this.$message.success('修改联系方式成功')
- this.getUserInfo()
- this.phoneDialogVisible = false
- }else{
- this.$message.error(res.message || '修改联系方式失败')
- }
- })
- }
- })
-
- },
- confirmChangePassword(){
- if(this.passwordForm.newPassword !== this.passwordForm.confirmPassword){
- this.$message.warning('新密码与确认密码必须保持一致')
- return
- }
- if(this.passwordForm.newPassword == this.passwordForm.oldPassword){
- this.$message.warning('新密码不能与旧密码相同')
- return
- }
- this.$refs.passwordForm.validate(valid => {
- if(valid){
- this.$axios({
- method: 'POST',
- url: this.$api.userInfo.savePassword,
- data: {
- id: this.userInfo.id,
- password: this.passwordForm.oldPassword,
- newPassword: this.passwordForm.newPassword
- }
- }).then(res => {
- if (res.code == 200) {
- this.$message.success('修改密码成功')
- this.getUserInfo()
- this.passwordDialogVisible = false
- }else{
- this.$message.error(res.message || '修改密码失败')
- }
- })
- }
- })
- }
- }
- }
- </script>
- <style scoped lang="less">
- .block{
- width: 88%;
- margin: 24px auto 0;
- }
- .titlePanel {
- padding: 22px 0;
- }
- .flexItem{
- width: 40%;
- margin-bottom: 10px;
- .label{
- display: inline-block;
- width: 140px;
- text-align: right;
- }
- .label2{
- display: inline-block;
- width: 140px;
- text-align: right;
- }
- }
- .textButton{
- padding-left: 5px;
- color: @themeColor;
- cursor: pointer;
- }
- </style>
|