自定义列表里面实现多选功能

需求

我们在开发过程中有时候会遇到列表里面会有多选,然后列表样式也要进行自定义。这里我们如果直接使用ElementUI组件el-table表格的时候这里实现起来可能比较复杂不方便,我们这里手写自定义一下列表里面多选的功能。

实现效果如下图所示:

在这里插入图片描述

具体实现代码如下

1- 我们这里先建一个子组件LiteratureTable.vue

<template>
  <div class="mainComponent">
    <div v-if="tableData.length" class="allCheck">
      <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" v-if="$_has('documentDatabase:download')" @change="handleCheckAllChange">全选</el-checkbox>
    </div>
    <div style="text-align: center;padding: 20px 0;" v-else>
      <el-tag type="warning">暂无数据</el-tag>
    </div>
    <div class="tableList">
      <el-checkbox-group v-model="checkedCities" @change="handleCheckedCitiesChange">
        <el-checkbox class="tableItem" v-for="item in tableData" :label="item.literatureId" :key="item.literatureId">
          <div class="itemPart">
            <div class="TopPart">
              <div class="TopLeft">
                <div class="title">
                  <span class="centerTitle">{{item.title || '无'}}</span>
                  <span class="centerNumber">{{item.code || '无'}}</span>
                </div>
              </div>
              <div class="topRight" v-if="!followupSelectvalue">
                <template v-if="$_has('documentDatabase:edit')">
                  <i class="iconFont el-icon-edit" @click.prevent="editHandel(item)">编辑</i>
                  <el-divider direction="vertical"></el-divider>
                </template>
                <!-- <i class="iconFont el-icon-download" @click.prevent="downloadHandel(item.literatureId)">下载</i> -->
                <!-- <i class="iconFont el-icon-download"></i>
                <DownloadFileForInspection
                  style="margin: 0 -10px;"
                  textColor="#67C23A"
                  btnName="下载"
                  type="text"
                  :url="'/literature/literature/downloadUrl'"
                  :data="{ literatureId: item.literatureId }"
                  method="post"
                /> -->
                <!-- <el-divider direction="vertical"></el-divider> -->
                <i v-if="$_has('documentDatabase:delete')" class="iconFont el-icon-delete" @click.prevent="deleItem(item.literatureId)">删除</i>
              </div>
              <div class="topRight" v-else>
                <el-button type="primary" @click="addselectLiteratureId(item)" size="mini">选中</el-button>
              </div>
            </div>
            <div class="BottomText">
              <div class="text-tag">
                <!-- <span>{{ Projectnamepocket(item.projectId, 'allProject') }}</span>
                |
                <span>{{ tagListPocket(item.derivation, 'Derivation') }}</span>
                |
                <span>{{ tagListPocket(item.type, 'Type') }}</span>
                |
                <span>{{ item.publishYear }}</span>
                |
                <span>{{ tagListPocket(item.lang, 'Lang') }}</span>
                |
                <span>{{ item.provenance || '无' }}</span>
                |
                <span>{{ item.downloadCount || '无' }}</span> -->
                {{ item.tagName || '无' }}
              </div>
              <div>
                {{ item.created_at }}
              </div>
            </div>
          </div>
        </el-checkbox>
      </el-checkbox-group>
    </div>

     <el-dialog title="编辑" :visible.sync="editVisible" width="460px">
      <el-form
        :inline="false"
        class="edit-form"
        ref="editForm"
        :model="editForm"
        label-width="145px">
        <el-form-item
          :rules="{ required: true, message: '请输入标题', trigger: 'blur' }"
          label="标题"
          prop="title">
          <el-input v-model="editForm.title" placeholder="请输入标题" clearable></el-input>
        </el-form-item>
        <el-form-item
          :rules="{ required: true, message: '请选择项目', trigger: 'change' }"
          label="项目"
          prop="projectId">
          <SelectGeneric
            @change="projectValueChange(editForm.projectId)"
            :select.sync="editForm.projectId"
            filterable
            multiple
            :options="'allProject' | pocketOptions"
            placeholder="请选择项目"
          >
          </SelectGeneric>
        </el-form-item>
        <el-form-item
          :rules="{ required: true, message: '请选择年限', trigger: 'change' }"
          label="发表年限"
          prop="publishYear">
          <el-date-picker
            v-model="editForm.publishYear"
            :picker-options="pickerOptions"
            type="year"
            format="yyyy"
            value-format="yyyy"
            placeholder="请选择年限">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="来源" prop="provenance">
          <el-input v-model="editForm.provenance" placeholder="请输入来源" clearable></el-input>
        </el-form-item>
        <el-form-item label="影响因子" prop="influence">
          <!-- <el-input type="number" v-model="editForm.influence" placeholder="请输入影响因子" clearable></el-input> -->
          <MyInputNumber style="width: 200px;" v-model="editForm.influence" :min="0" :max="1000" :precision="3" placeholder="请输入影响因子" clearable></MyInputNumber>
        </el-form-item>
        <el-form-item
          v-if="derivationOptions.length > 0"
          :rules="{ required: true, message: '请选择出处', trigger: 'change' }"
          label="出处"
          prop="derivationId">
          <SelectGeneric
            :select.sync="editForm.derivationId"
            :options="derivationOptions"
            placeholder="请选择出处"
            multiple
            collapse-tags
            clearable
          >
          </SelectGeneric>
        </el-form-item>

        <el-form-item
          v-for="(activeFormItem, i) in activeFormItems"
          :key="i"
          :label="activeFormItem.label"
          :prop="activeFormItem.shortName"
          :rules="{ required: !!activeFormItem.required, message: '请选择' + activeFormItem.label, trigger: 'change' }"
        >
          <el-cascader
            v-if="activeFormItem.type === 'cascader'"
            :options="activeFormItem.ch"
            v-model="editForm[activeFormItem.shortName]"
            :show-all-levels="false"
            :props="cascaderProps"
            :placeholder="'请选择' + activeFormItem.label"
            clearable
            filterable>
          </el-cascader>
          <SelectGeneric
            v-else
            collapse-tags
            filterable
            clearable
            :multiple="activeFormItem.type === 'multiple'"
            :select.sync="editForm[activeFormItem.shortName]"
            :options="activeFormItem.ch"
            :placeholder="'请选择' + activeFormItem.label"
          >
          </SelectGeneric>
        </el-form-item>

      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="editVisible = false">取 消</el-button>
        <el-button type="primary" @click="editConfirm">确 定</el-button>
      </div>
    </el-dialog>

    <el-dialog title="下载文献" :visible.sync="downloadVisible" width="460px" @closed="downloadClose">
      <el-form
        class="communication-form"
        ref="downloadForm"
        :model="downloadForm"
        label-width="80px">
        <el-form-item
          label="文献目的"
          prop="Goals"
          :rules="{ required: true, message: '请选文献目的', trigger: 'change' }">
          <el-radio-group v-model="downloadForm.Goals">
            <el-radio label="DoctorNeeds">医生需求</el-radio>
            <el-radio label="SelfLearning">自我学习</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item
          label="医生编号"
          prop="DoctorNo"
          v-if="downloadForm.Goals === 'DoctorNeeds'"
          :rules="{ required: true, message: '请输入医生编号', trigger: 'blur' }">
          <el-input v-model="downloadForm.DoctorNo" placeholder="请输入医生编号" clearable></el-input>
        </el-form-item>
        <el-form-item
          label="项目"
          prop="ProjectId"
          :rules="{ required: true, message: '请选择项目', trigger: 'change' }">
          <SelectGeneric
            :select.sync="downloadForm.ProjectId"
            :options="'allProject' | pocketOptions"
            placeholder="请选择项目"
            filterable
          >
          </SelectGeneric>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="downloadVisible = false">取 消</el-button>
        <el-button type="primary" @click="downloadConfirm">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { downloadByUrl } from '@utils/index'
