国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

基于若依的ruoyi-nbcio流程管理系統(tǒng)一種簡(jiǎn)單的動(dòng)態(tài)表單模擬測(cè)試實(shí)現(xiàn)(五)

這篇具有很好參考價(jià)值的文章主要介紹了基于若依的ruoyi-nbcio流程管理系統(tǒng)一種簡(jiǎn)單的動(dòng)態(tài)表單模擬測(cè)試實(shí)現(xiàn)(五)。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

更多ruoyi-nbcio功能請(qǐng)看演示系統(tǒng)

gitee源代碼地址

前后端代碼: https://gitee.com/nbacheng/ruoyi-nbcio

演示地址:RuoYi-Nbcio后臺(tái)管理系統(tǒng)

更多nbcio-boot功能請(qǐng)看演示系統(tǒng)

gitee源代碼地址

后端代碼: https://gitee.com/nbacheng/nbcio-boot

前端代碼:https://gitee.com/nbacheng/nbcio-vue.git

在線演示(包括H5) : http://122.227.135.243:9888
?

接上一節(jié),今天主要處理新增一條動(dòng)態(tài)表單數(shù)據(jù)的方法

1、后端處理

/**
     * 根據(jù)主表名,關(guān)鍵字和數(shù)據(jù)動(dòng)態(tài)插入一條記錄
     * @param tableName 主表名稱
     */
    @SaCheckPermission("workflow:form:edit")
    @PostMapping(value = "/addDataById")
    public R<?> addDataById(@RequestBody FormDataVo formDataVo) {
        return R.ok(formService.addDataById(formDataVo));
    }

@Override
	public int addDataById(FormDataVo formDataVo) {
		return baseMapper.addDataById(formDataVo.getTableName(), formDataVo.getPrimaryKey(),formDataVo.getUpdateMap());
	}

int addDataById(@Param("tableName") String tableName, @Param("primaryKey") String primaryKey, @Param("insertMap") Map<String,Object> insertMap); 

<!-- 動(dòng)態(tài)插入數(shù)據(jù) -->
	<insert id="addDataById">
	   INSERT INTO ${tableName}
	   <foreach collection="insertMap" item="val" index="field"  separator="," open="(" close=")">
	        <if test="field != #{primaryKey}" >
	            ${field}
	        </if>      
	   </foreach>
	           VALUES  
	   <foreach collection="insertMap" item="val" index="key"  separator="," open="(" close=")">
	   		<if test="key != #{primaryKey}" >
	            #{val}
	        </if>          
	   </foreach>
	</insert>

2、前端處理


/** 新增按鈕操作 */
    handleAdd() {
      this.reset();
      this.open = true;
    },

// 表單重置
    reset() {
      this.form = {};
      //使用for循環(huán)向this.form中賦值
      for (let itemindex = 0; itemindex < this.columnList.length; itemindex++) {
        //$set()方法第一個(gè)參數(shù)是對(duì)象,第二個(gè)參數(shù)是key值,第三個(gè)參數(shù)是value值
        this.$set(this.form, this.columnList[itemindex].__vModel__, undefined);
      }
      this.resetForm("form");
    },

/** 提交按鈕 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          this.buttonLoading = true;
          console.log("submitForm this.form",this.form)
          const id = this.form[this.primaryKey]
          const formData = {
            tableName: this.tableName,
            primaryKey: this.primaryKey,
            id: id,
            updateMap: this.form
          }
          console.log("submitForm formData",formData)
          if ( id != null && id.length > 0 ) {
            updateDataById(formData).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            }).finally(() => {
              this.buttonLoading = false;
            });
          } else {
            addDataById(formData).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            }).finally(() => {
              this.buttonLoading = false;
            });
          }
        }
      });
    },

3、效果圖如下:

基于若依的ruoyi-nbcio流程管理系統(tǒng)一種簡(jiǎn)單的動(dòng)態(tài)表單模擬測(cè)試實(shí)現(xiàn)(五),ruoyi-nbcio,表單設(shè)計(jì)器,flowable,vue,java,ruoyi-nbcio,flowable,表單設(shè)計(jì)器

基于若依的ruoyi-nbcio流程管理系統(tǒng)一種簡(jiǎn)單的動(dòng)態(tài)表單模擬測(cè)試實(shí)現(xiàn)(五),ruoyi-nbcio,表單設(shè)計(jì)器,flowable,vue,java,ruoyi-nbcio,flowable,表單設(shè)計(jì)器文章來源地址http://www.zghlxwxcb.cn/news/detail-819869.html

到了這里,關(guān)于基于若依的ruoyi-nbcio流程管理系統(tǒng)一種簡(jiǎn)單的動(dòng)態(tài)表單模擬測(cè)試實(shí)現(xiàn)(五)的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包