Forráskód Böngészése

开始修改换位功能

开始修改换位功能
Sean 4 hónapja
szülő
commit
51dee0edaf

+ 64 - 62
src/store/modules/template.js

@@ -387,71 +387,73 @@ const mutations = {
   },
   //移动板块 (暂时停用)
   moveModule(state, data) {
-    Message.error('移动板块功能暂时停用!');
+    // Message.error('移动板块功能暂时停用!');
     // pageStatus == 1 首页
-    // if (state.pageStatus == 1) {
-    //   const moveType = data.moveType;
-    //   const moduleId = data.i;
-    //   const modules = state.pageData.index;
-    //   // 查找模块在数组中的实际索引
-    //   const thisIndex = modules.findIndex(module => module.i === moduleId);
-    //   if (thisIndex === -1) {
-    //     Message.error('模块未找到!');
-    //     return;
-    //   }
-    //   const thisY = modules[thisIndex].y;
-    //   let thatY;
-    //   if (moveType === 'up') {
-    //     thatY = Math.max(
-    //       ...modules.filter(item => item.y < thisY).map(item => item.y)
-    //     );
-    //     if (thatY === -Infinity) {
-    //       Message.error('已经是顶部了!');
-    //       return;
-    //     }
-    //     const thatIndex = modules.findIndex(item => item.y === thatY);
-    //     if (thatIndex === -1) {
-    //       Message.error('上方模块未找到!');
-    //       return;
-    //     }
-    //     [modules[thisIndex].y, modules[thatIndex].y] = [modules[thatIndex].y, modules[thisIndex].y];
+    if (state.pageStatus == 1) {
+      const moveType = data.moveType;
+      const moduleId = data.i;
+      const modules = state.pageData.index;
+      // 查找模块在数组中的实际索引
+      const thisIndex = modules.findIndex(module => module.i === moduleId);
+      if (thisIndex === -1) {
+        Message.error('模块未找到!');
+        return;
+      }
+      const thisY = modules[thisIndex].y;
+      let thatY;
+      if (moveType === 'up') {
+        thatY = Math.max(
+          ...modules.filter(item => item.y < thisY).map(item => item.y)
+        );
+        if (thatY === -Infinity) {
+          Message.error('已经是顶部了!');
+          return;
+        }
+        const thatIndex = modules.findIndex(item => item.y === thatY);
+        if (thatIndex === -1) {
+          Message.error('上方模块未找到!');
+          return;
+        }
+        [modules[thisIndex].y, modules[thatIndex].y] = [modules[thatIndex].y, modules[thisIndex].y];
+
+      } else if (moveType === 'down') {
+        thatY = Math.min(
+          ...modules.filter(item => item.y > thisY).map(item => item.y)
+        );
+        if (thatY === Infinity) {
+          Message.error('已经是底部了!');
+          return;
+        }
+        const thatIndex = modules.findIndex(item => item.y === thatY);
+        if (thatIndex === -1) {
+          Message.error('下方模块未找到!');
+          return;
+        }
+        [modules[thisIndex].y, modules[thatIndex].y] = [modules[thatIndex].y, modules[thisIndex].y];
+      } else {
+        Message.error('未知的移动类型!');
+        return;
+      }
+      // 交换后对模块进行排序以确保顺序一致
+      modules.sort((a, b) => a.y - b.y);
+      // 使用 Vue.set 强制更新数组,确保视图更新
+      Vue.set(state.pageData, 'index', [...modules]);
+      console.log(state.pageData.index); //打印查看是否已修改
+    }
+
 
-    //   } else if (moveType === 'down') {
-    //     thatY = Math.min(
-    //       ...modules.filter(item => item.y > thisY).map(item => item.y)
-    //     );
-    //     if (thatY === Infinity) {
-    //       Message.error('已经是底部了!');
-    //       return;
-    //     }
-    //     const thatIndex = modules.findIndex(item => item.y === thatY);
-    //     if (thatIndex === -1) {
-    //       Message.error('下方模块未找到!');
-    //       return;
-    //     }
-    //     [modules[thisIndex].y, modules[thatIndex].y] = [modules[thatIndex].y, modules[thisIndex].y];
-    //   } else {
-    //     Message.error('未知的移动类型!');
-    //     return;
-    //   }
-    //   // 交换后对模块进行排序以确保顺序一致
-    //   modules.sort((a, b) => a.y - b.y);
-    //   // 使用 Vue.set 强制更新数组,确保视图更新
-    //   Vue.set(state.pageData, 'index', [...modules]);
-    //   console.log(state.pageData.index); //打印查看是否已修改
-    // }
     // pageStatus == 2 分类页
-    // if (state.pageStatus == 2) {}
-    // // pageStatus == 3 列表页
-    // if (state.pageStatus == 3) {}
-    // // pageStatus == 4 详情页
-    // if (state.pageStatus == 4) {}
-    // // pageStatus == 5 搜索页
-    // if (state.pageStatus == 5) {}
-    // // pageStatus == 6 自定义列表页
-    // if (state.pageStatus == 6) {}
-    // // pageStatus == 7 自定义详情页
-    // if (state.pageStatus == 7) {}
+    if (state.pageStatus == 2) {}
+    // pageStatus == 3 列表页
+    if (state.pageStatus == 3) {}
+    // pageStatus == 4 详情页
+    if (state.pageStatus == 4) {}
+    // pageStatus == 5 搜索页
+    if (state.pageStatus == 5) {}
+    // pageStatus == 6 自定义列表页
+    if (state.pageStatus == 6) {}
+    // pageStatus == 7 自定义详情页
+    if (state.pageStatus == 7) {}
   },
   //修改首页板块高度
   setModuleHeight(state,data){

+ 1 - 1
src/utils/request.js

@@ -81,7 +81,7 @@ service.interceptors.response.use(
     Message({
       message: error.message,
       type: 'error',
-      duration: 5 * 10000
+      duration: 20 * 1000
     })
     return Promise.reject(error)
   }

+ 2 - 1
src/views/chat/hall.vue

@@ -2194,10 +2194,11 @@ export default {
       const isRar = file.type === 'application/x-rar-compressed';
       const isZip = file.type === 'application/x-zip-compressed';
       const isTxt = file.type === 'text/plain';
+      const isPdf = file.type === 'application/pdf';
       //文件大小不能超过2M
       const isLt2M = file.size / 1024 / 1024 < 2;
 
-      if (!isTxt && !isDoc && !isDocx && !isXls && !isXlsx && !isPptx && !isRar && !isZip) {
+      if (!isTxt && !isDoc && !isDocx && !isXls && !isXlsx && !isPptx && !isRar && !isZip && !isPdf) {
         this.$message.error('该文件类型不允许上传!');
         return false;
       }

+ 49 - 5
src/views/news/creatNews.vue

@@ -18,7 +18,7 @@
           </el-form-item>
           <div v-if="form.islink==true"> 
             <el-form-item label="导航池名称:" prop="cat_arr_id" class="custom-align-right">
-              <el-cascader :key="parentKey" v-model="form.cat_arr_id" placeholder="请选择要绑定的父级导航" :props="parentData" filterable clearable></el-cascader>
+              <el-cascader :key="parentKey" v-model="form.cat_arr_id" placeholder="请选择要绑定的导航池名称" :props="parentData" filterable clearable></el-cascader>
             </el-form-item>
             <el-form-item label="外链地址:" prop="linkurl" class="custom-align-right">
               <el-input v-model="form.linkurl" autocomplete="off" placeholder="请输入外链地址"></el-input>
@@ -29,10 +29,10 @@
           </div>
           <div v-if="form.islink==false">
             <el-form-item label="导航池名称:" prop="cat_arr_id" class="custom-align-right">
-              <el-cascader :key="parentKey" v-model="form.cat_arr_id" placeholder="请选择要绑定的父级导航" :props="parentData" filterable clearable></el-cascader>
+              <el-cascader :key="parentKey" v-model="form.cat_arr_id" placeholder="请选择要绑定的导航池名称" :props="parentData" filterable clearable></el-cascader>
             </el-form-item>  
             <el-form-item label="推荐等级:" class="custom-align-right">
-              <el-select v-model="form.level" placeholder="请选择推荐等级..">
+              <el-select v-model="form.level" clearable placeholder="请选择推荐等级..">
                 <el-option label="头条" :value="1"></el-option>
                 <el-option label="轮播图" :value="2"></el-option>
                 <el-option label="推荐图" :value="3"></el-option>
@@ -144,7 +144,7 @@
               </div>
             </div>
             <div v-if="form.is_original==1">
-              <el-form-item label="来源名称:" prop="linkurl" class="custom-align-right">
+              <el-form-item label="来源名称:" prop="copyfrom" class="custom-align-right">
                 <el-input v-model="form.copyfrom" autocomplete="off" placeholder="请输入来源名称" disabled="disabled"></el-input>
               </el-form-item>
             </div>
@@ -182,6 +182,9 @@ import Delta from 'quill-delta'; // 引入 Delta,用于手动修改文档
 // 注册 Image Resize 模块
 Quill.register('modules/imageResize', ImageResize);
 
+//解决富文本样式居中不显示
+import 'quill/dist/quill.core.css';
+
 export default {
   components: {
     quillEditor,
@@ -376,7 +379,10 @@ export default {
       }else{
         this.form.islink = 0;
       }
-
+      //如果推荐等级为空,则设置为0
+      if(this.form.level==""){
+        this.form.level = 0;
+      }
       //先进行验证
       this.$refs.form.validate(valid => {
         if (valid) {
@@ -539,6 +545,10 @@ export default {
       if(this.form.islink==1){
         this.cleatForm(1)
       }
+      //如果推荐等级为空,则设置为0
+      if(this.form.level==""){
+        this.form.level = 0;
+      }
       //添加要修改的id
       this.form.id = this.editId;
       //先进行验证
@@ -764,6 +774,40 @@ export default {
   .ql-editor {
     height: 320px;
   }
+
+  /* 富文本对齐方式 */
+	.ql-align-center{
+    text-align: center;
+  }
+  .ql-align-right{
+    text-align: right;
+  }
+  .ql-indent-1{
+    padding-left: 16px;
+  }
+  .ql-indent-2{
+    padding-left: 32px;
+  }
+  .ql-indent-3{
+    padding-left: 48px;
+  }
+  .ql-indent-4{
+    padding-left: 64px;
+  }
+  .ql-indent-5{
+    padding-left: 80px;
+  }
+  .ql-indent-6{
+    padding-left: 96px;
+  }
+  .ql-indent-7{
+    padding-left: 112px;
+  }
+  .ql-indent-8{
+    padding-left: 128px;
+  }
+
+
   //执行v-deep穿透scope选择器 start------------------------------------------------------------>*/
   ::v-deep .custom-form-item > .el-form-item__label {
     line-height: 140px !important;

+ 1 - 1
src/views/template/public/componentWindow.vue

@@ -3,7 +3,7 @@
     <!--开发助手-->
    <div class="testAssistant">
       <div class="testAssistantTitle">
-        开发助手:当前窗口在正式版本中将被移除。
+        代码助手:
       </div>
       <div class="testAssistantContent">
         <div class="testAssistantContentItem">

+ 1 - 1
src/views/template/public/editWindow.vue

@@ -5,7 +5,7 @@
       <!--开发助手-->
       <div class="testAssistant">
         <div class="testAssistantTitle">
-          开发助手:当前窗口在正式版本中将被移除。
+          代码助手:
         </div>
         <div class="testAssistantContent">
           <div class="testAssistantContentItem">