export default {
  props: ['tableData', 'followupSelectvalue'],
  data () {
    return {
      downloadVisible: false,
      downloadForm: {
        Goals: 'DoctorNeeds',
        DoctorNo: undefined,
        ProjectId: undefined
      },
      selectLiteratureId: null,
      cascaderProps: {
        multiple: true,
        emitPath: false,
        checkStrictly: false,
        label: 'label',
        value: 'value',
        children: 'ch'
      },
      editVisible: false,
      editForm: {
        relationId: [],
        derivationId: []
      },
      derivationOptions: [],
      pickerOptions: {
        disabledDate: (val) => {
          var date = new Date()
          if (val.getFullYear() >= 2010 && val.getFullYear() <= date.getFullYear()) {
            return false
          } else {
            return true
          }
        }
      },
      checkAll: false,
      checkedCities: [],
      cities: [
        {
          literatureId: '1',
          name: '1'
        },
        {
          literatureId: '2',
          name: '2'
        },
        {
          literatureId: '3',
          name: '3'
        }
      ],
      isIndeterminate: false,
      activeFormItems: [],
      activeFormField: {}
    }
  },
  watch: {
  },
  methods: {
    projectValueChange (val) {
      if (val !== null && val !== '') {
        // this.editForm.derivationId = []
        this.$store.dispatch('scholarlyLiterature/getDerivationList', { ProjectId: val }).then(res => {
          this.derivationOptions = res.data
        })
      } else {
        this.editForm.derivationId = []
        this.derivationOptions = []
      }
    },
    // 获取项目名称
    Projectnamepocket (value, type, defalult) {
      var pocketLabel = []
      for (const i in this.$store.state.tool.pocket) {
        if (i === type) {
          if (Array.isArray(value)) {
            for (const item of value) {
              for (const v of this.$store.state.tool.pocket[type]) {
                if (item === v.value) {
                  pocketLabel.push(v.label)
                }
              }
            }
          } else {
            for (const v of this.$store.state.tool.pocket[type]) {
              if (value === v.value) {
                pocketLabel.push(v.label)
              }
            }
          }
          break
        }
      }
      return pocketLabel.length > 0 ? pocketLabel.join('、') : (defalult || '无')
    },
    tagListPocket (value, type, defalult) {
      if (!value) return '无'
      var pocketLabel = []
      const tagList = this.$store.state.tool.pocket.tagList || []
      for (let i = 0; i < tagList.length; i++) {
        const element = tagList[i]
        if (element.shortName === type) {
          if (Array.isArray(value)) {
            for (const item of value) {
              for (const v of element.ch) {
                if (item === v.value) {
                  pocketLabel.push(v.label)
                }
              }
            }
          } else {
            for (const v of i.ch) {
              if (value === v.value) {
                pocketLabel.push(v.label)
              }
            }
          }
          break
        }
      }
      return pocketLabel.length > 0 ? pocketLabel.join('、') : (defalult || '无')
    },
    editHandel (row) {
      this.$store.dispatch('scholarlyLiterature/getDerivationList', { ProjectId: row.projectId }).then(res => {
        this.derivationOptions = res.data
        this.editForm = row
        this.editVisible = true

        this.$refs.editForm && this.$refs.editForm.clearValidate()
      })
    },
    editConfirm () {
      const options = this.editForm
      // options.relation = this.editForm.relationId.map(e => e[1])
      this.$refs.editForm.validate((valid) => {
        if (valid) {
          this.$store.dispatch('scholarlyLiterature/LiteratureEdit', options).then(res => {
            if (res.data) {
              this.editVisible = false
              this.$message.success('编辑成功')
              this.$emit('refreshCurrentPage')
            }
          })
        } else {
          return false
        }
      })
    },
    handleCheckAllChange (val) {
      console.log(val)
      var arr = []
      for (var i = 0; i < this.tableData.length; i++) {
        arr.push(this.tableData[i].literatureId)
      }
      this.checkedCities = val ? arr : []
      this.$emit('change', this.checkedCities)
      this.isIndeterminate = false
    },
    handleCheckedCitiesChange (value) {
      const checkedCount = value.length
      this.checkAll = checkedCount === this.tableData.length
      this.isIndeterminate = checkedCount > 0 && checkedCount < this.tableData.length
      this.$emit('change', value)
    },
    downloadConfirm () {
      this.$refs.downloadForm.validate((valid) => {
        if (valid) {
          const options = {
            ...this.downloadForm,
            LiteratureId: this.selectLiteratureId
          }
          this.$store.dispatch('scholarlyLiterature/GetLiteratureDownloadUrl', options).then(res => {
            downloadByUrl(res.data.url)
            this.downloadVisible = false
            this.downloadForm = {
              Goals: 'DoctorNeeds',
              DoctorNo: undefined,
              ProjectId: undefined
            }
          })
        } else {
          return false
        }
      })
    },
    deleItem (literatureId) {
      this.$confirm('确定删除吗?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.$store.dispatch('scholarlyLiterature/LiteratureDel', { literatureId }).then(res => {
          if (res.data) {
            this.$message.success('删除成功')
            this.$emit('refreshCurrentPage')
          }
        })
      }).catch(() => {})
    },
    addselectLiteratureId (row) {
      console.log(row)
      this.$emit('selectliteratureData', row)
    }
  }
}
</script>

