Эх сурвалжийг харах

Merge branch 'onemap_zmg'

mork 3 долоо хоног өмнө
parent
commit
17317362ad

+ 7 - 0
public/static/config/config.js

@@ -5,6 +5,13 @@ let systemConfig = {
     },
     touristUserId: "191",//默认游客用户(user002)id,Oauth中配置
     adminRoleId: "1",//默认管理员角色id,Oauth中配置“系统管理员”角色
+    /*
+     * 模型id:1667(应用中心模型id)、1690(用户登录模型id)
+     * 栏目id:1657(应用中心栏目id(示范应用))、1659(应用中心栏目id)、1666(门户都示范栏目id)、1676(用户登录栏目id)
+    */
+    modelIds: [1667,1690],
+    columnIds: [1657,1659,1666,1676],
+
     baseServicerPath: "/oneMap",
     // oauth和DMS环境
     backServerPath: "http://121.43.55.7",

+ 5 - 1
src/api/appCenter.js

@@ -18,11 +18,14 @@ const getDmsSName = (params) => {
 const getModelById = (params) => {
     return postform(systemConfig.dmsDataProxy + "/model/getModelById", params)
 }
+//更新内容接口
+const updateContent = (params) => {
+    return postform(systemConfig.dmsDataProxy + "/content/updateContent", params)
+}
 // 获取内容
 const getContentById = (params) => {
     return postform(systemConfig.dmsDataProxy + '/content/selectContentById', params);
 }
-
 // 获取运行管理页面数据(params:{nowTimes:[],lastTimes:[]})
 const getAllYxglDatas = (params) => {
     return postBody(systemConfig.baseServicerPath + '/OperationManagementController/getAllYxglDatas', params);
@@ -32,6 +35,7 @@ export default {
     getDmsDataList,
     getDmsCNameAType,
     getDmsSName,
+    updateContent,
     getModelById,
     getContentById,
     getAllYxglDatas

+ 6 - 0
src/api/common.js

@@ -16,7 +16,13 @@ const getDmsTypes = (params) => {
   return postform(systemConfig.backServerPath + ":" + systemConfig.dmsWebUrlPort + systemConfig.dmsDataProxy + '/category/selectByCNameAType', params)
 }
 
+// 修改用户密码
+const updatePassword = (params) => {
+    return postform(systemConfig.oauthServiceUrl + '/user/updatePassword', params);
+}
+
 export default {
   login,
+  updatePassword,
   getDmsTypes,
 }

+ 0 - 4
src/components/AppVue/Header.vue

@@ -18,10 +18,6 @@
         </template>
       </ul>
     </div>
-
-    <el-dialog v-model="dialogLoginVisible" width="500">
-      <Login :close="closeLoginDialog" />
-    </el-dialog>
   </div>
 </template>
 

+ 149 - 0
src/components/user/editUser.vue

@@ -0,0 +1,149 @@
+<template>
+    <div style="text-align: center;font-size: 30px;margin-top: 40px;">修改密码</div>
+    <div style="margin: 60px;">
+       <!-- <el-dialog 
+        :class="'editUser'"
+        :visible.sync="userUpdPwdVisible"
+        width="650px"
+        top="7%"
+        title="修改密码"
+        :close-on-click-modal="false"
+        :before-close="dialogBeforeClose"
+        style="overflow: auto; height: 700px"
+       > -->
+            <el-form
+                :model="toUpdUserPwd"
+                :rules="userPwdRules"
+                ref="toUpdPwdForm"
+                :label-width="100"
+            >
+                <el-form-item label="ID:" v-if="false">
+                <el-input v-model="toUpdUserPwd.id" autocomplete="off" disabled />
+                </el-form-item>
+                <el-form-item label="原密码:" prop="oldPwd">
+                <el-input
+                    type="password"
+                    v-model="toUpdUserPwd.oldPwd"
+                    autocomplete="off"
+                    placeholder="请输入原密码"
+                />
+                </el-form-item>
+                <el-form-item label="新密码:" prop="password">
+                <el-input
+                    type="password"
+                    v-model="toUpdUserPwd.password"
+                    autocomplete="off"
+                    placeholder="请输入新密码"
+                />
+                </el-form-item>
+                <el-form-item label="重复密码:" prop="newPwd">
+                <el-input
+                    type="password"
+                    v-model="toUpdUserPwd.newPwd"
+                    autocomplete="off"
+                    placeholder="请再次输入新密码"
+                />
+                </el-form-item>
+            </el-form>
+            <div style="width: 100%;text-align: center;margin: 50px 0;">
+                <el-button type="primary" style="width: 80%;" @click="updUserPwd">确认修改</el-button>
+            </div>
+            <!-- <template #footer>
+                <span class="dialog-footer">
+                <el-button type="primary" @click="updUserPwd">确认修改</el-button>
+                </span>
+            </template> -->
+        <!-- </el-dialog> -->
+    </div>
+</template>
+
+<script>
+
+import common from "@/api/common";
+export default {
+  name: "editUser",
+  data() {
+    var validatePass = (rule, value, callback) => {
+      if (value !== this.toUpdUserPwd.password) {
+        callback(new Error("两次输入密码不一致!"));
+      } else {
+        callback();
+      }
+    };
+    var ZZPass = (rule, value, callback) => {
+      if (!/^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=\S+$).{8,}$/.test(value)) {
+        callback(new Error("密码必须包括英文字母的大写、小写以及数字!"));
+      } else {
+        callback();
+      }
+    };
+    return {
+        modelId: systemConfig.modelIds[1], // 青浦一张图登录模型id
+        columnId: systemConfig.columnIds[3], // 青浦一张图登录栏目id
+        userUpdPwdVisible: false,
+        toUpdUserPwd: {
+            id: this.$store.state.userInfo.id,
+            password: ""
+        },
+        userPwdRules: {
+        oldPwd: [{ required: true, message: "请输入原密码", trigger: "blur" }],
+        password: [
+          { required: true, message: "请输入新密码", trigger: "blur" },
+          { min: 8, max: 30, message: "长度在8个字符以上", trigger: "blur" },
+          { validator: ZZPass, trigger: "blur" }
+        ],
+        newPwd: [
+            { required: true, message: "请再次输入新密码", trigger: "blur" },
+            { min: 8, max: 30, message: "长度在8个字符以上", trigger: "blur" },
+            { validator: ZZPass, trigger: "blur" },
+            { validator: validatePass, trigger: "blur" }
+            ]
+        },
+    };
+  },
+  props: {
+    close: Function,
+    showFlag: {
+        type: Boolean,
+        default: false,
+    },
+  },
+  mounted() {},
+  methods: {
+    updUserPwd() {
+        let that = this;
+        let app = this;
+        app.$refs["toUpdPwdForm"].validate(valid => {
+            if (valid) {
+                let params = {
+                    id: that.toUpdUserPwd.id,
+                    oldPwd: that.toUpdUserPwd.oldPwd,
+                    password: that.toUpdUserPwd.password
+                };
+                common.updatePassword(params).then(res => {
+                    if (res.code == 200) {
+                        that.toUpdUserPwd = {};
+                        that.userUpdPwdVisible = false;
+                        this.close();
+                        this.$message({
+                            type: "success",
+                            message: "修改成功",
+                        });
+                    }else{
+                        that.$message({
+                            type: "error",
+                            message: res.message,
+                        });
+                    }
+                });
+            } else {
+                return false;
+            }
+      });
+    }
+  },
+};
+</script>
+<style lang="less" scoped>
+
+</style>

+ 0 - 7
src/components/login/login.vue → src/components/user/login.vue

@@ -71,13 +71,6 @@ export default {
         let that = this;
         that.$refs[formName].resetFields();
     },
-    handleCommand(command) {
-        let that = this;
-        that.$message({   
-            type: "info",
-            message: `Click on item ${command}`,
-        });
-    },
   },
 };
 </script>

