feige
2023-09-10 d6ed1287fa23fa25eacf57c0d83d533cb2f2bc45
修改了家庭设备详情,增加了打印
4个文件已修改
41 ■■■■ 已修改文件
ruoyi-ui/package.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/main.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/views/device/equipmentInfo.vue 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/views/homeRoot/index.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/package.json
@@ -59,6 +59,7 @@
    "vue-count-to": "1.0.13",
    "vue-cropper": "0.5.5",
    "vue-meta": "2.4.0",
    "vue-print-nb": "^1.7.5",
    "vue-router": "3.4.9",
    "vuedraggable": "2.24.3",
    "vuex": "3.6.0"
ruoyi-ui/src/main.js
@@ -81,7 +81,8 @@
Vue.config.productionTip = false
const Base64 = require('js-base64').Base64
import Print from 'vue-print-nb'
Vue.use(Print)
new Vue({
  el: '#app',
  router,
ruoyi-ui/src/views/device/equipmentInfo.vue
@@ -1,13 +1,18 @@
<template>
  <div class="app-container">
  <div class="app-container" id="printable-content">
    <div class="form-header mt">
      <h1 style="font-size:21px;padding-top:30px;display: flex;justify-content: space-between;align-items: center;">
        <span>家庭设备详情</span>
        <div   style="display: flex; align-items: center;">
          <el-button size="mini" type="text"  @click="checkNote()" v-hasPermi="['person:information:memo']">
          <el-button size="mini" type="text"  v-print="'#printable-content'" v-hasPermi="['person:information:memo']">
            <div class="form" ><el-icon  style="padding-right:110px;"></el-icon>
              <span class="text" style="width: 69px;height: 26px;font-size: 16px;
            font-family: Microsoft YaHei-Regular, Microsoft YaHei; color: #EBA4AA;">备忘本</span></div>
          </el-button>
          <el-button size="mini" type="text"  @click="print()" v-hasPermi="['person:information:memo']">
            <div class="form" ><el-icon  style="padding-right:110px;"></el-icon>
              <span class="text" style="width: 69px;height: 26px;font-size: 16px;
            font-family: Microsoft YaHei-Regular, Microsoft YaHei; color: #EBA4AA;">打印</span></div>
          </el-button>
        </div>
      </h1>
@@ -388,6 +393,28 @@
      this.dsb = false
      this.btn = true
    },
    //打印
    print()
    {
      setTimeout(() => {
        // 获取待打印的内容
            let printableContent = document.getElementById('printable-content').innerHTML;
            console.log(printableContent)
            // 创建一个新的窗口并加载打印内容
            let printWindow = window.open('', '_blank');
            printWindow.document.write('<html><head><title>打印内容</title></head><body>' + printableContent + '</body></html>');
            // 执行打印操作
            printWindow.document.close();
            // 如果内容中有图片或其他需要一定时间加载的,请使用注释中的延时打印
              printWindow.print()
            }, 1000)
         //   printWindow.print();
    },
    //查看备忘本
    checkNote(row){
ruoyi-ui/src/views/homeRoot/index.vue
@@ -385,15 +385,17 @@
      //写第3代的代码逻辑,用两个for循环写第3代
      this.getGenByNum(this.rootThiList, this.rootList[0], 1, 3)
      console.log(this.rootThiList)
    //  console.log('-=-------')
      console.log('-=-------')
      this.isShow_2=true
      this.isShow_3=true
      this.isShow_4=false
    },
    generation_4(){
      this.getList(4);
      this.getGenByNum(this.rootFouList, this.rootList[0], 1, 3)
     // alert(32)
      this.getGenByNum(this.rootFouList, this.rootList[0], 1, 4)
      console.log(this.rootFouList)
  //          console.log('-=23-------')
      this.isShow_2=true
      this.isShow_3=true
      this.isShow_4=true