LiuJ 2 settimane fa
parent
commit
70e7977a27
2 ha cambiato i file con 20 aggiunte e 6 eliminazioni
  1. 19 5
      src/views/news/addNotice.vue
  2. 1 1
      src/views/role/creatUser.vue

+ 19 - 5
src/views/news/addNotice.vue

@@ -63,6 +63,16 @@
               </div>
             </div>
           </el-form-item>
+          <el-form-item label="建立群聊:" prop="is_group" class="custom-align-right">
+              <el-radio-group v-model="form.is_group" :disabled="this.$route.query.id!=undefined"> 
+                <el-radio :label="1">是</el-radio>
+                <el-radio :label="0">否</el-radio>
+              </el-radio-group>
+            </el-form-item>
+
+          <el-form-item label="群聊名称:" prop="group_name" class="custom-align-right" v-if="form.is_group == 1" :disabled="this.$route.query.id!=undefined">
+                <el-input v-model="form.group_name" autocomplete="off" placeholder="请输入群聊名称"></el-input>
+          </el-form-item>
         </div>
       </el-form>
     </div>
@@ -152,6 +162,8 @@ export default {
         file: "",//文件路径
         department_arr_id: [],//部门id
         department_id: '',//部门id
+        is_group: 0,//是否创建群聊:1:是,0:否
+        group_name: '',//群聊名称
       },
       //1.2 表单验证规则
       formRules: {
@@ -162,6 +174,7 @@ export default {
         level: [{ required: true, trigger: 'blur', validator: validateEmpty }],
         content: [{ required: true, trigger: 'blur', validator: validateEmpty }],
         address: [{ required: true, trigger: 'blur', validator: validateEmpty }],
+        is_group: [{ required: true, trigger: 'blur', validator: validateEmpty }],
       },
       //1.3富文本编辑器配置
       showHtml: false, //用于保存源码内容
@@ -328,8 +341,8 @@ export default {
       const isJPG = file.type === 'image/jpeg';
       const isPNG = file.type === 'image/png';
       //word  pdf
-      const isWord = file.type === 'application/msword' || file.type === 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
-      const isPdf = file.type === 'application/pdf';
+      const isWord = file.type === 'application/msword' || file.type === 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' || file.type === 'application/vnd.ms-word' || file.type === 'doc';
+      const isPdf = file.type === 'application/pdf' || file.type === 'application/x-pdf' || file.type === 'application/acrobat' || file.type === 'pdf' || file.type === 'text/x-pdf' || file.type === 'application/x-download' || file.type === 'application/octet-stream';
       const isLt2M = file.size / 1024 / 1024 < 2;
       console.log(this.imgurl.length, '-0--------------------------------')
       if (this.imgurl.length > 4) {
@@ -388,7 +401,7 @@ export default {
           }
           console.log(typeof this.form.time, '---=-==-=')
           console.log(this.form.time.length, '---=-==-=')
-          if (this.form.time.length > 0) {
+          if (typeof this.form.time=='object' && this.form.time.length > 0) {
             this.form.start = this.formatDate(this.form.time[0]);
             this.form.end = this.formatDate(this.form.time[1]);
             delete this.form.time;
@@ -473,6 +486,8 @@ export default {
         const filePath = res.data.file;
         const fileExtension = filePath.split('.').pop().toLowerCase();
         this.fileType = fileExtension; // 设置文件类型
+        this.form.is_group = parseInt(res.data.is_group );
+        this.form.group_name = res.data.group_name;
       })
     },
     async loadCascaderPath(path) {
@@ -534,8 +549,7 @@ export default {
             this.form.department_arr_id = JSON.stringify(this.form.department_arr_id);
           }
           console.log(typeof this.form.time, '---=-==-=')
-          console.log(this.form.time.length, '---=-==-=')
-          if (this.form.time.length > 0) {
+          if (typeof this.form.time=='object' && this.form.time.length > 0) {
             this.form.start = this.formatDate(this.form.time[0]);
             this.form.end = this.formatDate(this.form.time[1]);
             delete this.form.time;

+ 1 - 1
src/views/role/creatUser.vue

@@ -47,7 +47,7 @@ export default {
       tableDivTitle: "选择用户类型",
       userType: "10000", // 用户类型
       radioOptions: [
-        // { label: '管理员', value: '10000' },
+        { label: '管理员', value: '10000' },
         { label: '调研员', value: '4' },
         { label: '个人会员', value: '1' },
         { label: '企业会员', value: '3' },