vue 使用 ztree 超大量数据,前端树形结构展示

news2024/10/7 3:30:03
ztree 是一个很经典的基于jquey开发的树结构编辑展示UI组件库。

创建一个文件 ztree.vue,代码如下:

<template>
  <div>
    <div class="ztree vue-giant-tree" :id="ztreeId"></div>
    <div class="treeBox">
      <span slot="footer" class="dialog-footer">
        <el-button
          type="primary"
          @click="pushHandle"
          style="background: #e64e3f; border: none"
          >推 送</el-button
        >
      </span>
    </div>
  </div>
</template>
<script>
import * as $ from "jquery";
if (!window.jQuery) {
  window.jQuery = $;
}
require("@ztree/ztree_v3/js/jquery.ztree.all");
export default {
  props: {
    setting: {
      type: Object,
      require: false,
      default: function () {
        return {};
      },
    },
    nodes: {
      type: Array,
      require: true,
      default: function () {
        return [];
      },
    },
  },
  data() {
    return {
      ztreeId: "ztree_" + parseInt(Math.random() * 1e10),
      ztreeObj: null,
      list: [],
      ztreeSetting: {
        view: {
          showIcon: false, // default to hide icon
        },
        callback: {
          onAsyncError: (...arg) => {
            this.$emit("onAsyncError", ...arg);
          },
          onAsyncSuccess: (...arg) => {
            this.$emit("onAsyncSuccess", ...arg);
          },
          onCheck: (...arg) => {
            this.$emit("onCheck", ...arg);
          },
          onClick: (...arg) => {
            this.$emit("onClick", ...arg);
          },
          onCollapse: (...arg) => {
            this.$emit("onCollapse", ...arg);
          },
          onDblClick: (...arg) => {
            this.$emit("onDblClick", ...arg);
          },
          onDrag: (...arg) => {
            this.$emit("onDrag", ...arg);
          },
          onDragMove: (...arg) => {
            this.$emit("onDragMove", ...arg);
          },
          onDrop: (...arg) => {
            this.$emit("onDrop", ...arg);
          },
          onExpand: (...arg) => {
            this.$emit("onExpand", ...arg);
          },
          onMouseDown: (...arg) => {
            this.$emit("onMouseDown", ...arg);
          },
          onMouseUp: (...arg) => {
            this.$emit("onMouseUp", ...arg);
          },
          onRemove: (...arg) => {
            this.$emit("onRemove", ...arg);
          },
          onRename: (...arg) => {
            this.$emit("onRename", ...arg);
          },
          onRightClick: (...arg) => {
            this.$emit("onRightClick", ...arg);
          },
        },
      },
    };
  },
  methods: {
    pushHandle() {
      var zTree = $.fn.zTree.getZTreeObj(this.ztreeId);
      var dataNodes = [],
        nodes = zTree.getCheckedNodes(true);
      var users = "";
      if (0 === nodes.length) {
        this.$alert("请选择", "提示", {
          confirmButtonText: "确定",
          callback: (action) => {},
        });
        return;
      }
      let count = 0;
      for (var i = 0; i < nodes.length; i++) {
        if (nodes[i].is_last == 1) {
          dataNodes.push(nodes[i].id);
          users += nodes[i].id + ",";
        }
        count++;
        if (count >= nodes.length) {
          if (dataNodes.length == 0) {
            this.$alert("请选择人员", "提示", {
              confirmButtonText: "确定",
              callback: (action) => {},
            });
            return;
          } else {
            users = users.slice(0, -1);
            this.$emit("pushHandleData", users);
          }
        }
      }
    },
  },
  watch: {
    nodes: {
      handler: function (nodes) {
        this.list = nodes;
        // update tree
        if (this.ztreeObj) {
          this.ztreeObj.destroy();
        }
        this.$nextTick(() => {
          this.ztreeObj = $.fn.zTree.init(
            $("#" + this.ztreeId),
            Object.assign({}, this.ztreeSetting, this.setting),
            this.list
          );
          // var zTree = $.fn.zTree.getZTreeObj(this.ztreeId);
          // var datas = nodes.split(',');
          // for (let i = 0; i < datas.length; i++) {
          //   var node = zTree.getNodesByParam("id", datas[i], null)[0];//根据id获取节点
          //   zTree.checkNode(node, true, true);//选中节点
          // zTree.setChkDisabled(node, true);// 禁止勾选节点
          // }
          this.$emit("onCreated", this.ztreeObj);
        });
      },
      deep: true,
      immediate: true,
    },
  },
};
</script>
 
