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

Merge branch 'newtang' of http://120.79.166.78:19005/zhongzheng-edu/saas_entrepot_admin into newtang

yangdamao 2 жил өмнө
parent
commit
efb4aa597a

+ 1 - 1
src/utils/request.js

@@ -8,7 +8,7 @@ import methods from '@/utils/methodsTool';
 axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
 // 创建axios实例
 export const baseURL = process.env.VUE_APP_BASE_API
-// export const baseURL = 'http://192.168.1.7:5030/'
+// export const baseURL = 'http://192.168.1.24:5030/'
 export const BASE_IMG_URL = process.env.VUE_APP_IMG_API
 const service = axios.create({
   // axios中请求配置有baseURL选项,表示请求URL公共部分

+ 101 - 14
src/views/2Cport/pageSettings/header.vue

@@ -49,6 +49,15 @@
     <div>
       <h5>企业标识</h5>
       <ul style="margin-left: 20px">
+        <li class="liSty">
+          <span>模板启用</span>
+          <div>
+            <el-radio-group v-model="listData.templateStatus">
+              <el-radio :label="1">模板一</el-radio>
+              <el-radio :label="2">模板二</el-radio>
+            </el-radio-group>
+          </div>
+        </li>
         <li class="liSty">
           <span style="align-self: flex-start">LOGO图片</span>
           <div>
@@ -97,6 +106,54 @@
             </p>
           </div>
         </li>
+        <li class="liSty">
+          <span style="align-self: flex-start">LOGO图片-浅色</span>
+          <div>
+            <div
+              style="
+                width: 216px;
+                height: 46px;
+                border: 1px dashed #999;
+                border-radius: 28px;
+                line-height: 46px;
+                text-align: center;
+              "
+              v-if="!listData.undertone"
+            >
+              <label for="uplose1">
+                <i class="el-icon-circle-plus-outline iconStsz"></i
+              ></label>
+              <input
+                ref="file1"
+                type="file"
+                style="display: none"
+                id="uplose1"
+                @change="getImgFile1"
+              />
+            </div>
+            <div v-else class="flex_sty" style="background-color: #eee">
+              <el-image
+                style="width: 216px; height: 46px"
+                :src="$methodsTools.splitImgHost(listData.undertone)"
+                :preview-src-list="[
+                  $methodsTools.splitImgHost(listData.undertone),
+                ]"
+              >
+              </el-image>
+              <el-button
+                @click="listData.undertone = ''"
+                style="margin-left: 16px"
+                type="danger"
+                icon="el-icon-delete"
+                circle
+                size="mini"
+              ></el-button>
+            </div>
+            <p style="font-size: 12px; color: #999">
+              注:建议上传logo图片是透明底色的png格式,尺寸为216px * 46px
+            </p>
+          </div>
+        </li>
         <li class="liSty">
           <span>公司名称</span>
           <div>
@@ -195,6 +252,7 @@ export default {
       size: "mini",
       listData: {
         serviceTel: {},
+        templateStatus: 1,
       },
       tableSet: [
         {
@@ -212,7 +270,7 @@ export default {
           scope: "status",
         },
       ],
-      initData:{},
+      initData: {},
     };
   },
   computed: {
@@ -251,8 +309,8 @@ export default {
     },
     submit() {
       let data = JSON.parse(JSON.stringify(this.listData));
-      let copySubmitData = JSON.parse(JSON.stringify(this.initData))
-      copySubmitData.configValue = JSON.stringify(data)
+      let copySubmitData = JSON.parse(JSON.stringify(this.initData));
+      copySubmitData.configValue = JSON.stringify(data);
       updateConfig(copySubmitData).then((res) => {
         this.$message.success("保存成功");
       });
@@ -264,20 +322,23 @@ export default {
       listConfig({ configKey: "home.header" }).then((res) => {
         if (res.rows.length) {
           this.initData = res.rows[0];
-          this.listData = JSON.parse(res.rows[0].configValue);
-          if(!this.listData.Nav.some(i => i.name === '讲义资料')){
+          let A = JSON.parse(res.rows[0].configValue);
+          A.undertone = A.undertone || "";
+          A.templateStatus = A.templateStatus || 1;
+          this.listData = A;
+          if (!this.listData.Nav.some((i) => i.name === "讲义资料")) {
             this.listData.Nav.push({
-              name:"讲义资料",
-              sort:6,
-              status:0
-            })
+              name: "讲义资料",
+              sort: 6,
+              status: 0,
+            });
           }
-          if(!this.listData.Nav.some(i => i.name === '积分商城')){
+          if (!this.listData.Nav.some((i) => i.name === "积分商城")) {
             this.listData.Nav.push({
-              name:"积分商城",
-              sort:7,
-              status:0
-            })
+              name: "积分商城",
+              sort: 7,
+              status: 0,
+            });
           }
         }
       });
@@ -308,6 +369,32 @@ export default {
         self.listData.companyLogo = res;
       });
     },