<style lang="scss" scoped>
  .mainComponent {
    .tableList {
      ::v-deep .el-checkbox {
        user-select: auto;
        cursor: default;
      }

      .tableItem {
        display: block;
        width: 100%;
        position: relative;

        ::v-deep .el-checkbox__input {
          position: absolute;
          top: 50%;
          margin-top: -23px;
        }

        ::v-deep .el-checkbox__label {
          width: 100%;
          padding-left: 23px;

          .itemPart {
            border-bottom: 1px solid #ededed;
            padding: 10px 0px;

            .TopPart {
              display: flex;
              justify-content: space-between;
              align-items: center;
              margin-bottom: 10px;

              .TopLeft {
                display: flex;
                align-items: center;

                .topLeftCheck {
                  padding-right: 20px;
                  display: flex;
                }

                .title {
                  cursor: pointer;
                }

                .centerTitle {
                  font-size: 16px;
                  font-weight: 600;
                  padding-right: 15px;
                  color: #333;
                }

                .centerNumber {
                  display: inline-block;
                  width: 130px;
                  height: 17px;
                  font-weight: 600;
                  background-color: rgb(242, 242, 243);
                  border-color: rgb(155, 157, 163);
                  border-width: 1px;
                  border-style: solid;
                  color: rgb(133, 136, 142);
                  border-radius: 3px;
                  font-size: 12px;
                  padding: 0px;
                  text-align: center;
                  line-height: 17px;
                }

                .centerTime {
                  color: #9999;
                  font-size: 14px;
                  line-height: 28px;
                }
              }

              .topRight {
                color: #6666;
                font-size: 14px;
                padding-right: 50px;

                .iconFont {
                  cursor: pointer;
                  color: #60a4e7;

                  &.el-icon-download {
                    color: #67C23A;
                  }

                  &.el-icon-delete {
                    color: orange;
                  }
                }
              }
            }

            .BottomText {
              display: flex;
              justify-content: space-between;
              align-items: center;
              padding-right: 50px;
              color: #636363;
              font-size: 14px;

              .text-tag {
                min-width: 1000px;
                white-space: normal;
                word-break: break-all;
                word-wrap: break-word;
                white-space: pre-wrap;
                line-height: 1.5;
                margin-right: 35px;
              }

              &.noPadding {
                padding-left: 0;
                padding-right: 0;
              }
            }
          }
        }
      }
    }
  }

  ::v-deep .edit-form {
    .MyInputNumber {
      width: 200px;
    }
  }