+ 76 - 11
src/components/user/user.vue

@@ -12,46 +12,111 @@
           </span>
           <template #dropdown>
             <el-dropdown-menu>
-              <el-dropdown-item command="login">登录</el-dropdown-item>
-              <el-dropdown-item command="register">注册用户</el-dropdown-item>
-              <el-dropdown-item command="upPassword">修改密码</el-dropdown-item>
-              <el-dropdown-item command="logout">退出</el-dropdown-item>
+              <el-dropdown-item command="login">账号登录</el-dropdown-item>
+              <el-dropdown-item command="register">申请账号</el-dropdown-item>
+              <el-dropdown-item command="upPassword" v-if="$store.state.userInfo.id != touristUserId">修改密码</el-dropdown-item>
+              <el-dropdown-item command="logout" v-if="$store.state.userInfo.id != touristUserId">退出登录</el-dropdown-item>
             </el-dropdown-menu>
           </template>
         </el-dropdown>
     </div>
     <el-dialog v-model="dialogLoginVisible" width="500">
-      <Login :close="closeLoginDialog" />
+      <Login :close="handleLoginClose" />
     </el-dialog>
+
+    <el-dialog v-model="userUpdPwdVisible" width="500">
+        <editUser
+            :close="handleEditUserClose"
+        ></editUser>
+    </el-dialog>
+
+    <editManage
+        v-if="isContentShow"
+        :isShow="isContentShow"
+        :column-model="columnModel"
+        :column="columnData"
+        :item="contentItem"
+        :is-view="isContentView"
+        :close="handleEditClose"
+    ></editManage>
+    
+    
   </div>
 </template>
 
 <script>
