首页 > 其他分享 >基于RuoYi-Flowable-Plus的若依ruoyi-nbcio支持自定义业务表单流程(五)

基于RuoYi-Flowable-Plus的若依ruoyi-nbcio支持自定义业务表单流程(五)

时间:2023-10-25 18:03:01浏览次数:46  
标签:false undefined 自定义 Flowable bo RuoYi form import true


更多ruoyi-nbcio功能请看演示系统

gitee源代码地址

演示地址:RuoYi-Nbcio后台管理系统

今天讲一下wf_demo表单的一些修改

1、demo的实现类修改如下:

主要是增加一个服务名称,后面要用到,同时继承于WfCallBackServiceI,以便进行调用。

@Service("wfDemoService")
public class WfDemoServiceImpl extends ServiceImpl<WfDemoMapper, WfDemo> implements IWfDemoService, WfCallBackServiceI

package com.ruoyi.workflow.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.domain.PageQuery;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import com.ruoyi.workflow.domain.bo.WfDemoBo;
import com.ruoyi.workflow.domain.vo.WfDemoVo;
import com.ruoyi.workflow.domain.WfDemo;
import com.ruoyi.workflow.domain.WfMyBusiness;
import com.ruoyi.workflow.mapper.WfDemoMapper;
import com.ruoyi.workflow.service.IWfDemoService;
import com.ruoyi.workflow.service.WfCallBackServiceI;

import java.util.List;
import java.util.Map;
import java.util.Collection;

/**
 * DEMOService业务层处理
 *
 * @author nbacheng
 * @date 2023-10-12
 */
@RequiredArgsConstructor
@Service("wfDemoService")
public class WfDemoServiceImpl extends ServiceImpl<WfDemoMapper, WfDemo> implements IWfDemoService, WfCallBackServiceI {

    private final WfDemoMapper baseMapper;

    /**
     * 查询DEMO
     */
    @Override
    public WfDemoVo queryById(Long demoId){
        return baseMapper.selectVoById(demoId);
    }

    /**
     * 查询DEMO列表
     */
    @Override
    public TableDataInfo<WfDemoVo> queryPageList(WfDemoBo bo, PageQuery pageQuery) {
        LambdaQueryWrapper<WfDemo> lqw = buildQueryWrapper(bo);
        Page<WfDemoVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
        return TableDataInfo.build(result);
    }

    /**
     * 查询DEMO列表
     */
    @Override
    public List<WfDemoVo> queryList(WfDemoBo bo) {
        LambdaQueryWrapper<WfDemo> lqw = buildQueryWrapper(bo);
        return baseMapper.selectVoList(lqw);
    }

    private LambdaQueryWrapper<WfDemo> buildQueryWrapper(WfDemoBo bo) {
        Map<String, Object> params = bo.getParams();
        LambdaQueryWrapper<WfDemo> lqw = Wrappers.lambdaQuery();
        lqw.like(StringUtils.isNotBlank(bo.getUserName()), WfDemo::getUserName, bo.getUserName());
        lqw.like(StringUtils.isNotBlank(bo.getNickName()), WfDemo::getNickName, bo.getNickName());
        lqw.eq(StringUtils.isNotBlank(bo.getEmail()), WfDemo::getEmail, bo.getEmail());
        lqw.eq(StringUtils.isNotBlank(bo.getAvatar()), WfDemo::getAvatar, bo.getAvatar());
        lqw.eq(StringUtils.isNotBlank(bo.getStatus()), WfDemo::getStatus, bo.getStatus());
        return lqw;
    }

    /**
     * 新增DEMO
     */
    @Override
    public Boolean insertByBo(WfDemoBo bo) {
        WfDemo add = BeanUtil.toBean(bo, WfDemo.class);
        validEntityBeforeSave(add);
        boolean flag = baseMapper.insert(add) > 0;
        if (flag) {
            bo.setDemoId(add.getDemoId());
        }
        return flag;
    }

    /**
     * 修改DEMO
     */
    @Override
    public Boolean updateByBo(WfDemoBo bo) {
        WfDemo update = BeanUtil.toBean(bo, WfDemo.class);
        validEntityBeforeSave(update);
        return baseMapper.updateById(update) > 0;
    }

