Kaynağa Gözat

修改测试计划----中显示的tooltip显示及没选择全部的选项的隐藏

plg 5 gün önce
ebeveyn
işleme
680aa3b253

+ 56 - 3
src/components/ComparePlanProfession.vue

@@ -106,9 +106,44 @@
     <div class="chart_wrap" style="flex: 1; display: flex">
       <div class="c_main1" style="display: flex; flex: 3">
         <!-- <p class="c_name">{{ selectPlan1.planName }} - {{ orgInfo1.orgName }}</p> -->
-        <div id="my_chart" style="width: 100%; height: 100%"></div>
+        <div
+          id="my_chart"
+          style="width: 100%; height: 100%"
+          v-show="
+            (firstParams == 1 &&
+              selectPlan1 !== null &&
+              selectPlan1 !== '' &&
+              compareOptions.orgInfo1 !== null &&
+              compareOptions.orgInfo1 !== '' &&
+              compareOptions.orgInfo2 !== null &&
+              compareOptions.orgInfo2 !== '') ||
+            (firstParams == 2 &&
+              orgInfo1 !== null &&
+              orgInfo1 !== '' &&
+              compareOptions.planInfo1 !== '' &&
+              compareOptions.planInfo1 !== null &&
+              compareOptions.planInfo2 !== '' &&
+              compareOptions.planInfo2 !== null)
+          "
+        ></div>
       </div>
       <div class="c_main2" style="display: flex; flex: 2; overflow-y: auto">