<style>
/* beauty ztree! */
.ztree {
  text-align: left;
  font-size: 14px;
}
.treeBox {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}
.vue-giant-tree li {
  list-style-type: none;
  white-space: nowrap;
  outline: none;
}
.vue-giant-tree li ul {
  position: relative;
  padding: 0 0 0 20px;
  margin: 0;
}
.vue-giant-tree .line:before {
  position: absolute;
  top: 0;
  left: 10px;
  height: 100%;
  content: "";
  border-right: 1px dotted #dbdbdb;
}
.vue-giant-tree .roots_docu:before,
.vue-giant-tree .roots_docu:after,
.vue-giant-tree .center_docu:before,
.vue-giant-tree .bottom_docu:before,
.vue-giant-tree .center_docu:after,
.vue-giant-tree .bottom_docu:after {
  position: absolute;
  content: "";
  border: 0 dotted #dbdbdb;
}
.vue-giant-tree .roots_docu:before {
  left: 10px;
  height: 50%;
  top: 50%;
  border-left-width: 1px;
}
.vue-giant-tree .roots_docu:after {
  top: 50%;
  left: 11px;
  width: 50%;
  border-top-width: 1px;
}
.vue-giant-tree .center_docu:before {
  left: 10px;
  height: 100%;
  border-left-width: 1px;
}
.vue-giant-tree .center_docu:after {
  top: 50%;
  left: 11px;
  width: 50%;
  border-top-width: 1px;
}
.vue-giant-tree .bottom_docu:before {
  left: 10px;
  height: 50%;
  border-left-width: 1px;
}
.vue-giant-tree .bottom_docu:after {
  top: 50%;
  left: 11px;
  width: 50%;
  border-top-width: 1px;
}
.vue-giant-tree li a {
  display: inline-block;
  line-height: 22px;
  height: 22px;
  margin: 0;
  cursor: pointer;
  transition: none;
  vertical-align: middle;
  color: #555555;
}
.vue-giant-tree .node_name {
  display: inline-block;
  padding: 0 3px;
  border-radius: 4px;
}
.vue-giant-tree .curSelectedNode .node_name {
  color: #000;
  background-color: #c9e9f7;
}
.vue-giant-tree .curSelectedNode_Edit {
  height: 20px;
  opacity: 0.8;
  color: #000;
  border: 1px #6cc2e8 solid;
  background-color: #9dd6f0;
}
.vue-giant-tree .tmpTargetNode_inner {
  opacity: 0.8;
  color: #fff;
  background-color: #4fcbf0;
  filter: alpha(opacity=80);
}
.vue-giant-tree .rename {
  font-size: 12px;
  line-height: 22px;
  width: 80px;
  height: 22px;
  margin: 0;
  padding: 0;
  vertical-align: top;
  border: 0;
  background: none;
}
.vue-giant-tree .button {
  position: relative;
  display: inline-block;
  line-height: 22px;
  height: 22px;
  width: 22px;
  cursor: pointer;
  text-align: center;
  vertical-align: middle;
}