    /**
     * 保存前的数据校验
     */
    private void validEntityBeforeSave(WfDemo entity){
        //TODO 做一些数据校验,如唯一约束
    }

    /**
     * 批量删除DEMO
     */
    @Override
    public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
        if(isValid){
            //TODO 做一些业务上的校验,判断是否需要校验
        }
        return baseMapper.deleteBatchIds(ids) > 0;
    }

    @Override
    public Page<WfDemoBo> myPage(Page<WfDemoBo> page, QueryWrapper<WfDemoBo> queryWrapper) {
        return baseMapper.myPage(page, queryWrapper);
    }
    
	@Override
	public void afterFlowHandle(WfMyBusiness business) {
		//流程操作后做些什么
        business.getTaskNameId();//接下来审批的节点
        business.getValues();//前端传进来的参数
        business.getActStatus();//流程状态 ActStatus.java
        //....其他
		
	}

	@Override
	public Object getBusinessDataById(String dataId) {
		 return this.getById(dataId);
	}

	@Override
	public Map<String, Object> flowValuesOfTask(String taskNameId, Map<String, Object> values) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<String> flowCandidateUsernamesOfTask(String taskNameId, Map<String, Object> values) {
		// TODO Auto-generated method stub
		return null;
	}
}

2、增加一个列表查询的sql,主要是动态增加流程相关内容

<select id="myPage" resultType="com.ruoyi.workflow.domain.bo.WfDemoBo">
        select t.*,b.process_definition_key,
            b.process_definition_id,
            b.process_instance_id,
            b.title,
            b.data_id,
            b.service_impl_name,
            b.proposer,
            b.act_status,
            b.todo_users,
            b.done_users,
            b.priority,
            b.task_id,
            b.task_name_id,
            b.task_name,
            b.deploy_id
        from wf_demo t left join wf_my_business b on b.data_id = t.demo_id
            ${ew.customSqlSegment}
    </select>

3、demo列表接口进行修改

/**
     * 查询DEMO列表
     */
    @SaCheckPermission("workflow:demo:list")
    @GetMapping("/list")
    public TableDataInfo<WfDemoBo> list(WfDemoBo bo, PageQuery pageQuery, HttpServletRequest req) {
    	//by nbacheng for java.sql.SQLSyntaxErrorException: ORA-00918: 未明确定义列
		Map<String, String[]> ParameterMap = new HashMap<String, String[]>(req.getParameterMap());
		String[] column = new String[]{""};
		if(ParameterMap!=null&&  ParameterMap.containsKey("column")) {
			column[0] = ParameterMap.get("column")[0];
			column[0] = "t."+ column[0];
			ParameterMap.replace("column", column);
			log.info("修改的排序规则>>列:" + ParameterMap.get("column")[0]);			
		}
		QueryWrapper<WfDemoBo> queryWrapper = QueryGenerator.initQueryWrapper(bo, ParameterMap);
		
		Page<WfDemoBo> page = new Page<WfDemoBo>(pageQuery.getPageNum(), pageQuery.getPageSize());
	    Page<WfDemoBo> result = iWfDemoService.myPage(page, queryWrapper);
	    return TableDataInfo.build(result);
    }

4、增加前端显示demo内容的页面

<template>
  <div class="app-container">
  <!-- 显示DEMO数据 -->
    <el-form ref="form" :model="form" label-width="80px" :disabled="disabled">
      <el-form-item label="用户账号" prop="userName">
        <el-input v-model="form.userName" placeholder="" />
      </el-form-item>
      <el-form-item label="用户昵称" prop="nickName">
        <el-input v-model="form.nickName" placeholder="" />
      </el-form-item>
      <el-form-item label="用户邮箱" prop="email">
        <el-input v-model="form.email" placeholder="" />
      </el-form-item>
      <el-form-item label="头像地址" prop="avatar">
        <el-input v-model="form.avatar" placeholder="" />
      </el-form-item>
      <el-form-item label="备注" prop="remark">
        <el-input v-model="form.remark" type="textarea" placeholder="" />
      </el-form-item>
    </el-form>
    <!--<div slot="footer" class="dialog-footer">
      <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
      <el-button @click="cancel">取 消</el-button>
    </div> -->
  </div>