+    getImgFile1() {
+      var self = this;
+      var file = self.$refs.file1.files[0];
+      if (file === undefined) {
+        self.$set(self.listData, "undertone", "");
+        return;
+      }
+      if (file.size > 0.3 * 1024 * 1024) {
+        self.$message.error("图片不得大于300kb");
+        return;
+      }
+      var type = self.$refs.file1.value.toLowerCase().split(".").splice(-1);
+      if (
+        type[0] != "jpg" &&
+        type[0] != "png" &&
+        type[0] != "jpeg" &&
+        type[0] != "gif"
+      ) {
+        self.$message.error("上传格式需为:.jpg/.png/.jpeg/gif");
+        self.$refs.file1.value = "";
+        return;
+      }
+      this.$upload.upload(file, 0).then((res) => {
+        self.listData.undertone = res;
+      });
+    },
   },
 };
 </script>

+ 25 - 1
src/views/Marketing/goods/commodityManageMent/add/index.vue

@@ -14,6 +14,7 @@
           ref="productInformation"
           :listData="listData"
           @activeExternalLinkStatus="activeExternalLinkStatus"
+          @activeFirstChoiceStatus="activeFirstChoiceStatus"
         />
         <h5 class="segmentationStyle">商品价格和有效期</h5>
         <price-period ref="pricePeriod" :listData="listData" />
@@ -214,6 +215,7 @@ export default {
         certificateTypeId: "",
         showStatus: 1,
         externalLinkStatus: 0,
+        firstChoiceStatus:0,
         commitPeriodStatus: 0,
         sevenYear: "",
       },
@@ -326,6 +328,20 @@ export default {
             validator: validatorCheckPhone,
           },
         ],