.vue-giant-tree .button.edit {
  color: #25ae88;
}
.vue-giant-tree .button.remove {
  color: #cb4042;
}
.vue-giant-tree .button.chk {
  position: relative;
  width: 14px;
  height: 14px;
  margin: 0 4px 0 0;
  border: 1px solid #d7dde4;
  border-radius: 2px;
  background: #fff;
}
.vue-giant-tree .chk.radio_true_full,
.vue-giant-tree .chk.radio_false_full,
.vue-giant-tree .chk.radio_true_full_focus,
.vue-giant-tree .chk.radio_false_full_focus,
.vue-giant-tree .chk.radio_false_disable,
.vue-giant-tree .chk.radio_true_disable,
.vue-giant-tree .chk.radio_true_part,
.vue-giant-tree .chk.radio_false_part,
.vue-giant-tree .chk.radio_true_part_focus,
.vue-giant-tree .chk.radio_false_part_focus {
  border-radius: 8px;
}
.vue-giant-tree .button.chk:after {
  position: absolute;
  top: 1px;
  left: 4px;
  width: 4px;
  height: 8px;
  content: "";
  transition: -webkit-transform 0.2s ease-in-out;
  transition: transform 0.2s ease-in-out;
  transition: transform 0.2s ease-in-out, -webkit-transform 0.2s ease-in-out;
  -webkit-transform: rotate(0deg) scale(0);
  transform: rotate(0deg) scale(0);
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
}
.vue-giant-tree .button.checkbox_false_full_focus {
  border-color: #ccc;
}
.vue-giant-tree .button.checkbox_true_full,
.vue-giant-tree .button.checkbox_true_full_focus,
.vue-giant-tree .button.checkbox_true_part,
.vue-giant-tree .button.checkbox_true_part_focus,
.vue-giant-tree .button.checkbox_true_disable {
  border-color: #39f;
  background-color: #39f;
}
.vue-giant-tree .button.checkbox_true_full:after,
.vue-giant-tree .button.checkbox_true_full_focus:after,
.vue-giant-tree .button.checkbox_true_disable:after {
  -webkit-transform: rotate(45deg) scale(1);
  transform: rotate(45deg) scale(1);
}
.vue-giant-tree .button.checkbox_true_part:after,
.vue-giant-tree .button.checkbox_true_part_focus:after {
  top: 5px;
  left: 2px;
  width: 10px;
  height: 1px;
  -webkit-transform: rotate(0deg) scale(1);
  transform: rotate(0deg) scale(1);
  border-right: 0;
}
.vue-giant-tree .button.radio_true_full,
.vue-giant-tree .chk.radio_true_full_focus,
.vue-giant-tree .chk.radio_true_part,
.vue-giant-tree .chk.radio_true_part_focus {
  border-color: #39f;
}
.vue-giant-tree .button.radio_true_full:after,
.vue-giant-tree .chk.radio_true_full_focus:after,
.vue-giant-tree .chk.radio_true_part:after,
.vue-giant-tree .chk.radio_true_part_focus:after {
  top: 3px;
  left: 3px;
  width: 8px;
  -webkit-transform: rotate(0deg) scale(1);
  transform: rotate(0deg) scale(1);
  border: 0;
  border-radius: 4px;
  background: #39f;
}
.vue-giant-tree .button.checkbox_true_disable,
.vue-giant-tree .button.checkbox_false_disable,
.vue-giant-tree .chk.radio_false_disable,
.vue-giant-tree .chk.radio_true_disable {
  cursor: not-allowed;
}
.vue-giant-tree .button.checkbox_false_disable {
  background-color: #f3f3f3;
}
.vue-giant-tree .button.noline_close:before,
.vue-giant-tree .button.noline_open:before,
.vue-giant-tree .button.root_open:before,
.vue-giant-tree .button.root_close:before,
.vue-giant-tree .button.roots_open:before,
.vue-giant-tree .button.roots_close:before,
.vue-giant-tree .button.bottom_open:before,
.vue-giant-tree .button.bottom_close:before,
.vue-giant-tree .button.center_open:before,
.vue-giant-tree .button.center_close:before {
  position: absolute;
  top: 5px;
  left: 5px;
  content: "";
  transition: -webkit-transform ease 0.3s;
  transition: transform ease 0.3s;
  transition: transform ease 0.3s, -webkit-transform ease 0.3s;
  -webkit-transform: rotateZ(0deg);
  transform: rotateZ(0deg);
  -webkit-transform-origin: 25% 50%;
  transform-origin: 25% 50%;
  border: 6px solid;
  border-color: transparent transparent transparent #666;
}
.vue-giant-tree .button.noline_open:before,
.vue-giant-tree .button.root_open:before,
.vue-giant-tree .button.roots_open:before,
.vue-giant-tree .button.bottom_open:before,
.vue-giant-tree .button.center_open:before {
  -webkit-transform: rotateZ(90deg);
  transform: rotateZ(90deg);
}
.vue-giant-tree .button.ico_loading {
  margin-right: 2px;
  background: url("data:image/gif;base64,R0lGODlhEAAQAKIGAMLY8YSx5HOm4Mjc88/g9Ofw+v///wAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQFCgAGACwAAAAAEAAQAAADMGi6RbUwGjKIXCAA016PgRBElAVlG/RdLOO0X9nK61W39qvqiwz5Ls/rRqrggsdkAgAh+QQFCgAGACwCAAAABwAFAAADD2hqELAmiFBIYY4MAutdCQAh+QQFCgAGACwGAAAABwAFAAADD1hU1kaDOKMYCGAGEeYFCQAh+QQFCgAGACwKAAIABQAHAAADEFhUZjSkKdZqBQG0IELDQAIAIfkEBQoABgAsCgAGAAUABwAAAxBoVlRKgyjmlAIBqCDCzUoCACH5BAUKAAYALAYACgAHAAUAAAMPaGpFtYYMAgJgLogA610JACH5BAUKAAYALAIACgAHAAUAAAMPCAHWFiI4o1ghZZJB5i0JACH5BAUKAAYALAAABgAFAAcAAAMQCAFmIaEp1motpDQySMNFAgA7")
    0 center no-repeat;
}
.vue-giant-tree .tmpTargetzTree {
  opacity: 0.8;
  background-color: #2ea9df;
  filter: alpha(opacity=80);
}
.vue-giant-tree .tmpzTreeMove_arrow {
  position: absolute;
  width: 18px;
  height: 18px;
  color: #4fcbf0;
}
</style>
<style>
ul.ztree.zTreeDragUL {
  margin: 0;
  padding: 0;
  position: absolute;
  overflow: hidden;
  background-color: #dedede;
  border: 1px #4fcbf0 dotted;
  border-radius: 4px;
  opacity: 0.7;
}