</template>

<script>
  import {getDemo, delDemo, addDemo, updateDemo } from "@/api/workflow/demo";

  export default {
    name: "wfDemo",
    components: {
    },
    props: {
      //表单禁用
      disabled: {
        type: Boolean,
        default: false,
        required: false
      },
      /*流程自定义表单数据*/
      customFormData:{
         type:Object,
         default:()=>{return {}},
         required:false
      },
    },
    data() {
      return {
        // 按钮loading
        buttonLoading: false,
        // 弹出层标题
        title: "",
        // 是否显示弹出层
        open: true,
        // 表单参数
        form: {},
      }
    },
    created() {
      //流程调用自定义表单的传入参数
      if(this.customFormData != null) {
        console.log("this.customFormData=",this.customFormData);
        this.form = this.customFormData;
      }
      //this.handleView(this.form);
    },
    methods: {
      // 取消按钮
      cancel() {
        this.open = false;
        this.reset();
      },
      // 表单重置
      reset() {
        this.form = {
          demoId: undefined,
          userName: undefined,
          nickName: undefined,
          email: undefined,
          avatar: undefined,
          status: undefined,
          delFlag: undefined,
          createBy: undefined,
          createTime: undefined,
          updateBy: undefined,
          updateTime: undefined,
          remark: undefined
        };
        this.resetForm("form");
      },
      /** 新增按钮操作 */
      handleAdd() {
        this.reset();
        this.open = true;
        this.title = "添加DEMO";
      },
      /** 查看按钮操作 */
      handleView(row) {
        this.loading = true;
        this.reset();
        const demoId = row.demoId || this.ids
        getDemo(demoId).then(response => {
          this.loading = false;
          this.form = response.data;
          this.open = true;
          this.title = "DEMO详情";
        });
      },
      /** 修改按钮操作 */
      handleUpdate(row) {
        this.loading = true;
        this.reset();
        const demoId = row.demoId || this.ids
        getDemo(demoId).then(response => {
          this.loading = false;
          this.form = response.data;
          this.open = true;
          this.title = "修改DEMO";
        });
      },
      /** 提交按钮 */
      submitForm() {
        this.$refs["form"].validate(valid => {
          if (valid) {
            this.buttonLoading = true;
            if (this.form.demoId != null) {
              updateDemo(this.form).then(response => {
                this.$modal.msgSuccess("修改成功");
                this.open = false;
                this.getList();
              }).finally(() => {
                this.buttonLoading = false;
              });
            } else {
              addDemo(this.form).then(response => {
                this.$modal.msgSuccess("新增成功");
                this.open = false;
                this.getList();
              }).finally(() => {
                this.buttonLoading = false;
              });
            }
          }
        });
      },
    }
  }
</script>

<style>
</style>

5、demo页面增加流程相关的按钮与组件方法

