Parcourir la source

Merge branch 'master' of http://116.63.33.55/git/nasctools

FinalYu il y a 10 mois
Parent
commit
1ffeab2770

+ 1 - 1
nasc-ui/src/views/login.vue

@@ -51,7 +51,7 @@
     data() {
       const yzNewPassword = (rule, value, callback) => {
         //密码为六位及以上并且字母、数字、特殊字符三项中有两项,强度是中等
-        var mediumRegex = /(?!^\d+$)(?!^[A-Za-z]+$)(?!^[^A-Za-z0-9]+$)(?!^.*[\u4E00-\u9FA5].*$)^\S{6,20}$/;
+        var mediumRegex = /(?!^\d+$)(?!^[A-Za-z]+$)(?!^[^A-Za-z0-9]+$)(?!^.*[\u4E00-\u9FA5].*$)^\S{6,50}$/;
         if (!mediumRegex.test(value)) {
           callback(new Error("密码强度过低"));
         } else {

+ 126 - 22
nasc-ui/src/views/matter/item/index.vue

@@ -89,7 +89,7 @@
 
     <!-- 添加或修改审查事项对话框 -->
     <el-dialog :title="title" :visible.sync="open" :close-on-click-modal="false" width="850px" @close="cancel"
-      :append-to-body="false">
+      @open="handleDialogOpen" append-to-body>
       <el-form ref="formDataref" :model="formData" :rules="rules" label-width="80px">
         <el-row>
           <el-col :span="24">
@@ -210,8 +210,7 @@
     </el-dialog>
 
     <!-- 添加或修改问题对话框 -->
-    <el-dialog title="问题题目配置" :visible.sync="addProblem" :close-on-click-modal="false" width="850px"
-      :append-to-body="true">
+    <el-dialog title="问题题目配置" :visible.sync="addProblem" :close-on-click-modal="false" width="850px" append-to-body>
       <el-row :gutter="10" class="mb8">
         <el-col :span="1.5">
           <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="addItem"
@@ -243,11 +242,17 @@
 
     <!-- 添加或修改问题选项对话框 -->
     <el-dialog :title="title" :visible.sync="problemopen" @close="cancelproblem" :close-on-click-modal="false"
-      width="850px" :append-to-body="true">
+      width="850px" @open="handleDialogOpen" append-to-body>
       <el-form ref="prblemformref" :model="prblemform" :rules="rulesproblem" label-width="80px">
         <el-row>
           <el-col :span="24">
-            <el-form-item label="问题题目" :prop="'title'" :rules="{required: true, message: '问题题目不能为空', trigger: 'blur'}">
+            <el-form-item label="问题题目" :prop="'title'" :rules="[{required: true, message: '问题题目不能为空', trigger: 'blur'},
+            {
+              required: true,
+              transform: (value) => value && value.trim(),
+              message: '问题题目不能全部为空',
+              trigger: 'blur'
+            }]">
               <el-input v-model="prblemform.title" type="textarea" placeholder="请输入问题题目" :maxlength="255"
                 :autosize="{minRows: 1, maxRows: 4}" :style="{width: '100%'}"></el-input>
             </el-form-item>
@@ -266,14 +271,19 @@
           <div style="border: 1px solid #ccc;margin-top:10px;padding: 10px;box-sizing: border-box;"
             v-for="(domain, index) in prblemform.optionlist" :key="domain.key" v-if="prblemform.type===1">
             <el-row>
-              <el-col :span="14">
-                <el-form-item :label="'选项'+(index+1)" :prop="'optionlist['+index+'].option'"
-                  :rules="{required: true, message: '选项不能为空', trigger: 'blur'}">
+              <el-col :span="13">
+                <el-form-item :label="'选项'+(index+1)" :prop="'optionlist['+index+'].option'" :rules="[{required: true, message: '选项不能为空', trigger: 'blur'},
+                  {
+                    required: true,
+                    transform: (value) => value && value.trim(),
+                    message: '选项不能全部为空',
+                    trigger: 'blur'
+                  }]">
                   <el-input v-model="domain.option" placeholder="请输入选择选项" clearable :style="{width: '100%'}">
                   </el-input>
                 </el-form-item>
               </el-col>
-              <el-col :span="10">
+              <el-col :span="11">
                 <el-form-item label="排序号" :prop="'optionlist['+index+'].number'"
                   :rules="[{required: true, message: '排序号不能为空', trigger: 'blur'}]">
                   <el-input v-model="domain.number" placeholder="请输入排序号(数字越大越靠前)" type="number"
@@ -323,7 +333,13 @@
                 <el-row>
                   <el-col :span="24">
                     <el-form-item label="材料名称" :prop="'optionlist['+index+'].materialListPro['+indexp+'].listName'"
-                      :rules="{required: true, message: '材料名称不能为空', trigger: 'blur'}">
+                      :rules="[{required: true, message: '材料名称不能为空', trigger: 'blur'},
+                      {
+                        required: true,
+                        transform: (value) => value && value.trim(),
+                        message: '材料名称不能全部为空',
+                        trigger: 'blur'
+                      }]">
                       <el-input v-model="domainp.listName" placeholder="请输入材料名称" />
                     </el-form-item>
                   </el-col>