.zTreeMask {
  position: absolute;
  z-index: 10000;
  opacity: 0;
  background-color: #cfcfcf;
}
</style>

在使用的页面中引入

注意:从接口获取到的树形数据中的 pId 字段名 中间的 ‘I’ 是大写,支持非树形结构数据,只需 pId 和 id 都有,ztree根据id及pId层级关系构建树结构

<template>
  <div style="position: relative; margin: 15px">
    <el-button
      type="primary"
      icon="el-icon-document-copy"
      size="small"
      @click="openZtree"
    >保存</el-button>

    <el-dialog
      title="通过组织机构选择"
      :visible.sync="dialogZTreeVisible"
      top="1%"
      width="40%"
    >
      <!-- 操作 -->
      <div class="box">
        <div v-if="loading">
          <zTreeLoadings></zTreeLoadings>
        </div>
        <div v-else>
          <ZTree
            :setting="setting"
            :nodes="nodes"
            @onClick="onClick"
            @onCheck="onCheck"
            @onCreated="handleCreated"
            @pushHandleData="pushHandleData"
          />
        </div>
      </div>
    </el-dialog>
    <wp-message
      v-if="message"
      :message="message"
      @close="closeMessage"
      @isOk="closeMessage"
    ></wp-message>
  </div>
</template>