<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="用户账号" prop="userName">
        <el-input
          v-model="queryParams.userName"
          placeholder="请输入用户账号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="用户昵称" prop="nickName">
        <el-input
          v-model="queryParams.nickName"
          placeholder="请输入用户昵称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="用户邮箱" prop="email">
        <el-input
          v-model="queryParams.email"
          placeholder="请输入用户邮箱"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="头像地址" prop="avatar">
        <el-input
          v-model="queryParams.avatar"
          placeholder="请输入头像地址"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['workflow:demo:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['workflow:demo:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['workflow:demo:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['workflow:demo:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>
    <el-table v-loading="loading" :data="demoList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="30" align="center" />
      <el-table-column label="用户ID" align="center" prop="demoId" v-if="true"/>
      <el-table-column label="用户账号" align="center" prop="userName" />
      <el-table-column label="用户昵称" align="center" prop="nickName" />
      <el-table-column label="流程状态" align="center" prop="actStatus" />
      <el-table-column label="待处理节点" align="center" prop="taskName" />
      <el-table-column label="处理人" align="center" prop="todoUsers" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <act-apply-btn @success="getList" :data-id="scope.row.demoId" :serviceName="serviceName" :variables="scope.row"></act-apply-btn>
          <!--<act-handle-btn @success="getList" :data-id="scope.row.demoId" :type="0" text="通过"></act-handle-btn>
          <act-handle-btn @success="getList" :data-id="scope.row.demoId" :type="1" text="驳回"></act-handle-btn>
          <act-handle-btn @success="getList" :data-id="scope.row.demoId" :type="2" text="退回"></act-handle-btn>
          <act-cancel-btn @success="getList" :data-id="scope.row.demoId"></act-cancel-btn>-->
          <act-historic-detail-btn :data-id="scope.row.demoId"></act-historic-detail-btn>
          <a-divider type="vertical" />
          <el-button
            size="medium"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['workflow:demo:edit']"
          >修改</el-button>
          <el-button
            size="medium"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['workflow:demo:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改DEMO对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="用户账号" prop="userName">
          <el-input v-model="form.userName" placeholder="请输入用户账号" />
        </el-form-item>
        <el-form-item label="用户昵称" prop="nickName">
          <el-input v-model="form.nickName" placeholder="请输入用户昵称" />
        </el-form-item>
        <el-form-item label="用户邮箱" prop="email">
          <el-input v-model="form.email" placeholder="请输入用户邮箱" />
        </el-form-item>
        <el-form-item label="头像地址" prop="avatar">
          <el-input v-model="form.avatar" placeholder="请输入头像地址" />
        </el-form-item>
        <el-form-item label="备注" prop="remark">
          <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
  import { listDemo, getDemo, delDemo, addDemo, updateDemo } from "@/api/workflow/demo";
  import ActApplyBtn from "@/views/workflow/components/ActApplyBtn";
  import ActCancelBtn from "@/views/workflow/components/ActCancelBtn";
  import ActHandleBtn from "@/views/workflow/components/ActHandleBtn";
  import ActHistoricDetailBtn from "@/views/workflow/components/ActHistoricDetailBtn";

export default {
  name: "Demo",
  components: {
    ActApplyBtn,
    ActCancelBtn,
    ActHandleBtn,
    ActHistoricDetailBtn
  },
  data() {
    return {
      // 按钮loading
      buttonLoading: false,
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // DEMO表格数据
      demoList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        userName: undefined,
        nickName: undefined,
        email: undefined,
        avatar: undefined,
        status: undefined,
      },
      serviceName: 'wfDemoService',
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        demoId: [
          { required: true, message: "DEMO-ID不能为空", trigger: "blur" }
        ],
        userName: [
          { required: true, message: "用户账号不能为空", trigger: "blur" }
        ]
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询DEMO列表 */
    getList() {
      this.loading = true;
      listDemo(this.queryParams).then(response => {
        this.demoList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        demoId: undefined,
        userName: undefined,
        nickName: undefined,
        email: undefined,
        avatar: undefined,
        status: undefined,
        delFlag: undefined,
        createBy: undefined,
        createTime: undefined,
        updateBy: undefined,
        updateTime: undefined,
        remark: undefined
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.demoId)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加DEMO";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.loading = true;
      this.reset();
      const demoId = row.demoId || this.ids
      getDemo(demoId).then(response => {
        this.loading = false;
        this.form = response.data;
        this.open = true;
        this.title = "修改DEMO";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          this.buttonLoading = true;
          if (this.form.demoId != null) {
            updateDemo(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            }).finally(() => {
              this.buttonLoading = false;
            });
          } else {
            addDemo(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            }).finally(() => {
              this.buttonLoading = false;
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const demoIds = row.demoId || this.ids;
      this.$modal.confirm('是否确认删除DEMO编号为"' + demoIds + '"的数据项?').then(() => {
        this.loading = true;
        return delDemo(demoIds);
      }).then(() => {
        this.loading = false;
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {
      }).finally(() => {
        this.loading = false;
      });
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('workflow/demo/export', {
        ...this.queryParams
      }, `demo_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>

6、效果图如下:

可以进行流程的提交与查看

基于RuoYi-Flowable-Plus的若依ruoyi-nbcio支持自定义业务表单流程(五)_Boo

标签:false,undefined,自定义,Flowable,bo,RuoYi,form,import,true
From: https://blog.51cto.com/u_15070324/8023622

相关文章

  • 基于RuoYi-Flowable-Plus的若依ruoyi-nbcio支持自定义业务表单流程(四)
    更多ruoyi-nbcio功能请看演示系统gitee源代码地址演示地址:RuoYi-Nbcio后台管理系统自定义业务表单里的流程历史需要单独设计,所以下面就这部分进行介绍。1、后端部分,这部分增加单独的接口,只需要单独的dataID就可以了,如下:/***流程详情信息**@paramdataId业务数......
  • 基于RuoYi-Flowable-Plus的若依ruoyi-nbcio支持自定义业务表单流程(三)
    更多ruoyi-nbcio功能请看演示系统gitee源代码地址演示地址:RuoYi-Nbcio后台管理系统相应的后端也要做一些调整1、启动流程修改如下:/***启动流程实例*/privateRstartProcess(ProcessDefinitionprocDef,Map<String,Object>variables){if(ObjectUti......
  • 基于RuoYi-Flowable-Plus的若依ruoyi-nbcio支持自定义业务表单流程(二)
    更多ruoyi-nbcio功能请看演示系统gitee源代码地址演示地址:RuoYi-Nbcio后台管理系统   之前讲到了流程保存的时候还要看是否是自定义业务流程应用类型,若是保存的时候不再检查是否有关联表单。    那接下来就需要一个自己进行自定义表的流程关联工作了。1、见下图,在流程管......
  • 新手教程系类:群晖NAS如何自定义域名?保姆级教程包教包会
    感谢各位亲的大力支持,本店推出一些列新手教程希望能帮到你。对于个性化或者访问速度有着更高要求的用户,往往最后都会想给自己整个自定义域名,毕竟能够拥有一个专属的域名来访问自己的NAS,还是很方便的,今天就来更新一下DSM7版本的保姆级教程01申请公网IP公网IP是一定要有的,......
  • SpringBoot内容协商(Content Negotiation)二 —— 自定义消息转换器(MessageConverter)
    SpringBoot内置的消息转换器SpringBoot没有处理返回yaml格式的数据,这里需要手动添加处理这种返回格式的支持。导入依赖<dependency><groupId>com.fasterxml.jackson.dataformat</groupId><artifactId>jackson-dataformat-yaml</artifactId></dependency>添加配......
  • [linux] 自定义触摸板功能
    现在ubuntu最新版本使用wayland管理输入。而不是x11了,网上有很多教程建议使用的软件都不能用,搞不好还就把原来系统内置的一些东西搞坏了。在x11(xorg)下可以使用touchegg搭配touche使用,但是在wayland下不行。这里发一个目前实测可以用的自定义触摸板功能的软件叫fusumahttps://githu......
  • 如何在iEDA中添加自定义Tcl命令
    注:ScriptEngine和UserShell头文件和实现在iEDA/src/utility/tcl/ScriptEngine.hh路径下1使用ScriptEngine自定义Tcl命令ScriptEngine是Tcl命令解析器,包含命令、命令选项、解析器等一系列工具。用户可以使用ScriptEngine中的接口轻松实现自定义Tcl命令文件结......
  • uniapp 预览pdf app端使用自定义导航时铺满全屏,需要留出导航栏
    1、安装pdf预览插件:hybrid插件(网上资料很多) 2、封装预览vue页面(重点在加粗部分,使用原生导航没有问题,但是使用自定义导航就把状态栏全部盖住了)<template><viewclass="page"><web-view:webview-styles="webviewStyles":src="src"></web-view>&l......
  • 微信小程序--5. 如下图将顶部导航栏的地方改成自定义样式
    5.如下图将顶部导航栏的地方改成自定义样式1)配置app.json{"window":{"navigationStyle":"custom"//增加这行}} 2)、封装顶部导航栏的样式创建组件文件夹及文件miniprogram\components\navigation-bar\index//components/navigation-bar/index.wxml<!......
  • 基于mutation的自定义指令以监听用户使用f12修改dom
    昨天写了功能后,就又封了一个指令,可以直接应用于ui框架的input组件上贴贴:preventChange/index.jsexportconstpreventChange={inserted(el,binding){constelTag=el.tagName.toLowerCase();//获取当前dom下类型为password的input标签constpasswordI......