@@ -497,13 +513,33 @@
         // 表单校验
         rules: {
           deptId: [
-            { required: true, message: "请选择归属部门", trigger: "input" },
+            { required: true, message: "请选择归属部门", trigger: "input" }
           ],
           itemName: [
             { required: true, message: "事项名称不能为空", trigger: "blur" },
+            {
+              required: true,
+              transform: (value) => value && value.trim(),
+              message: '事项名称不能全部为空',
+              trigger: 'blur'
+            }
+          ],
+          contacts: [{ required: true, message: "联系人不能为空", trigger: "blur" },
+          {
+            required: true,
+            transform: (value) => value && value.trim(),
+            message: '联系人不能全部为空',
+            trigger: 'blur'
+          }
+          ],
+          contactsPhone: [{ required: true, message: "联系电话不能为空", trigger: "blur" },
+          {
+            required: true,
+            transform: (value) => value && value.trim(),
+            message: '联系电话不能全部为空',
+            trigger: 'blur'
+          }
           ],
-          contacts: [{ required: true, message: "联系人不能为空", trigger: "blur" }],
-          contactsPhone: [{ required: true, message: "联系电话不能为空", trigger: "blur" }],
           sort: [
             { type: 'number', required: true, message: "排序号不能为空", trigger: "blur" }],
           prefixQuestion: [
@@ -529,6 +565,16 @@
       this.getDeptTree();
     },
     methods: {
+      handleDialogOpen() {
+        // 使用Vue.nextTick确保DOM已经更新
+        this.$nextTick(() => {
+          const dialogBody = document.getElementsByClassName("el-dialog__body");
+          console.log(dialogBody)
+          if (dialogBody) {
+            dialogBody[0].scrollTop = 0;
+          }
+        });
+      },
       changedetId() {
         this.$nextTick(() => {
           this.$refs.formDataref.validateField('deptId')
@@ -610,6 +656,7 @@
         this.open = true;
         this.title = "添加审查事项";
         this.reset();
+        try { this.$refs.formDataref.clearValidate('deptId') } catch (e) { }
       },
       addItem() {
         this.title = "添加问题题目"
@@ -620,6 +667,7 @@
       handleDeploy(row) {
         this.problemParams.matterId = row.id;
         this.addProblem = true;
+        this.problemParams.pageNum = 1;
         this.getPrblemList();
       },
       submitFormproblem() {
@@ -689,7 +737,6 @@
         const ids = row.id || this.ids;
         getMatter(ids).then((response) => {
           var data = response.data;
-          console.log(data)
           var material = [];
           if (data.material) {
             var materialList = data.material.materialList;
@@ -704,7 +751,6 @@
             this.materialList = material;
           }
           if (data.prefixQuestion == "Y") {
-            console.log(data.prefixQuestion)
             this.materialList = [{
               customError: "",
               listName: "",
@@ -797,7 +843,13 @@
       /** 删除按钮操作 */
       handleDelete(row) {
         const ids = row.id || this.ids;
-        this.$modal.confirm('是否确认删除所选择的数据项?').then(function () {
+        this.$confirm('是否确认删除所选择的数据项?', '提示', {
+          type: 'warning',
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          customClass: 'custom-confirm-class',
+          closeOnClickModal: false // 设置为false表示点击modal区域不关闭
+        }).then(function () {
           return delMatter(ids);
         }).then(() => {
           this.getList();
@@ -806,10 +858,21 @@
       },
       problemDelete(row) {
         var matterId = row.id;
-        delQuestion(matterId).then((response) => {
-          this.$modal.msgSuccess("删除成功");
+        this.$confirm('是否确认删除所选择的数据项?', '提示', {
+          type: 'warning',
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          customClass: 'custom-confirm-class',
+          closeOnClickModal: false // 设置为false表示点击modal区域不关闭
+        }).then(function () {
+          return delQuestion(matterId).then((response) => {
+            this.$modal.msgSuccess("删除成功");
+            this.getPrblemList();
+          });
+        }).then(() => {
           this.getPrblemList();
-        });
+          this.$modal.msgSuccess("删除成功");
+        }).catch(() => { });
       },
       // 多选框选中数据
       handleSelectionChange(selection) {
@@ -880,21 +943,54 @@
           this.$message.info("至少要有一个选项")
           return;
         }
-        this.prblemform.optionlist.splice(itme, 1)
+        var _this = this;
+        this.$confirm('是否确认删除所选择的数据项?', '提示', {
+          type: 'warning',
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          customClass: 'custom-confirm-class',
+          closeOnClickModal: false // 设置为false表示点击modal区域不关闭
+        }).then(function () {
+          return _this.prblemform.optionlist.splice(itme, 1)
+        }).then(() => {
+          this.$modal.msgSuccess("删除成功");
+        }).catch(() => { });
       },
       reommaterialList(itme) {
         if (this.materialList.length === 1) {
           this.$message.info("至少要有一个材料")
           return;
         }
-        this.materialList.splice(itme, 1)
+        var _this = this;
+        this.$confirm('是否确认删除所选择的数据项?', '提示', {
+          type: 'warning',
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          customClass: 'custom-confirm-class',
+          closeOnClickModal: false // 设置为false表示点击modal区域不关闭
+        }).then(function () {
+          return _this.materialList.splice(itme, 1)
+        }).then(() => {
+          this.$modal.msgSuccess("删除成功");
+        }).catch(() => { });
       },
       reommaterialListPro(itme, index) {
         if (this.prblemform.optionlist[index].materialListPro.length === 1) {
           this.$message.info("至少要有一个材料")
           return;
         }
-        this.prblemform.optionlist[index].materialListPro.splice(itme, 1)
+        var _this = this;
+        this.$confirm('是否确认删除所选择的数据项?', '提示', {
+          type: 'warning',
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          customClass: 'custom-confirm-class',
+          closeOnClickModal: false // 设置为false表示点击modal区域不关闭
+        }).then(function () {
+          return _this.prblemform.optionlist[index].materialListPro.splice(itme, 1)
+        }).then(() => {
+          this.$modal.msgSuccess("删除成功");
+        }).catch(() => { });
       },
       /** 提交按钮 */
       submitForm: function () {
@@ -1069,4 +1165,12 @@
   input[type="number"] {
     -moz-appearance: textfield;
   }
+
+  .el-input .el-input__suffix {
+    display: none;
+  }
+
+  .el-select-dropdown.el-popper {
+    max-width: 600px;
+  }
 </style>

+ 34 - 37
nasc-ui/src/views/matter/vnc/index.vue

@@ -7,11 +7,11 @@
           <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
             label-width="68px">
             <el-form-item label="桌面名称" prop="desktopName">
-              <el-input v-model="queryParams.desktopName" placeholder="请输入事项名称" clearable style="width: 240px"
+              <el-input v-model="queryParams.desktopName" placeholder="请输入桌面名称" clearable style="width: 240px"
                 @keyup.enter.native="handleQuery" />
             </el-form-item>
             <el-form-item label="IP地址" prop="vncIp">
-              <el-input v-model="queryParams.vncIp" placeholder="请输入事项名称" clearable style="width: 240px"
+              <el-input v-model="queryParams.vncIp" placeholder="请输入IP地址" clearable style="width: 240px"
                 @keyup.enter.native="handleQuery" />
             </el-form-item>
             <el-form-item>
@@ -84,7 +84,8 @@
       </el-row>
     </template>
     <!-- 添加或修改远程管理对话框 -->
-    <el-dialog :title="title" :visible.sync="open" :close-on-click-modal="false" width="60%" append-to-body>
+    <el-dialog :title="title" :visible.sync="open" :close-on-click-modal="false" width="60%" @close="cancel"
+      append-to-body>
       <el-form ref="formDataref" :model="formData" :rules="rules" label-width="80px">
         <el-row>
           <el-col :span="24">
@@ -115,15 +116,16 @@
           </el-col>
           <el-col :span="12">
             <el-form-item label="用户密码" prop="password">
-              <el-input v-model="formData.password" placeholder="请输入用户密码" maxlength="255" />
+              <el-input v-model="formData.password" placeholder="请输入用户密码" maxlength="255" show-password />
             </el-form-item>
           </el-col>
         </el-row>
         <el-row>
           <el-col :span="24">
             <el-form-item label="排序号" prop="sortNum">
-              <el-input v-model="formData.sortNum" placeholder="请输入排序号(数字越大越靠前)" maxlength="5"
-                onkeyup="value=value.replace(/[^0-9]/g,'')" />
+              <el-input v-model="formData.sortNum" placeholder="请输入排序号(数字越大越靠前)" type="number"
+                onkeyup="value=value.replace(/[^0-9]/g,'')" oninput="if(value.length>5)value=value.slice(0,5)"
+                οnkeypress='return( /[\d]/.test(String.fromCharCode(event.keyCode)))' clearable />
             </el-form-item>
           </el-col>
         </el-row>
@@ -216,7 +218,13 @@
         // 表单校验
         rules: {
           desktopName: [
-            { required: true, message: "请输入桌面名称", trigger: "blur" },
+            { required: true, message: "桌面名称不能为空", trigger: "blur" },
+            {
+              required: true,
+              transform: (value) => value && value.trim(),
+              message: '桌面名称不能全部为空',
+              trigger: 'blur'
+            }
           ],
           vncIp: [
             { required: true, message: "ip地址不能为空", trigger: "blur" },
@@ -246,17 +254,6 @@
         }
         );
       },
-      reset() {
-        this.formData = {
-          desktopName: "",
-          vncIp: "",
-          vncPort: "",
-          userName: "",
-          password: "",
-          sortNum: "",
-          path: "",
-        }
-      },
       /** 新增按钮操作 */
       handleAdd() {
         this.title = "添加远程管理";
@@ -285,7 +282,13 @@
       /** 删除按钮操作 */
       handleDelete(row) {
         const ids = row.id || this.ids;
-        this.$modal.confirm('是否确认删除所选择的数据项?').then(function () {
+        this.$confirm('是否确认删除所选择的数据项?', '提示', {
+          type: 'warning',
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          customClass: 'custom-confirm-class',
+          closeOnClickModal: false // 设置为false表示点击modal区域不关闭
+        }).then(function () {
           return delVncDesktop(ids);
         }).then(() => {
           this.getList();
@@ -317,29 +320,23 @@
         this.single = selection.length != 1;
         this.multiple = !selection.length;
       },
-      /** 表单重置 **/
-      reset() {
-        // this.form = {
-        //   userId: undefined,
-        //   deptId: undefined,
-        //   userName: undefined,
-        //   nickName: undefined,
-        //   password: undefined,
-        //   phonenumber: undefined,
-        //   email: undefined,
-        //   sex: undefined,
-        //   status: "0",
-        //   remark: undefined,
-        //   postIds: [],
-        //   roleIds: []
-        // };
-        // this.resetForm("form");
-      },
       /** 重置按钮操作 */
       resetQuery() {
         this.resetForm("queryForm");
         this.handleQuery();
       },
+      /** 表单重置 **/
+      reset() {
+        this.formData = {
+          desktopName: "",
+          vncIp: "",
+          vncPort: "",
+          userName: "",
+          password: "",
+          sortNum: "",
+          path: "",
+        }
+      },
       /** 提交按钮 */
       submitForm: function () {
         this.$refs["formDataref"].validate((valid) => {