<script>
import * as Api from "@/api/wp-questionnaire";// 接口文件
import WpMessage from "@/components/wp-message"; // 弹窗组件
import ZTree from "@/components/wp-common/zTree";
import zTreeLoadings from "@/components/wp-common/loading";
export default {
  components: {
    WpMessage,
    ZTree,
    zTreeLoadings
  },
  data() {
    return {
      dialogZTreeVisible: false,
      nodes: [],
      showIndex: 0,
      ztreeObj: null,
      setting: {
        check: {
          enable: true,
          //这里设置是否显示复选框
          chkStyle: "checkbox",
          chkboxType: {
            Y: "s",
            N: "ps",
          }, //设置复选框是否与 父/子 级相关联
        },
        data: {
          simpleData: {
            enable: true, //设置是否启用简单数据格式(zTree支持标准数据格式跟简单数据格式)
            idKey: "id", //设置启用简单数据格式时id对应的属性名称
            pidKey: "pId", //设置启用简单数据格式时parentId对应的属性名称,ztree根据id及pid层级关系构建树结构
            rootPId: null, // 根节点的parentId设置为null
          },
          key: {
            name: "name",
          },
        },
        view: {
          selectedMulti: true, //设置是否能够同时选中多个节点
          showIcon: false, //设置是否显示节点图标
          showLine: true, //设置是否显示节点与节点之间的连线
        },
        callback: {
          onClick: function (e, treeId, treeNode) {
            checkNode_user = treeNode;
          },
        },
      },
      loading: false
    };
  },
  methods: {
    // 推送数据
    pushHandleData(val) {
      let param = {
        Id: id, //推送的数据条Id
        userIds: val, //推送用户列表,多个用户以逗号分隔
      };
      let peosonNum = val.split(",");
      // 调用推送的接口
      Api.questionUserAdd(param).then((res) => {
        if (res.data.code == 200) {
          this.toMessage("推送成功!共推送" + peosonNum.length + "人");
          this.dialogZTreeVisible = false;
          // this.$eventBus.$emit("getTableDataList");// 其他页面刷新页面,如果不需要可不加
        } else if (res.data.code == 504) {
          this.$notify({
            title: "提示",
            message: "当前推送数据量过大,请稍后刷新查看!",
            type: "warning",
            duration: 2000,
          });
          this.dialogZTreeVisible = false;
        } else {
          this.$message({
            type: "error",
            message: res.msg,
          });
        }
      });
    },
    // 获取组织树数据
    getZtreeData() {
      this.dialogZTreeVisible = true
      this.loading = true
      let param = {
        type: 3,
        id: String(this.currentQuertionId),
      };
      Api.searchUserTreeList(param).then((res) => {
        if (res.data.code == 200) {
          this.nodes = res.data.data;
          this.loading = false
        }
      });
    },
    // 打开树形结构弹窗
    openZtree() {
      this.getZtreeData();
      this.dialogZTreeVisible = true;
    },
    clickRemove(treeNode) {
      console.log("remove", treeNode);
      this.ztreeObj && this.ztreeObj.removeNode(treeNode);
    },
    onClick(evt, treeId, treeNode) {
      // 点击事件
      console.log(evt.type, treeNode);
    },
    onCheck(evt, treeId, treeNode) {
      // 选中事件
      console.log(evt.type, treeNode);
    },
    handleCreated(ztreeObj) {
      this.ztreeObj = ztreeObj;
      ztreeObj.expandNode(ztreeObj.getNodes()[0], true);
    }
  },
};
</script>

创建弹窗组件 index.vue:

其中 xhnrtp.png 就是个关闭图片

<template>
  <div class="wp-message">
    <div class="message-container">
      <h4 class="message-header">
        信息
        <img src="@/assets/login/xhnrtp.png" alt="" @click="close" />
      </h4>
      <div class="message-main">
        {{ message }}
      </div>
      <div style="text-align: center; margin-bottom: 10px">
        <el-button
          type="primary"
          icon="el-icon-document-copy"
          size="small"
          @click="handelOk"
          >确定</el-button
        >
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    message: {
      type: String,
      default: "",
    },
  },
  methods: {
    close() {
      this.$emit("close");
    },
    handelOk() {
      this.$emit("isOk");
    },
  },
};
</script>

<style lang="scss" scoped>
.wp-message {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 9999;
  background-color: #00000060;
  .message-container {
    width: 300px;
    border-radius: 4px;
    background-color: #fff;
    position: absolute;
    left: 50%;
    top: 300px;
    transform: translateX(-50%);
    padding-bottom: 10px;
    .message-header {
      background-color: #eee;
      font-weight: normal;
      padding: 0px 20px;
      border-radius: 4px 4px 0px 0px;
      margin: 0px;
      height: 40px;
      line-height: 40px;
      color: #333;
      position: relative;
      img {
        position: absolute;
        right: 20px;
        top: 11px;
        cursor: pointer;
      }
    }
    .message-main {
      height: 100px;
      text-align: center;
      color: #333;
      font-size: 14px;
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 0 20px;
    }
  }
}
</style>