+        <!-- v-if="
+            (firstParams == 1 &&
+              selectPlan1 !== null &&
+              selectPlan1 !== '' &&
+              compareOptions.orgInfo1 !== null &&
+              compareOptions.orgInfo1 !== '' &&
+              compareOptions.orgInfo2 !== null &&
+              compareOptions.orgInfo2 !== '') ||
+            (firstParams == 2 &&
+              orgInfo1 !== null &&
+              orgInfo1 !== '' &&
+              compareOptions.planInfo1 !== '' &&
+              compareOptions.planInfo1 !== null &&
+              compareOptions.planInfo2 !== '' &&
+              compareOptions.planInfo2 !== null)
+          " -->
         <table
           v-if="
             (firstParams == 1 &&
@@ -328,7 +363,25 @@ export default {
       this.initChart();
       this.options = {
         legend: {},
-        tooltip: {},
+        tooltip: {
+          trigger:'axis',
+          axisPointer:{
+            type:'shadow'
+          },
+          formatter: function (params) {
+            var relVal = params[0].name;
+            for (var i = 0, l = params.length; i < l; i++) {
+              relVal +=
+                "<br/>" +
+                params[i].marker +
+                params[i].seriesName +
+                " : " +
+                params[i].value[i+1] +
+                "%";
+            }
+            return relVal;
+          },
+        },
         dataset: {
           source: [
             ["product", "2015", "2016"],
@@ -632,7 +685,7 @@ export default {
     },
     //查询计划下所有组织
     findOrgByPlan() {
-      let url = `/org/findAllOrgByPOrgNo?orgNo=${this.userOrgNo}`;
+      let url = `/org/findAllOrgByCurrent`;
       this.$http.get(url, {}, (res) => {
         if (res.code == 200) {
           let list = [];

+ 403 - 0
src/components/TreeData - 副本 (11-15).vue

@@ -0,0 +1,403 @@
+<template>
+  <table v-if="treeData && treeData.orgName">
+    <tr>
+      <td
+        :colspan="treeData.children ? treeData.children.length * 2 : 1"
+        :class="{
+          parentLevel: treeData.children,
+          extend: treeData.children && treeData.children.length && treeData.isExtend,
+        }"
+      >
+        <div :class="{ node: true, hasMate: treeData.mate }" >
+          <div class="person" @click="$emit('click-node', treeData)">
+            <el-popover v-if="!isDetail" placement="top" width="180" trigger="hover"  >
+              <!-- v-if="treeData.level!==3" -->
+                  <!-- v-if="treeData.isAdd" -->
+              <div style="margin: 0">
+                <el-button
+                  size="mini"
+                  type="primary"
+                  @click="addStock(0)"
+                  v-if="treeData.isAdd&&userInfo.roleType!='3'"
+                  >添加</el-button
+                >
+                <el-button
+                  type="primary"
+                  size="mini"
+                  @click="addStock(1)"
+                  v-if="userInfo.roleType!='3'"
+             
+                  >编辑</el-button
+                >
+                <el-button
+                  type="primary"
+                  size="mini"
+                  @click="deleteStock"
+                  v-if="userInfo.roleType!='3'"
+              
+                  >删除</el-button
+                >
+                <span v-if="userInfo.roleType=='3'">
+                  暂无权限
+                </span>
+              </div>
+              <div
+                class="avat"
+                :class="{
+                  parent: !treeData.level,
+                  company: Number(treeData.level) === 1,
+                 
+                }"
+                slot="reference"
+              >
+              <!-- other: Number(treeData.level) === 3, -->
+                <img v-show="Number(treeData.level) === 1" style="margin-bottom: 10px;" src="../assets/img/group/gen.png" />
+                <img v-show="Number(treeData.level) === 2" style="margin-bottom: 10px;" src="../assets/img/group/er.png" />
+                <span style="background-color: #EDF7F2;padding:10px;border-radius: 10px;display:flex;line-height:30px;justify-content: center;">
+                    {{ treeData.orgName }}
+                </span>
+                
+              </div>
+            </el-popover>
+          </div>
+        </div>
+        <div
+          class="extend_handle"
+          v-if="treeData.children && treeData.children.length"
+          @click="toggleExtend(treeData)"
+        ></div>
+      </td>
+    </tr>
+    <!-- 这是一个递归组件,注意,这里还要调用,需要传递的数据这里也要传递,否则操作时拿不到子级的数据 -->
+    <tr v-if="treeData.children && treeData.children.length && treeData.isExtend">
+      <td
+        v-for="(children, index) in treeData.children"
+        :key="index"
+        colspan="2"
+        class="childLevel"
+      >
+        <TreeChart
+          :json="children"
+          :isDetail="isDetail"
+          @add="$emit('add', $event)"
+          @delete="$emit('delete', $event)"
+          @click-node="$emit('click-node', $event)"
+        />
+      </td>
+    </tr>
+  </table>
+</template>
+
+<script>
+import { oSessionStorage } from "../utils/utils";
+export default {
+  name: "TreeChart",
+  props: {
+    json: {}, // 渲染数据
+    isDetail: {
+      default: false, // 是否是详情
+    },
+  },
+
+  data() {
+    return {
+      treeData: {},
+      userInfo:{}
+    };
+  },
+
+  created() {
+    // console.log(this.json)
+  },
+
+  watch: {
+    isDetail: function (val) {
+      // 是否是详情,详情不能添加编辑
+      this.isDetail = val;
+    },
+    json: {
+      // 遍历当前的数据
+      handler: function (Props) {
+        let extendKey = function (jsonData) {
+          jsonData.isExtend = jsonData.isExtend === void 0 ? true : !!jsonData.isExtend;
+          // if (Array.isArray(jsonData.children) && jsonData.children.length) {
+          //   jsonData.children.forEach(c => {
+          //     extendKey(c);
+          //   });
+          // }
+          return jsonData;
+        };
+        if (Props) {
+          this.treeData = extendKey(Props);
+        }
+      },
+      immediate: true,
+      deep: true,
+    },
+  },
+  mounted(){
+    this.userInfo=JSON.parse(oSessionStorage.getItem("userInfo"));
+  },
+  methods: {
+    toggleExtend(treeData) {
+      treeData.isExtend = !treeData.isExtend;
+      this.$forceUpdate();
+    },
+
+    // 新增编辑股东,val: 0 新增, 1 编辑
+    addStock(val) {
+      // console.log(this.treeData)
+      this.$emit("add", { val: val, data: this.treeData });
+    },
+
+    // 删除股东
+    deleteStock() {
+      this.$emit("delete", this.treeData);
+    },
+  },
+};
+</script>
+
+<style lang="less">
+table {
+  border-collapse: separate !important;
+  border-spacing: 0 !important;
+}
+td {
+  position: relative;
+  vertical-align: top;
+  padding: 0 0 50px 0;
+  text-align: center;
+}
+
+.parent {
+  background: #199ed8 !important;
+  font-weight: bold;
+}
+.extend_handle {
+  position: absolute;
+  left: 50%;
+  bottom: 27px;
+  width: 10px;
+  height: 10px;
+  padding: 10px;
+  transform: translate3d(-15px, 0, 0);
+  cursor: pointer;
+}
+.extend_handle:before {
+  content: "";
+  display: block;
+  width: 100%;
+  height: 100%;
+  box-sizing: border-box;
+  border: 2px solid;
+  border-color: #ccc #ccc transparent transparent;
+  transform: rotateZ(135deg);
+  transform-origin: 50% 50% 0;
+  transition: transform ease 300ms;
+}
+.extend_handle:hover:before {
+  border-color: #333 #333 transparent transparent;
+}
+.extend .extend_handle:before {
+  transform: rotateZ(-45deg);
+}
+
+.extend::after {
+  content: "";
+  position: absolute;
+  left: 50%;
+  bottom: 15px;
+  height: 15px;
+  border-left: 2px solid #ccc;
+  transform: translate3d(-1px, 0, 0);
+}
+.childLevel::before {
+  content: "";
+  position: absolute;
+  left: 50%;
+  bottom: 100%;
+  height: 15px;
+  border-left: 2px solid #ccc;
+  transform: translate3d(-1px, 0, 0);
+}
+.childLevel::after {
+  content: "";
+  position: absolute;
+  left: 0;
+  right: 0;
+  top: -15px;
+  border-top: 2px solid #ccc;
+}
+.childLevel:first-child:before,
+.childLevel:last-child:before {
+  display: none;
+}
+.childLevel:first-child:after {
+  left: 50%;
+  height: 15px;
+  border: 2px solid;
+  border-color: #ccc transparent transparent #ccc;
+  border-radius: 6px 0 0 0;
+  transform: translate3d(1px, 0, 0);
+}
+.childLevel:last-child:after {
+  right: 50%;
+  height: 15px;
+  border: 2px solid;
+  border-color: #ccc #ccc transparent transparent;
+  border-radius: 0 6px 0 0;
+  transform: translate3d(-1px, 0, 0);
+}
+.childLevel:first-child.childLevel:last-child::after {
+  left: auto;
+  border-radius: 0;
+  border-color: transparent #ccc transparent transparent;
+  transform: translate3d(1px, 0, 0);
+}
+
+.node {
+  position: relative;
+  display: inline-block;
+  box-sizing: border-box;
+  text-align: center;
+  padding: 0 5px;
+}
+.node .person {
+  padding-top: 15px;
+  position: relative;
+  display: inline-block;
+  z-index: 2;
+  width: 120px;
+  overflow: hidden;
+}
+.node .person .avat {
+  padding: 5px;
+  padding-top: 10px;
+  display: block;
+  width: 100%;
+  height: 100%;
+  margin: auto;
+  word-break: break-all;
+  background: transparent;
+  box-sizing: border-box;
+  border-radius: 4px;
+  .opreate_icon {
+    display: none;
+  }
+  &:hover {
+    .opreate_icon {
+      display: block;
+      position: absolute;
+      top: -3px;
+      right: -3px;
+      padding: 5px;
+    }
+  }
+
+  &.company {
+    // background: #199ed8;
+    background: transparent;
+    font-weight: 700;
+  }
+  &.other {
+    background: #ccc;
+  }
+}
+.node .person .avat img {
+  cursor: pointer;
+}
+.node .person .name {
+  height: 2em;
+  line-height: 2em;
+  overflow: hidden;
+  width: 100%;
+}
+.node.hasMate::after {
+  content: "";
+  position: absolute;
+  left: 2em;
+  right: 2em;
+  top: 15px;
+  border-top: 2px solid #ccc;
+  z-index: 1;
+}
+.node.hasMate .person:last-child {
+  margin-left: 1em;
+}
+
+.el-dialog__header {
+  padding: 0;
+  padding-top: 30px;
+  margin: 0 30px;
+  // border-bottom: 1px solid #f1f1f1;
+  text-align: left;
+  .el-dialog__title {
+    font-size: 14px;
+    font-weight: bold;
+    color: #464c5b;
+    line-height: 20px;
+  }
+}
+.tips {
+  padding: 0 20px;
+  .el-select {
+    width: 100%;
+  }
+  .blue {
+    color: #00b5ef;
+  }
+  .check {
+    margin-left: 100px;
+  }
+  .inquiry {
+    font-weight: bold;
+  }
+  .el-form-item__label {
+    display: block;
+    float: none;
+    text-align: left;
+  }
+  .el-form-item__content {
+    margin-left: 0;
+  }
+}
+.el-dialog__body {
+  padding: 30px 25px;
+  p {
+    margin-bottom: 15px;
+  }
+}
+.el-dialog__headerbtn {
+  top: 30px;
+  right: 30px;
+}
+
+// 竖向
+.landscape {
+  transform: translate(-100%, 0) rotate(-90deg);
+  transform-origin: 100% 0;
+  .node {
+    text-align: left;
+    height: 8em;
+    width: 8em;
+  }
+  .person {
+    position: relative;
+    transform: rotate(90deg);
+    // padding-left: 4.5em;
+    // height: 4em;
+    top: 35px;
+    left: 12px;
+    width: 110px;
+  }
+}
+
+.el-popover {
+  .el-button {
+    padding: 8px !important;
+    margin-left: 5px !important;
+    float: left;
+  }
+}
+</style>

+ 1 - 0
src/components/TreeData.vue

@@ -10,6 +10,7 @@
       >
         <div :class="{ node: true, hasMate: treeData.mate }" >
           <div class="person" @click="$emit('click-node', treeData)">
+            <!-- <el-popover v-if="false" placement="top" width="180" trigger="hover"  > -->
             <el-popover v-if="!isDetail" placement="top" width="180" trigger="hover"  >
               <!-- v-if="treeData.level!==3" -->
                   <!-- v-if="treeData.isAdd" -->

+ 2 - 0
src/views/manage/channelInfo/orderSettlement.vue

@@ -190,6 +190,8 @@ export default {
           if (res && res.code == 200) {
             //将值赋值给list
             if (res.data.length > 0) {
+               console.log(res.data)
+              //
               let resAdd = this.addPro(res.data);
               this.ppData = JSON.parse(JSON.stringify(resAdd));
               let forRes = this.arrToTree(resAdd);

+ 45 - 6
src/views/manage/channelManagement/channelManagement.vue

@@ -139,10 +139,18 @@
             </template>
           </el-table-column>
           <!-- extractCode -->
-          <el-table-column label="报告密码" align="center" width="">
+          <el-table-column label="报告密码" align="center" width="180px">
             <template slot-scope="scope">
-              <div style="display: flex; align-items: center;justify-content: center;">
-                <span v-show="scope.row.isShow">{{ scope.row.extractCode }}&nbsp;&nbsp;</span>
+              <div style="display: flex; align-items: center; justify-content: center">
+                <!-- {{ scope.row.extractCode}} -->
+                <span
+                  v-show="
+                    scope.row.isShow &&
+                    scope.row.extractCode != null &&
+                    scope.row.extractCode != ''
+                  "
+                  >{{ scope.row.extractCode }}&nbsp;&nbsp;</span
+                >
                 <div
                   style="
                     display: inline-block;
@@ -151,12 +159,16 @@
                     height: 0px;
                     line-height: 9px;
                   "
-                  v-show="!scope.row.isShow"
+                  v-show="
+                    !scope.row.isShow &&
+                    scope.row.extractCode != null &&
+                    scope.row.extractCode != ''
+                  "
                 >
                   ******&nbsp;&nbsp;
                 </div>
                 <i
-                 style="color:#00bf78"
+                  style="color: #00bf78"
                   v-show="
                     scope.row.isShow &&
                     scope.row.extractCode != null &&
@@ -165,8 +177,19 @@
                   @click="scope.row.isShow = !scope.row.isShow"
                   class="el-icon-view"
                 ></i>
+                &nbsp;&nbsp;
+                <i
+                  title="复制文本"
+                  style="color: #00bf78"
+                  v-show="
+                    scope.row.isShow &&
+                    scope.row.extractCode != null &&
+                    scope.row.extractCode != ''
+                  "
+                  @click="onCopy(scope.row)"
+                  class="el-icon-copy-document"
+                ></i>
                 <i
-               
                   v-show="
                     !scope.row.isShow &&
                     scope.row.extractCode != null &&
@@ -175,6 +198,17 @@
                   @click="scope.row.isShow = !scope.row.isShow"
                   class="el-icon-view"
                 ></i>
+                &nbsp;&nbsp;
+                <i
+                  title="复制文本"
+                  v-show="
+                    !scope.row.isShow &&
+                    scope.row.extractCode != null &&
+                    scope.row.extractCode != ''
+                  "
+                  @click="onCopy(scope.row)"
+                  class="el-icon-copy-document"
+                ></i>
               </div>
             </template>
           </el-table-column>
@@ -442,6 +476,11 @@ export default {
     this.searchTarget();
   },
   methods: {
+    onCopy(row) {
+      navigator.clipboard.writeText(row.extractCode).then(() => {
+        this.$message.success("复制成功");
+      });
+    },
     titleFormatter(val) {
       if (val.planStatus == "1") {
         return "计划未开始";