+        firstChoiceStatus: [
+          {
+            required: true,
+            message: "请选择是否优选",
+            trigger: "change",
+          },
+        ],
+        minClassHour: [
+          {
+            required: false,
+            message: "请输入优选至少学时",
+            trigger: "blur",
+          },
+        ],
         coverUrl: [
           {
             required: true,
@@ -547,6 +563,14 @@ export default {
       }
       this.$refs["listData"].validateField("externalLink");
     },
+    activeFirstChoiceStatus(e) {
+      if (e) {
+        this.rules.minClassHour[0].required = true;
+      } else {
+        this.rules.minClassHour[0].required = false;
+      }
+      this.$refs["listData"].validateField("minClassHour");
+    },
     /**
      * 动态字段模板
      */
@@ -687,7 +711,7 @@ export default {
       //商品是否上架
       data.goodsStatus = int;
       data.subjectIds = data.subjectIds.toString();
-      if(data.goodsType == 9){
+      if (data.goodsType == 9) {
         data.examLimitClient = data.examLimitClient.toString();
       }
       data.projectId = await this.getProjectId(data.businessId);

+ 30 - 11
src/views/Marketing/goods/commodityManageMent/add/productInformation.vue

@@ -194,6 +194,22 @@
             :precision="2"
             :min="0"
           ></el-input-number> </el-form-item
+        ><el-form-item label="是否优选" prop="firstChoiceStatus">
+          <el-radio-group
+            v-model="listData.firstChoiceStatus"
+            @change="activeFirstChoiceStatus"
+          >
+            <el-radio :label="1">是</el-radio>
+            <el-radio :label="0">否</el-radio>
+          </el-radio-group> </el-form-item
+        ><el-form-item label="优选至少学时" prop="minClassHour">
+          <el-input-number
+            :controls="false"
+            :style="`max-width: ${inputWidth}px`"
+            v-model="listData.minClassHour"
+            :precision="2"
+            :min="0"
+          ></el-input-number> </el-form-item
       ></el-col>
       <el-col :span="12">
         <el-form-item label="商品封面" prop="coverUrl">
@@ -376,6 +392,9 @@ export default {
     activeExternalLinkStatus(e) {
       this.$emit("activeExternalLinkStatus", e);
     },
+    activeFirstChoiceStatus(e) {
+      this.$emit("activeFirstChoiceStatus", e);
+    },
     subjectChanges() {
       this.$bus.$emit("sendBybus");
       this.$bus.$emit("sendBybusBank");
@@ -406,17 +425,17 @@ export default {
         new Date().getTime() + 365 * 1 * 24 * 3600 * 1000,
       ]); //商品有效期
       if (this.listData.goodsType == 2) {
-        this.$set(
-          this.listData,
-          "coverUrl",
-          "oss/images/file/20220518/1652864709142.png"
-        );
-      } else {
-        this.$set(
-          this.listData,
-          "coverUrl",
-          "oss/images/avatar/20211013/1634097664410_1397766697"
-        );
+        //   this.$set(
+        //     this.listData,
+        //     "coverUrl",
+        //     "oss/images/file/20220518/1652864709142.png"
+        //   );
+        // } else {
+        //   this.$set(
+        //     this.listData,
+        //     "coverUrl",
+        //     "oss/images/avatar/20211013/1634097664410_1397766697"
+        //   );
       } //封面
       if (val === 1 || val === 6) {
         this.$bus.$emit("sendBybus");

+ 1 - 1
src/views/Marketing/goods/commodityManageMent/edit/courseContent/index.vue

@@ -131,7 +131,7 @@
           <el-button
             type="text"
             @click="delCourse(scope.row)"
-            v-if="scope.row.index && scope.row.newActive"
+            v-if="scope.row.index && scope.row.newActive || true"
             >删除</el-button
           >
           <el-button

+ 23 - 0
src/views/Marketing/goods/commodityManageMent/edit/index.vue

@@ -15,6 +15,7 @@
           :listData="listData"
           :submitStatusInfo="submitStatusInfo"
           @activeExternalLinkStatus="activeExternalLinkStatus"
+          @activeFirstChoiceStatus="activeFirstChoiceStatus"
         />
         <h5 class="segmentationStyle">商品价格和有效期</h5>
         <price-period ref="pricePeriod" :listData="listData" />
@@ -346,6 +347,20 @@ export default {
             validator: validatorCheckPhone,
           },
         ],
+        firstChoiceStatus: [
+          {
+            required: true,
+            message: "请选择是否优选",
+            trigger: "change",
+          },
+        ],
+        minClassHour: [
+          {
+            required: false,
+            message: "请输入优选至少学时",
+            trigger: "blur",
+          },
+        ],
         coverUrl: [
           {
             required: true,
@@ -615,6 +630,14 @@ export default {
         this.$refs["listData"].validateField("externalLink");
       });
     },
+    activeFirstChoiceStatus(e) {
+      if (e) {
+        this.rules.minClassHour[0].required = true;
+      } else {
+        this.rules.minClassHour[0].required = false;
+      }
+      this.$refs["listData"].validateField("minClassHour");
+    },
     /**
      * 动态字段模板
      */

+ 25 - 2
src/views/Marketing/goods/commodityManageMent/edit/productInformation.vue

@@ -145,7 +145,11 @@
             v-model="listData.goodsName"
           ></el-input>
         </el-form-item>
-        <el-form-item label="商品试卷限制终端学习" prop="examLimitClient" v-if="listData.goodsType == 9">
+        <el-form-item
+          label="商品试卷限制终端学习"
+          prop="examLimitClient"
+          v-if="listData.goodsType == 9"
+        >
           <el-select
             v-model="listData.examLimitClient"
             multiple
@@ -196,6 +200,22 @@
             :precision="2"
             :min="0"
           ></el-input-number> </el-form-item
+        ><el-form-item label="是否优选" prop="firstChoiceStatus">
+          <el-radio-group
+            v-model="listData.firstChoiceStatus"
+            @change="activeFirstChoiceStatus"
+          >
+            <el-radio :label="1">是</el-radio>
+            <el-radio :label="0">否</el-radio>
+          </el-radio-group> </el-form-item
+        ><el-form-item label="优选至少学时" prop="minClassHour">
+          <el-input-number
+            :controls="false"
+            :style="`max-width: ${inputWidth}px`"
+            v-model="listData.minClassHour"
+            :precision="2"
+            :min="0"
+          ></el-input-number> </el-form-item
       ></el-col>
       <el-col :span="12">
         <el-form-item label="商品封面" prop="coverUrl">
@@ -318,6 +338,9 @@ export default {
     activeExternalLinkStatus(e) {
       this.$emit("activeExternalLinkStatus", e);
     },
+    activeFirstChoiceStatus(e) {
+      this.$emit("activeFirstChoiceStatus", e);
+    },
     /**
      *科目切换清楚列表
      */
@@ -373,7 +396,7 @@ export default {
         .inquirebusinessList({ status: 1, educationId: val })
         .then((res) => {
           this.newCourTypeOptions = res.rows;
-          this.showSeven(this.listData.businessId)
+          this.showSeven(this.listData.businessId);
         });
     },
     showSeven(val) {

+ 21 - 2
src/views/resource/videoManagement/courseManagement/chapterContent/index.vue

@@ -18,7 +18,12 @@
       <el-button slot="reference" type="success" @click="openBoxs"
         >添加 模块/章/节</el-button
       >
-      <el-button type="primary" @click="openSortBoxs">排序</el-button>
+      <div>
+        <el-button type="primary" @click="openPreferenceBoxs"
+          >配置优选</el-button
+        >
+        <el-button type="primary" @click="openSortBoxs">排序</el-button>
+      </div>
     </div>
     <el-tree
       ref="tree"
@@ -376,6 +381,7 @@
     </el-dialog>
     <test-paper-preview ref="testPaperPreview" />
     <video-preview ref="preview" />
+    <preference ref="preference" :tableDataInfos.sync="tableDataInfos" />
   </div>
 </template>
 
@@ -384,9 +390,16 @@ import searchBoxNew from "@/components/searchBoxNew";
 import pagination from "@/components/pagination";
 import testPaperPreview from "@/components/testPaperPreview";
 import videoPreview from "@/components/videoPreview";
+import preference from "./preference";
 export default {
   name: "ChapterContent",
-  components: { searchBoxNew, pagination, testPaperPreview, videoPreview },
+  components: {
+    searchBoxNew,
+    pagination,
+    testPaperPreview,
+    videoPreview,
+    preference,
+  },
   data() {
     return {
       disabledBtn: false,
@@ -560,6 +573,11 @@ export default {
     this.search();
   },
   methods: {
+    openPreferenceBoxs() {
+      this.$refs.preference.openBoxs(
+        JSON.parse(JSON.stringify(this.tableDataInfos))
+      );
+    },
     allowDrag(node) {
       if (node.level == 1) {
         return true;
@@ -1208,6 +1226,7 @@ export default {
           status: 1,
           type: item.type,
           sort: item.sort,
+          firstChoiceStatus: item.firstChoiceStatus || 0,
         });
       });
       if (this.menuExamList && this.menuExamList.length > 0) {

+ 78 - 0
src/views/resource/videoManagement/courseManagement/chapterContent/preference.vue

@@ -0,0 +1,78 @@
+<template>
+  <div id="">
+    <el-dialog
+      :visible.sync="dialogVisible"
+      width="628px"
+      :show-close="false"
+      :close-on-click-modal="false"
+    >
+      <div slot="title" class="hearders">
+        <div class="leftTitle">配置优选</div>
+        <div class="rightBoxs">
+          <img
+            src="@/assets/images/Close@2x.png"
+            alt=""
+            @click="dialogVisible = false"
+          />
+        </div>
+      </div>
+      <el-transfer
+        :titles="['未选', '已选']"
+        v-model="value"
+        :data="transferData"
+        :props="{
+          key: 'id',
+          label: 'name',
+        }"
+      ></el-transfer>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="close">取 消</el-button>
+        <el-button type="primary" @click="submit">确 定</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      transferData: [],
+      value: [],
+      dialogVisible: false,
+    };
+  },
+  methods: {
+    openBoxs(array) {
+      let value = [];
+      this.transferData = array.map((i) => {
+        if (i.firstChoiceStatus == 1) {
+          value.push(i.id);
+        }
+        i.disabled = i.type == 2 ? false : true;
+        return i;
+      });
+      this.value = value;
+      this.dialogVisible = true;
+    },
+    close() {
+      this.dialogVisible = false;
+    },
+    submit() {
+      let transferData = JSON.parse(JSON.stringify(this.transferData));
+      transferData.forEach((i) => {
+        delete i.disabled;
+        if (this.value.includes(i.id)) {
+          i.firstChoiceStatus = 1;
+        } else {
+          i.firstChoiceStatus = 0;
+        }
+      });
+      this.$emit("update:tableDataInfos", transferData);
+      this.close();
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped></style>