由于数据量大加载比较慢,可创建一个加载组件 loading.vue 

<template>
  <div class="box">
    <img class="imgs" src="@/assets/loading.gif" />
  </div>
</template>

<script>
export default {
  methods: {}
}
</script>
<style scoped>
.box {
  display: flex;
  justify-content: center;
  align-items: center;
}
.imgs {
  width: 50px;
  height: 50px;
}
</style>

其中的 loading.gif 就是个动态图。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1826665.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

dbForge Studioor MySQL v6 解锁版 安装教程(MYSQL数据库客户端)

前言 dbForge Studioor MySQL是一个在Windows平台被广泛使用的MySQL客户端&#xff0c;它能够使MySQL开发人员和管理人员在一个方便的环境中与他人一起完成创建和执行查询&#xff0c;开发和调试MySQL程序&#xff0c;自动化管理MySQL数据库对象等工作。 一、下载地址 下载链…

除了英伟达,这些AI概念公司在2024年还有巨大的投资价值(五)

来源&#xff1a;猛兽财经 作者&#xff1a;猛兽财经 猛兽财经在英伟达还没拆股前&#xff0c;股价还是100多美元时&#xff08;2019年&#xff09;就曾多次公开发布文章呼吁大家关注并投资英伟达&#xff0c;以下是猛兽财经在2019年到2022年间公开发布的关于英伟达的部分文…

ESP32-NOW-类 -发送端和接收端的程序

ESP32-NOW-类 -发送端-持续发送-不考虑接收端是否收到-避免程序因接收端没有返回信息而意外停止发送。 import network import espnow import timeclass esp_now_rs(object): # 定义一个ESP-NOW通信类def __init__(self): # 初始化方法self.sta network.WLAN(network.STA_I…

湘潭大学信息与网络安全复习笔记2(总览)

前面的实验和作业反正已经结束了&#xff0c;现在就是集中火力把剩下的内容复习一遍&#xff0c;这一篇博客的内容主要是参考教学大纲和教学日历 文章目录 教学日历教学大纲 教学日历 总共 12 次课&#xff0c;第一次课是概述&#xff0c;第二次和第三次课是密码学基础&#x…

使用Redis将单机登录改为分布式登录

使用Redis将单机登录改为分布式登录 1. 背景 ​ 现在大多数的应用程序登录的方式都是必须满足分布式登录的效果&#xff0c;比如我们在一个客户端登录之后可以在另一个客户端上面共享当前用户的信息&#xff0c;这样在另一个客户端登录的时候就不用用户再次输入自己的账号密码…

2024年哪4种编程语言最值得学习?看JetBrains报告

六个月前,编程工具界的大牛JetBrains发布了他们的全球开发者年度报告。 小吾从这份报告中挑出了关于全球程序员过去一年使用编程语言的情况和未来的采纳趋势,总结出2024年最值得学习的四种编程语言。一起来看看吧。 JetBrains在2023年中开始,就向全球的编程达人们发出了问卷…

R语言数据分析案例27-使用随机森林模型对家庭资产的回归预测分析

一、研究背景及其意义 家庭资产分析在现代经济学中的重要性不仅限于单个家庭的财务健康状况&#xff0c;它还与整个经济体的发展紧密相关。家庭资产的增长通常反映了国家经济的整体增长&#xff0c;而资产分布的不均则暴露了经济不平等的问题。因此&#xff0c;全球视角下的家…

工业园区的弱电智能化总体建设规划

在当今迅速发展的工业环境中&#xff0c;一个高效、智能的工业园区是企业成功的重要基石。随着技术的进步&#xff0c;弱电系统的智能化已不仅仅是便利的象征&#xff0c;更是安全生产和效率提升的必要条件。今天&#xff0c;我们将探讨如何通过弱电智能化系统的总体建设规划来…

小阿轩yx-Apache 网页优化

小阿轩yx-Apache 网页优化 网页压缩与缓存 对Apache服务器优化配置 能让 Apache 发挥出更好的性能 相反&#xff0c;配置糟糕 Apache可能无法正常服务 网页压缩 网站的访问速度是由多个因素所共同决定的 包括应用程序 响应速度网络带宽服务器性能与客户端之间的网络传…