-import Login from "@/components/login/login.vue";
+import Login from "@/components/user/login.vue";
+import editManage from "@/components/yygl/editManage.vue";
+import editUser from "@/components/user/editUser.vue";
+import appCenter from "@/api/appCenter";
 import encrypt‌ from "@/utils/encrypt‌";
 export default {
   components: {
     Login,
+    editUser,
+    editManage,
   },
   data() {
     return {
       touristUserId:systemConfig.touristUserId,
       dialogLoginVisible: false,
+      userUpdPwdVisible: false,
+      modelId: systemConfig.modelIds[1], // 青浦一张图登录模型id
+      columnId: systemConfig.columnIds[3], // 青浦一张图登录栏目id
+    
+      // 编辑用户弹窗相关
+      isContentShow: false,
+      isContentView: false,
+      columnModel: {},
+      columnData: {
+        title: "",
+      },
+      contentItem: {},
     };
   },
-  mounted() {},
+  mounted() {
+    this.initData();
+  },
   methods: {
-    closeLoginDialog() {
-      console.log("closeLoginDialog");
+    initData () {
+      this.getModelById();
+    },
+    handleLoginClose() {
       this.dialogLoginVisible = false;
     },
+    handleEditUserClose() {
+      this.userUpdPwdVisible = false;
+    },
+    //关闭编辑弹窗
+    handleEditClose() {
+      this.isContentShow = false;
+      this.isContentView = false;
+      this.contentItem = {};
+    },
+     //根据模型id查询模型详情
+    getModelById(){
+      let that = this;
+      let requestParams = {
+        modelId: that.modelId, // 应用中心模型id
+      };
+      appCenter.getModelById(requestParams).then(res => {
+        if (res.code === 200) {
+          that.columnModel = res.content;
+          that.columnModel.modelId = that.modelId;
+          that.columnModel.columnId = that.columnId;
+          that.columnData = that.columnModel;
+        }
+      })
+    },
+    
     handleCommand(command) {
       if (command == "login") {
         this.dialogLoginVisible = true;
       } else if(command == "register"){
-        
+        // 申请用户
+        this.isContentShow = true;
       } else if(command == "upPassword"){
-        
+        this.userUpdPwdVisible = true;
       } else {
         encrypt‌().then(() => {
           this.$message({

+ 6 - 1
src/components/yygl/editManage.vue

@@ -55,6 +55,7 @@
           <el-input
             v-if="['varchar', 'content', 'text'].indexOf(formItem.frontType) > -1"
             v-model="dataForm[formItem.name]"
+            :type="formItem.name == 'password' ? 'password' : 'text'"
             :placeholder="formItem.describe"
             :disabled="isView"
           />
@@ -1433,7 +1434,11 @@ export default {
               .then((res) => {
                 if (res.code === 200) {
                   that.close(true);
-                  that.$message({ message: "添加成功", type: "success" });
+                  let message = "添加成功";
+                  if(that.column.columnId == systemConfig.columnIds[3] && that.column.modelId == systemConfig.modelIds[1]){ //指定 一张图登录栏目 申请账号时使用判断
+                    message = "申请成功!请等待三个工作日后,管理员审核通过后,您才能登录系统。"
+                  }
+                  that.$message({ message: message, type: "success" });
                 } else {
                   that.$message({ message: res.content, type: "error" });
                 }

+ 1 - 1
src/views/skmh/index.vue

@@ -307,7 +307,7 @@ export default {
     },
     getDmsDataList() {
       let requestParams = {
-        columnId: 1666,
+        columnId: systemConfig.columnIds[2], // 应用中心栏目id(示范应用)
         states: 0,
         orderBy: JSON.stringify([{"field":"update_time","orderByType":2}]),
         pageSize: 9999,

+ 1 - 1
src/views/yygl/index.vue

@@ -84,7 +84,7 @@ export default {
     },
     initData() {
       let requestParams = {
-        columnId: 1657,
+        columnId: systemConfig.columnIds[0], // 应用中心栏目id(示范应用)
         states: 0,
         pageSize: 999,
         page: 0

+ 10 - 8
src/views/yygl/manage/index.vue

@@ -184,8 +184,8 @@ export default {
       statusOptions: [],
       // 排序条件  1 升序 2 降序
       sortByValue: '1',
-      modelId: 1667, // 应用中心模型id
-      columnId: 1659, // 应用中心栏目id
+      modelId: systemConfig.modelIds[0], // 应用中心模型id
+      columnId: systemConfig.columnIds[1], // 应用中心栏目id
 
       isContentShow: false,
       isContentView: false,
@@ -221,6 +221,7 @@ export default {
     },
     // 新增应用
     handleAddClick() {
+      console.log(this.columnModel);
       this.isContentShow = true;
     },
     // 处理分页变化
@@ -238,15 +239,16 @@ export default {
     },
     //根据模型id查询模型详情
     getModelById(){
+      let that = this;
       let requestParams = {
-        modelId: this.modelId, // 应用中心模型id
+        modelId: that.modelId, // 应用中心模型id
       };
       appCenter.getModelById(requestParams).then(res => {
         if (res.code === 200) {
-          this.columnModel = res.content;
-          this.columnModel.modelId = this.modelId;
-          this.columnModel.columnId = this.columnId;
-          this.columnData = this.columnModel;
+          that.columnModel = res.content;
+          that.columnModel.modelId = that.modelId;
+          that.columnModel.columnId = that.columnId;
+          that.columnData = that.columnModel;
         }
       })
     },
@@ -261,7 +263,7 @@ export default {
       appCenter.getContentById(requestParams).then((data) => {
           if (data.code === 200) {
             that.contentItem = data.content;
-            that.contentItem.phone = this.formatPhoneNumber(that.contentItem.phone);
+            that.contentItem.phone = that.formatPhoneNumber(that.contentItem.phone);
             that.isContentShow = true;
             that.isContentView = false;
           }

+ 1 - 1
src/views/yygl/monitor/index.vue

@@ -406,7 +406,7 @@ export default {
     },
     getDmsDataList() {
       let requestParams = {
-        columnId: 1659,
+        columnId: systemConfig.columnIds[1], // 应用中心栏目id
         states: 0,
         orderBy: JSON.stringify([{ field: "create_time", orderByType: 2 }]),
         pageSize: 9999,

+ 7 - 23
src/views/yygl/overview/index.vue

@@ -106,12 +106,12 @@ export default {
     handleVisit() {
       // http://localhost:2027/fileView?url=/proxy_dms/static/1_青浦大数据中心一张图功能表20240531.xlsx
       // http://localhost:2027/fileView?url=/proxy_dms/static/test.geojson
-      window.open(
-        "fileView?url=" +
-          this.curUrl +
-          "/static/1_青浦大数据中心一张图功能表20240531.xlsx",
-        "_blank"
-      );
+      // window.open(
+      //   "fileView?url=" +
+      //     this.curUrl +
+      //     "/static/1_青浦大数据中心一张图功能表20240531.xlsx",
+      //   "_blank"
+      // );
     },
     getDmsTagSName() {
       let requestParams = {
@@ -153,24 +153,8 @@ export default {
       });
     },
     getDmsDataList() {
-      // let requestParams = {
-      //   columnId: 1658,
-      //   states: 0,
-      //   pageSize: 999,
-      //   page: 0
-      // };
-      // if (this.searchKeyword) {
-      //   requestParams.search = JSON.stringify([
-      //     {
-      //       field: "title",
-      //       searchType: 2,
-      //       content: { value: "%" + this.searchKeyword + "%" },
-      //     },
-      //   ]);
-      // }
-
        let requestParams = {
-        columnId: 1659,
+        columnId: systemConfig.columnIds[1], // 应用中心栏目id
         states: 0,
         orderBy: JSON.stringify([{"field":"frame_time","orderByType":2}]),
         pageSize: 9999,