</style>

2-父组件引入子组件LiteratureTable 如下:

<template>
  <section>
    <el-form :inline="true" class="communication-form" :model="formData">
      <el-form-item>
        <SelectGeneric
          :select.sync="formData.ProjectId"
          :options="'allProject' | pocketOptions"
          placeholder="请选择项目"
          filterable
        >
        </SelectGeneric>
      </el-form-item>
      <el-form-item>
        <SelectGeneric
          :select.sync="formData.derivationId"
          :options="'derivation' | pocketOptions"
          placeholder="请选择出处"
          filterable
        >
        </SelectGeneric>
      </el-form-item>
      <el-form-item>
        <el-date-picker
          v-model="formData.PublishYear"
          :picker-options="pickerOptions"
          value-format="yyyy"
          type="year"
          placeholder="选择年限">
        </el-date-picker>
      </el-form-item>
      <el-form-item>
        <el-date-picker
          v-model="formData.Date"
          type="daterange"
          format="yyyy-MM-dd"
          value-format="yyyy-MM-dd"
          range-separator="至"
          start-placeholder="更新开始日期"
          end-placeholder="更新结束日期">
        </el-date-picker>
      </el-form-item>
      <el-form-item>
        <el-input v-model="formData.Keyword" placeholder="请输入关键字" clearable></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="search('searchForm')">搜索</el-button>
        <DownloadFileForInspection
          v-if="$_has('documentDatabase:download')"
          btnName="下载"
          type="primary"
          :url="'/literature/literature/downloadPackage'"
          :data="{ literatureIds: selectBatchDownloadIds }"
          method="post"
        />
        <el-button type="primary" v-if="$_has('documentDatabase:upload')" @click="addLiterature" style="margin-left: 10px;">上传</el-button>
        <el-button type="primary" v-if="$_has('documentDatabase:create')" @click="creatRequire">新建需求</el-button>
      </el-form-item>
    </el-form>

    <LiteratureTable
      @change="costPlannedAmountChange($event)"
      :tableData="tableData"
      @refreshCurrentPage="search">
    </LiteratureTable>

    <Pagination
      :total="pagination.totalCount"
      :pageSize="pagination.pageSize"
      :pageNumber.sync="pagination.pageNumber"
      @sizeChange="handleSizeChange"
      @currentChange="handleCurrentChange"
      layout="total, sizes, prev, pager, next, jumper"
    >
    </Pagination>
  </section>