通过语言大模型来学习LLM和LMM(四)

一、大模型学习 新的东西&#xff0c;学习的东西就是多&#xff0c;而且最简单最基础的都需要学习&#xff0c;仿佛一点基础知识都要细嚼慢咽&#xff0c;刨根问底&#xff0c;再加上一顿云里雾里的吹嘘&#xff0c;迷迷糊糊的感觉高大上。其实就是那么一回事。再过一段时日&a…

ASP.NET MVC企业级程序设计(增非空,日期转换,修改)

目录 题目&#xff1a; 实现过程 控制器代码 DAL BLL Index ADD 题目&#xff1a; 实现过程 控制器代码 using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using MvcApplication1.Models; namespace …

FLAN-T5模型的文本摘要任务

Text Summarization with FLAN-T5 — ROCm Blogs (amd.com) 在这篇博客中&#xff0c;我们展示了如何使用HuggingFace在AMD GPU ROCm系统上对语言模型FLAN-T5进行微调&#xff0c;以执行文本摘要任务。 介绍 FLAN-T5是谷歌发布的一个开源大型语言模型&#xff0c;相较于之前的…

企业化运维(3)_PHP、nginx结合php-fpm、memcache、openresty、goaccess日志可视化

###1.PHP源码编译### 解压PHP压缩包&#xff0c;切入PHP目录&#xff0c;进行configure-->make-->make installd三部曲 [rootserver1 ~]# yum install -y bzip2 systemd-devel libxml2-devel sqlite-devel libpng-devel libcurl-devel ##依赖性 [rootserver1 ~]# yum…

基于Nios-II实现流水灯

基于Nios-II实现流水灯的主要原理 涉及到FPGA&#xff08;现场可编程门阵列&#xff09;上的嵌入式软核处理器Nios II与LED控制逻辑的结合。以下是详细的实现原理&#xff0c;分点表示并归纳&#xff1a; Nios II软核处理器介绍&#xff1a; Nios II是Altera公司推出的一种应用…

Camtasia2024破解永久激活码注册码分享最新

随着数字时代的到来&#xff0c;视频制作已成为许多人日常生活和工作中不可或缺的一部分。而在众多视频编辑软件中&#xff0c;Camtasia凭借其强大的功能和易用性&#xff0c;赢得了广泛的用户喜爱。近期&#xff0c;Camtasia 2024的破解版本在网络上引起了广泛关注。本文旨在为…

外链建设如何进行?

理解dofollow和nofollow链接&#xff0c;所谓dofollow链接&#xff0c;就是可以传递权重到你的网站的链接&#xff0c;这种链接对你的网站排名非常有帮助&#xff0c;这种链接可以推动你的网站在搜索结果中的位置向上爬&#xff0c;但一个网站全是这种有用的链接&#xff0c;反…

scrapy爬取豆瓣书单存入MongoDB数据库

scrapy爬取豆瓣书单存入MongoDB数据库 一、安装scrapy库二、创建scrapy项目三、创建爬虫四、修改settings,设置UA,开启管道五、使用xpath解析数据六、完善items.py七、在douban.py中导入DoubanshudanItem类八、爬取所有页面数据九、管道中存入数据,保存至csv文件十、将数据写…

解决javadoc一直找不到路径的问题

解决javadoc一直找不到路径的问题 出现以上问题就是我们在下载jdk的时候一些运行程序安装在C:\Program Files\Common Files\Oracle\Java\javapath下&#xff1a; 一开始是没有javadoc.exe文件的&#xff0c;我们只需要从jdk的bin目录下找到复制到这个里面&#xff0c;就可以使用…

玄机平台应急响应—MySQL应急

前言 这个是比较简单的&#xff0c;其实和MySQL没啥太大的关系&#xff0c;没涉及太多MySQL的知识。看一下它的flag要求吧。 flag1 它说黑客写入的shell&#xff0c;那我们就去它的网站目录去看看&#xff0c;果然有一个叫sh.php的文件。 flag1{ccfda79e-7aa1-4275-bc26-a61…