</template>

<script>
import { PageSearch } from '@/mixins'
import LiteratureTable from '../components/LiteratureTable'

export default {
  name: 'DocumentDatabase',
  components: { LiteratureTable },
  mixins: [PageSearch],
  data () {
    return {
      cascaderProps: {
        multiple: true,
        emitPath: false,
        checkStrictly: false,
        label: 'label',
        value: 'value',
        children: 'ch'
      },
      formData: {
        ProjectId: '',
        derivationId: '',
        PublishYear: '',
        Date: '',
        Keyword: ''
      },
      tableData: [],
      addLiteratureVisible: false,
      selectBatchDownloadIds: [],
      pickerOptions: {
        disabledDate: (val) => {
          var date = new Date()
          if (val.getFullYear() >= 2010 && val.getFullYear() <= date.getFullYear()) {
            return false
          } else {
            return true
          }
        }
      },
      activeFormItems: [],
      activeFormField: {}
    }
  },
  activated () {
    this.search()
  },
  watch: {
  },
  methods: {
    // 接收selectBatchDownloadIds
    async costPlannedAmountChange (value) {
      this.selectBatchDownloadIds = value
    },

    addLiterature () {
      this.addLiteratureVisible = true
    },

    addLiteratureConfirm () {
      this.$refs.addLiteratureRef.$refs.addLiteratureForm.validate((valid) => {
        if (valid) {
          // console.log(this.$refs.addLiteratureRef.literatureData)
          const options = JSON.parse(JSON.stringify(this.$refs.addLiteratureRef.literatureData.literatureList))
          if (options.length <= 0) return
          // options.forEach(e => {
          //   e.relation = e.relation.map(e => e[1])
          // })
          const fileNameList = options.map(e => e.fileName)

          this.$store.dispatch('scholarlyLiterature/CheckName', { fileNameList }).then(res => {
            if (res.data.length <= 0) {
              // 校验成功
              this.submitFileList(options)
            }
            if (res.data.length > 0) {
              this.$confirm('文献库中已有重复文件:' + res.data[0], '提示', {
                confirmButtonText: '忽略',
                cancelButtonText: '取消',
                type: 'warning'
              }).then(() => {
                this.submitFileList(options)
              }).catch(() => {})
            }
          })
        } else {
          return false
        }
      })
    },

    submitFileList (data) {
      this.$store.dispatch('scholarlyLiterature/UploadLiterature', { literatureList: data }).then(res => {
        if (res.data) {
          this.addLiteratureVisible = false
          this.$message.success('上传成功')
          this.search()

          this.$refs.addLiteratureRef.literatureData.literatureList = []
        }
      })
    },

    addLiteratureClose () {
      this.addLiteratureVisible = false
      this.$refs.addLiteratureRef.literatureData.literatureList = []
    },

    creatRequire () {
      this.$router.push({ name: 'CreatRequire' })
    },

    literatureRetrieval () {
      this.$router.push({ name: 'LiteratureRetrieval' })
    },

    search (type) {
      if (type === 'searchForm') {
        this.pagination.pageNumber = 1
      }
      const { pageSize, pageNumber } = this.pagination
      const options = {
        ...this.formData,
        // Relation: this.formData.Relation.map(e => e[1]),
        StartTime: this.formData.Date && this.formData.Date[0],
        EndTime: this.formData.Date && this.formData.Date[1],
        pageSize,
        pageNumber
      }
      this.$store.dispatch('scholarlyLiterature/GetLiteratureList', options).then(res => {
        const { list, page } = res.data
        this.tableData = list
        this.pagination = page
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.el-alert {
  margin-bottom: 20px;
}
</style>

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

私域和微商有什么区别?

私域和微商到底有什么区别呢&#xff1f;其实这两个东西有着本质性区别。 私域&#xff1a; 通过原有商业或者新媒体方式获取粉丝或顾客&#xff0c;然后用微信等社交工具&#xff0c;多方位展现&#xff0c;人格专业。 最终目标是让粉丝或顾客成为品牌或IP的朋友&#xff0…

【嵌入式】About USB Powering

https://www.embedded.com/usb-type-c-and-power-delivery-101-power-delivery-protocol/https://www.embedded.com/usb-type-c-and-power-delivery-101-power-delivery-protocol/ Type-C接口有多强&#xff1f;PD协议又是什么&#xff1f;-电子发烧友网由于Type-C接口自身的强…

STM32入门教程-2023版【3-2】详细讲解实现LED流水灯

关注 点赞 不错过精彩内容 大家好&#xff0c;我是硬核王同学&#xff0c;最近在做免费的嵌入式知识分享&#xff0c;帮助对嵌入式感兴趣的同学学习嵌入式、做项目、找工作! 三、LED流水灯 依据电路图连接电路 复制LED闪烁的工程&#xff0c;改个名字叫3-2 LED流水灯 修改…

Android 内容生成pdf文件

1.引入itext7 implementation com.itextpdf:itext7-core:7.1.13上面比较大&#xff0c;可以直接下载需要集成的jar包 implementation files(libs\\layout-7.1.13.jar) implementation files(libs\\kernel-7.1.13.jar) implementation files(libs\\io-7.1.13.jar) implementatio…

亚马逊站内广告位置在哪设置?怎么设置广告位置?-站斧浏览器

亚马逊站内广告位置在哪设置&#xff1f; 亚马逊提供了多种广告类型&#xff0c;包括&#xff1a; Sponsored Products&#xff08;赞助产品&#xff09;&#xff1a;在搜索结果和商品详情页中展示。 Sponsored Brands&#xff08;赞助品牌&#xff09;&#xff1a;在搜索结…

C语言快速入门——前景引入

计算机语言 计算机语言发展计算机的世界操作系统概述计算机编程语言C语言开发环境部署 各位小伙伴想要博客相关资料的话关注公众号&#xff1a;chuanyeTry即可领取相关资料&#xff01; 文章来自&#xff1a;https://www.itbaima.cn/document 计算机语言发展 在学习C语言之前&…

进程的介绍及相关命令

首先&#xff0c;先了解一下计算机五大性能的命令 cpu top w 内存 top free 硬盘剩余 df 硬盘读写性能 iostat 网络带宽 iftop 一&#xff0c;进程与程序 1&#xff0c;什么是程序 &#xff1a; 硬盘上躺着&#xff0c;执行特点任务的一串代码 2&am…

VS2010 ,创建DLL,并调用DLL

一、创建DLL 1. 新建Win32空项目 项目命名为genxls。 2. 创建DLL空项目 3. 头文件&#xff0c;新建项&#xff0c; genxls.h 头文件内容为 // genxls.h #ifndef _DLL_API #define _DLL_API _declspec(dllexport) #else #define _DLL_API _declspec(dllimport) #endif _DLL_A…

我不想学JAVA---------JAVA和C的区别

前言 我一个研究方向是SLAM的为什么要来学JAVA。 从九月份开学到现在&#xff0c;已经学了Linux&#xff0c;数据结构&#xff0c;SLAM&#xff0c;C的基础操作&#xff0c;期间还参与编写了一本VHDL的教材。还有上课、考试什么的其他杂七杂八的事情就不说了。 读研好苦逼&…

IPv6邻居发现协议(NDP)---路由发现

IPv6路由发现(前缀公告) 邻居发现 邻居发现协议NDP(Neighbor Discovery Protocol)是IPv6协议体系中一个重要的基础协议。邻居发现协议替代了IPv4的ARP(Address Resolution Protocol)和ICMP路由器发现(Router Discovery),它定义了使用ICMPv6报文实现地址解析,跟踪邻…

利用蚁剑钓鱼上线CS

前言 ​ 中国蚁剑使用Electron构建客户端软件&#xff0c;Electron实现上用的是Node.js&#xff0c;并且Node.js能执行系统命令&#xff0c;故可以利用蚁剑的webshell页面嵌入js来直接执行命令&#xff0c;进而钓鱼来上线CS。&#xff08;类似Goby&#xff0c;Goby也是使用Ele…

小迪安全第一天

一、常用的专业术语 参考&#xff1a; https://www.cnblogs.com/sunny11/p/13583083.html POC&#xff08;proof of concept&#xff09;验证漏洞的代码EXP(exploit) 利用对一段漏洞代码的利用Playload:有效载荷&#xff0c;当利用exploit成功后如何通过一个管道把这个权限给…

制药企业符合CSV验证需要注意什么?

在制药行业中&#xff0c;计算机化系统验证&#xff08;CSV&#xff09;是确保生产过程的合规性和数据完整性的关键要素。通过CSV验证&#xff0c;制药企业可以保证其计算机化系统的可靠性和合规性&#xff0c;从而确保产品质量和患者安全。然而&#xff0c;符合CSV验证并不是一…

【通讯录案例-延时调用-第三方框架-HUD框架 Objective-C语言】

一、我们接着来看这个通讯录啊,上节课我们说到这里, 1.给它加个注释,// 当用户名和密码正确的时候 进行跳转 我们现在已经把这个判断用户名和密码,登录的这个,以及Segue的简单使用,我们已经说完了, 好,然后呢,在这个里边儿啊, 我们呢,示例程序里边儿,是这个样子的…

C#自动删除20天前文件夹图片

资料夹如下&#xff0c;需求为自动删除20天前保存的图片 如下为该方法函数&#xff0c;保留天数可以自定义 public static void CleanFile(){string path $"{SvMaster.DataPath}\\Image";\\文件夹路径DirectoryInfo dir new DirectoryInfo(path);FileSystemInfo[] …

CEC2017(Python):七种算法(RFO、DBO、HHO、SSA、DE、GWO、OOA)求解CEC2017

一、7种算法简介 1、红狐优化算法RFO 2、蜣螂优化算法DBO 3、哈里斯鹰优化算法HHO 4、麻雀搜索算法SSA 5、差分进化算法DE 6、灰狼优化算法GWO 7、鱼鹰优化算法OOA 二、CEC2017简介 参考文献&#xff1a; [1]Awad, N. H., Ali, M. Z., Liang, J. J., Qu, B. Y., &…

亚马逊促销效果不好怎么办?亚马逊促销规则是什么?-站斧浏览器

亚马逊促销效果不好怎么办&#xff1f; 分析原因&#xff1a;首先需要深入分析促销效果不佳的原因。可能是促销活动的设计不够吸引人&#xff0c;或者是目标受众定位不准确。 调整策略&#xff1a;根据分析结果调整促销策略。例如&#xff0c;优化广告文案、更改推广时段或调…

CentOS7部署Kafka

CentOS7部署Kafka 一、部署1、前置条件2、下载与解压3、修改配置4、启动kafka二、使用详解1、创建一个主题2、展示所有主题3、启动消费端接收消息4、生产端发送消息三、代码集成pom.xmlapplication.propertiesKafkaConfiguration.javaKafkaConsumer.javaKafkaProducer.javaVehi…

什么是软件安全性测试?如何进行安全测试?

一、什么是软件安全性测试&#xff1f; 软件安全性测试是指对软件系统中的安全漏洞进行检测和评估的过程。其目的是为了确保软件系统在面对各种安全威胁时能够保持其功能的完整性、可用性和机密性。 二、软件安全性测试可以通过以下几个步骤来进行&#xff1a; 1. 需求分析&a…

python的初识(print+intput函数和变量的基本运用)

#主页传送&#xff1a;江南的江 #每日鸡汤&#xff1a;你要知是非以不辩为解脱&#xff0c;烦恼以忍辱为智慧&#xff0c;办事以尽力为有功&#xff0c;处人以真诚为品格。做人的方略是&#xff1a;把好自己的口&#xff0c;明了心中的事&#xff0c;干好手里的活&#xff0c;走…