Merge remote-tracking branch 'origin/master'
This commit is contained in:
+131
@@ -0,0 +1,131 @@
|
||||
package com.jero.modules.collection.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.collection.entity.OnlCgformCollection;
|
||||
import com.jero.modules.collection.service.IOnlCgformCollectionService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 我的收藏
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-02-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="我的收藏")
|
||||
@RestController
|
||||
@RequestMapping("/collection/onlCgformCollection")
|
||||
@Slf4j
|
||||
public class OnlCgformCollectionController extends JeroController<OnlCgformCollection, IOnlCgformCollectionService> {
|
||||
@Autowired
|
||||
private IOnlCgformCollectionService onlCgformCollectionService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param onlCgformCollection
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "我的收藏-分页列表查询")
|
||||
@ApiOperation(value="我的收藏-分页列表查询", notes="我的收藏-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<?> queryPageList(OnlCgformCollection onlCgformCollection,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<OnlCgformCollection> queryWrapper = QueryGenerator.initQueryWrapper(onlCgformCollection, req.getParameterMap());
|
||||
Page<OnlCgformCollection> page = new Page<OnlCgformCollection>(pageNo, pageSize);
|
||||
IPage<OnlCgformCollection> pageList = onlCgformCollectionService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "我的收藏-列表查询")
|
||||
@ApiOperation(value="我的收藏-列表查询", notes="我的收藏-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<OnlCgformCollection>> queryList(OnlCgformCollection onlCgformCollection) {
|
||||
List<OnlCgformCollection> list = onlCgformCollectionService.queryList(onlCgformCollection);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param onlCgformCollection
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "我的收藏-添加")
|
||||
@ApiOperation(value="我的收藏-添加", notes="我的收藏-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@Validated @RequestBody OnlCgformCollection onlCgformCollection) {
|
||||
onlCgformCollectionService.add(onlCgformCollection);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "我的收藏-通过id删除")
|
||||
@ApiOperation(value="我的收藏-通过id删除", notes="我的收藏-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||
onlCgformCollectionService.deleteById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "我的收藏-批量删除")
|
||||
@ApiOperation(value="我的收藏-批量删除", notes="我的收藏-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.onlCgformCollectionService.deleteByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "我的收藏-通过id查询")
|
||||
@ApiOperation(value="我的收藏-通过id查询", notes="我的收藏-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
OnlCgformCollection onlCgformCollection = onlCgformCollectionService.queryById(id);
|
||||
if(onlCgformCollection==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(onlCgformCollection);
|
||||
}
|
||||
}
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
package com.jero.modules.collection.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.jero.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.*;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 我的收藏
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-02-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("onl_cgform_collection")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="onl_cgform_collection对象", description="我的收藏")
|
||||
public class OnlCgformCollection implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String id;
|
||||
|
||||
/**收藏人*/
|
||||
@ApiModelProperty(value = "收藏人")
|
||||
private String createBy;
|
||||
|
||||
/**收藏日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "收藏日期")
|
||||
private java.util.Date createTime;
|
||||
|
||||
/**所属部门*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private String sysOrgCode;
|
||||
|
||||
/**状态*/
|
||||
@Excel(name = "状态", width = 15, dictTable = "buss_document_library", dicText = "state", dicCode = "state")
|
||||
@Dict(dictTable = "buss_document_library", dicText = "state", dicCode = "state")
|
||||
private String state;
|
||||
|
||||
/**编号*/
|
||||
@Excel(name = "编号", width = 15, dictTable = "buss_document_library", dicText = "serialNumber", dicCode = "serialNumber")
|
||||
@Dict(dictTable = "buss_document_library", dicText = "serialNumber", dicCode = "serialNumber")
|
||||
private String serialNumber;
|
||||
|
||||
/**标题*/
|
||||
@Excel(name = "标题", width = 15, dictTable = "buss_document_library", dicText = "title", dicCode = "title")
|
||||
@Dict(dictTable = "buss_document_library", dicText = "title", dicCode = "title")
|
||||
@ApiModelProperty(value = "标题")
|
||||
private String title;
|
||||
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.jero.modules.collection.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jero.modules.collection.entity.OnlCgformCollection;
|
||||
|
||||
/**
|
||||
* @Description: 我的收藏
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-02-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface OnlCgformCollectionMapper extends BaseMapper<OnlCgformCollection> {
|
||||
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jero.modules.collection.mapper.OnlCgformCollectionMapper">
|
||||
<resultMap id="OnlCgformCollectionResultMap" type="com.jero.modules.collection.entity.OnlCgformCollection">
|
||||
<id column="id" property="id" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="sys_org_code" property="sysOrgCode" />
|
||||
<result column="state" property="state" />
|
||||
<result column="serial_number" property="serialNumber" />
|
||||
<result column="title" property="title" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
package com.jero.modules.collection.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.collection.entity.OnlCgformCollection;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 我的收藏
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-02-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IOnlCgformCollectionService extends IService<OnlCgformCollection> {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param onlCgformCollection
|
||||
* @return
|
||||
*/
|
||||
void add(OnlCgformCollection onlCgformCollection);
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
void deleteById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
void deleteByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
OnlCgformCollection queryById(String id);
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<OnlCgformCollection> queryList(OnlCgformCollection onlCgformCollection);
|
||||
}
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
package com.jero.modules.collection.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.modules.collection.entity.OnlCgformCollection;
|
||||
import com.jero.modules.collection.mapper.OnlCgformCollectionMapper;
|
||||
import com.jero.modules.collection.service.IOnlCgformCollectionService;
|
||||
import com.jero.modules.tag.entity.OnlCgformArea;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 我的收藏
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-02-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class OnlCgformCollectionServiceImpl extends ServiceImpl<OnlCgformCollectionMapper, OnlCgformCollection> implements IOnlCgformCollectionService {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param onlCgformCollection
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void add(OnlCgformCollection onlCgformCollection) {
|
||||
Date now = new Date();
|
||||
onlCgformCollection.setCreateTime(now);
|
||||
save(onlCgformCollection);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public OnlCgformCollection queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<OnlCgformCollection> queryList(OnlCgformCollection onlCgformCollection) {
|
||||
LambdaQueryWrapper<OnlCgformCollection> lambdaQueryWrapper=new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(OnlCgformCollection::getCreateBy,onlCgformCollection.getCreateBy());
|
||||
return list();
|
||||
}
|
||||
}
|
||||
@@ -1,197 +1,13 @@
|
||||
<template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form-model :model="formInline" v-if="isFormInline" class="formAdd" :rules="rules" ref="ruleForm">
|
||||
|
||||
<div v-for="(val,index) in headerText" :key="index">
|
||||
<div class="header-text">
|
||||
{{val.text}}
|
||||
</div>
|
||||
<a-row :gutter="24" v-if="isDisplayType">
|
||||
<div v-for="item in val.content">
|
||||
<a-col :span="12" v-if="item.field_show_type === 'text'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.Required">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" :prop="item.db_field_name">
|
||||
<a-input class="box-input"
|
||||
:disabled="disabled"
|
||||
v-model="formInline[item.db_field_name]"
|
||||
:placeholder="'请输入'+item.db_field_txt"/>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="12" v-else-if="item.field_show_type === 'CHECKBOX'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.Required">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" :prop="item.db_field_name">
|
||||
<j-multi-select-tag class="box-input" v-model="formInline[item.db_field_name]"
|
||||
:disabled="disabled"
|
||||
:placeholder="$t('selectStatus')" :type="'checkbox'"
|
||||
:triggerChange="false" :dictCode="item.dict_field"/>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="12" v-else-if="item.field_show_type === 'date'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.Required">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" :prop="item.db_field_name">
|
||||
<a-date-picker class="box-input" v-model="formInline[item.db_field_name]"
|
||||
:disabled="disabled"
|
||||
style="width: 100%"/>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="12" v-else-if="item.field_show_type === 'SMULTITIME'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.Required">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" :prop="item.db_field_name">
|
||||
<a-range-picker class="box-input" v-model="formInline[item.db_field_name]"
|
||||
:disabled="disabled"
|
||||
@change="onChange"></a-range-picker>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="12" v-else-if="item.field_show_type === 'NUMBER'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.Required">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" :prop="item.db_field_name">
|
||||
<a-input-number class="box-input"
|
||||
:disabled="disabled"
|
||||
v-model="formInline[item.db_field_name]" :min="1" :max="99999999"/>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="12" v-else-if="item.field_show_type === 'list'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.Required">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" :prop="item.db_field_name">
|
||||
<j-dict-select-tag class="box-input" v-model="formInline[item.db_field_name]"
|
||||
:disabled="disabled"
|
||||
@input="handleInput(item.db_field_name)"
|
||||
:placeholder="$t('selectStatus')" :type="'select'"
|
||||
:triggerChange="false" :dictCode="item.dict_field"/>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="12" v-else-if="item.field_show_type === 'list_multi'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.Required">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" :prop="item.db_field_name">
|
||||
<j-multi-select-tag class="box-input" v-model="formInline[item.db_field_name]"
|
||||
:disabled="disabled"
|
||||
:placeholder="$t('selectStatus')" :type="'select'"
|
||||
:triggerChange="false" :dictCode="item.dict_field"/>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="12" v-else-if="item.field_show_type === 'RADIO'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.Required">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" :prop="item.db_field_name">
|
||||
<j-dict-select-tag v-model="formInline[item.db_field_name]"
|
||||
:disabled="disabled"
|
||||
@input="handleInput(item.db_field_name)"
|
||||
:placeholder="$t('selectStatus')"
|
||||
:type="'radio'" :triggerChange="false" :dictCode="item.dict_field"/>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="24" v-else-if="item.field_show_type === 'TEXTAREA'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.Required">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" :prop="item.db_field_name">
|
||||
<a-textarea :placeholder="$t('selectStatus')"
|
||||
:disabled="disabled"
|
||||
v-model="formInline[item.db_field_name]" :rows="4"/>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="12" v-else-if="item.field_show_type === 'file'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.Required">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" :prop="item.db_field_name">
|
||||
<a-button type="primary" class="button-text"
|
||||
@click="clickButtonToUpload(item.db_field_name)">
|
||||
{{ (formInline[item.db_field_name] === 'null' || formInline[item.db_field_name] === '' ||
|
||||
formInline[item.db_field_name] == null) ? '点击上传' : '查看已上传文件'
|
||||
}}
|
||||
</a-button>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="24" v-else-if="item.field_show_type === 'STANDARD'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.Required">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" :prop="item.db_field_name">
|
||||
<Standardselection :query="item" :disabled="disabled" v-model="formInline[item.db_field_name]"/>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
</div>
|
||||
</a-row>
|
||||
</div>
|
||||
|
||||
|
||||
<a-row :gutter="24" v-if="!isDisplayType">
|
||||
<a-row :gutter="24">
|
||||
<div v-for="(item,index) in dataList" :key="index">
|
||||
<a-col :span="12" v-if="item.field_show_type === 'text'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.Required">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" :prop="item.db_field_name">
|
||||
@@ -205,8 +21,8 @@
|
||||
<a-col :span="12" v-else-if="item.field_show_type === 'CHECKBOX'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.Required">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" :prop="item.db_field_name">
|
||||
@@ -221,8 +37,8 @@
|
||||
<a-col :span="12" v-else-if="item.field_show_type === 'date'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.Required">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" :prop="item.db_field_name">
|
||||
@@ -236,8 +52,8 @@
|
||||
<a-col :span="12" v-else-if="item.field_show_type === 'SMULTITIME'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.Required">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" :prop="item.db_field_name">
|
||||
@@ -251,8 +67,8 @@
|
||||
<a-col :span="12" v-else-if="item.field_show_type === 'NUMBER'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.Required">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" :prop="item.db_field_name">
|
||||
@@ -266,8 +82,8 @@
|
||||
<a-col :span="12" v-else-if="item.field_show_type === 'list'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.Required">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" :prop="item.db_field_name">
|
||||
@@ -282,8 +98,8 @@
|
||||
<a-col :span="12" v-else-if="item.field_show_type === 'list_multi'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.Required">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" :prop="item.db_field_name">
|
||||
@@ -298,8 +114,8 @@
|
||||
<a-col :span="12" v-else-if="item.field_show_type === 'RADIO'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.Required">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" :prop="item.db_field_name">
|
||||
@@ -313,8 +129,8 @@
|
||||
<a-col :span="24" v-else-if="item.field_show_type === 'TEXTAREA'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.Required">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" :prop="item.db_field_name">
|
||||
@@ -325,15 +141,15 @@
|
||||
</div>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="24" v-else-if="item.field_show_type === 'file'">
|
||||
<a-col :span="12" v-else-if="item.field_show_type === 'file'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.Required">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" :prop="item.db_field_name">
|
||||
<a-button type="primary" style="height: 38px;width: calc(50% - 80px);line-height: 38px"
|
||||
<a-button type="primary" class="button-text"
|
||||
@click="clickButtonToUpload(item.db_field_name)">
|
||||
{{ (formInline[item.db_field_name] === 'null' || formInline[item.db_field_name] === '' ||
|
||||
formInline[item.db_field_name] == null) ? '点击上传' : '查看已上传文件'
|
||||
@@ -346,8 +162,8 @@
|
||||
<a-col :span="24" v-else-if="item.field_show_type === 'STANDARD'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.Required">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" :prop="item.db_field_name">
|
||||
@@ -383,10 +199,6 @@
|
||||
type: Object,
|
||||
default: {}
|
||||
},
|
||||
isDisplayType: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
flag: {
|
||||
type: String,
|
||||
default: ''
|
||||
@@ -410,27 +222,13 @@
|
||||
sm: { span: 17 }
|
||||
},
|
||||
dataList: [],
|
||||
ruleList: [],
|
||||
validatorRules: {},
|
||||
confirmLoading: false,
|
||||
uploadName: '',
|
||||
headerText: [
|
||||
{
|
||||
text: '基本信息',
|
||||
content: []
|
||||
},
|
||||
{
|
||||
text: '文本信息',
|
||||
content: []
|
||||
},
|
||||
{
|
||||
text: '关联信息',
|
||||
content: []
|
||||
}
|
||||
]
|
||||
uploadName: ''
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.IntegrateData()
|
||||
this.getForm()
|
||||
},
|
||||
methods: {
|
||||
@@ -484,46 +282,47 @@
|
||||
IntegrateData() {
|
||||
this.isFormInline = false
|
||||
let rules = {}
|
||||
this.dataList.forEach((res, index) => {
|
||||
this.ruleList.forEach((res, index) => {
|
||||
const rule = []
|
||||
if (res.Required) {
|
||||
if (res.field_must_input == 0) {
|
||||
if (res.field_show_type === 'text') {
|
||||
rule.push({
|
||||
required: true,
|
||||
message: res.name + '不能为空',
|
||||
message: res.db_field_txt + '不能为空',
|
||||
trigger: 'blur'
|
||||
})
|
||||
} else if (res.field_show_type === 'CHECKBOX' || res.field_show_type === 'list_multi' ||
|
||||
res.field_show_type === 'date' || res.field_show_type === 'file') {
|
||||
rule.push({
|
||||
required: true,
|
||||
message: res.name + '不能为空',
|
||||
message: res.db_field_txt + '不能为空',
|
||||
trigger: 'change'
|
||||
})
|
||||
} else if (res.field_show_type === 'NUMBER') {
|
||||
rule.push({
|
||||
required: true,
|
||||
message: res.name + '不能为空',
|
||||
message: res.db_field_txt + '不能为空',
|
||||
trigger: 'blur'
|
||||
})
|
||||
} else if (res.field_show_type === 'TEXTAREA') {
|
||||
rule.push({
|
||||
required: true,
|
||||
message: res.name + '不能为空',
|
||||
message: res.db_field_txt + '不能为空',
|
||||
trigger: 'blur'
|
||||
})
|
||||
} else if (res.field_show_type === 'RADIO' || res.field_show_type === 'list') {
|
||||
rule.push({
|
||||
required: true,
|
||||
message: res.name + '不能为空',
|
||||
message: res.db_field_txt + '不能为空',
|
||||
trigger: 'change'
|
||||
})
|
||||
}
|
||||
}
|
||||
if (rule.length > 0) {
|
||||
rules[res.attrModel] = rule
|
||||
rules[res.db_field_name] = rule
|
||||
}
|
||||
})
|
||||
console.log(rules)
|
||||
this.$set(this, 'rules', rules)
|
||||
this.isFormInline = true
|
||||
this.confirmLoading = false
|
||||
@@ -536,19 +335,20 @@
|
||||
getAction(this.url.getAddForm, params).then((res) => {
|
||||
if (res.success) {
|
||||
this.dataList = res.result
|
||||
this.ruleList = res.result
|
||||
this.IntegrateData()
|
||||
if (this.isDisplayType) {
|
||||
this.headerText.forEach((res) => {
|
||||
res.content = []
|
||||
this.dataList.forEach(val => {
|
||||
if (res.text === val.area) {
|
||||
res.content.push(val)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
edit(item) {
|
||||
getAction(this.url.getDocumentInfo, { id: item.id }).then((res) => {
|
||||
if (res.success) {
|
||||
this.formInline = res.result[0]
|
||||
}
|
||||
})
|
||||
},
|
||||
add(){
|
||||
this.formInline = {}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -655,7 +455,8 @@
|
||||
.formAdd {
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
.button-text{
|
||||
|
||||
.button-text {
|
||||
height: 38px;
|
||||
width: calc(100% - 120px);
|
||||
line-height: 38px;
|
||||
|
||||
@@ -0,0 +1,253 @@
|
||||
<template>
|
||||
<a-drawer
|
||||
:title="title"
|
||||
:maskClosable="true"
|
||||
:width="drawerWidth"
|
||||
placement="right"
|
||||
:closable="true"
|
||||
@close="handleCancel"
|
||||
:visible="visible"
|
||||
style="height: 100%;overflow: auto;padding-bottom: 53px;">
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<div v-for="(item,index) in searchList" :key="index" style="line-height: 48px;display: inline-block">
|
||||
<div class="box-title-text" v-if="item.field_show_type == 'text'">
|
||||
<div class="title-text" :title="item.db_field_txt">
|
||||
{{item.db_field_txt}}
|
||||
</div>
|
||||
<a-input class="box-input" :placeholder="item.placeholder"
|
||||
v-model="queryParam[item.db_field_name]"></a-input>
|
||||
</div>
|
||||
<div class="box-title-text" v-else-if="item.field_show_type == 'list_multi'">
|
||||
<div class="title-text" :title="item.db_field_txt">
|
||||
<span>{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<j-multi-select-tag class="box-input" v-model="queryParam[item.db_field_name]"
|
||||
:placeholder="$t('selectStatus')" :type="'select'"
|
||||
:triggerChange="false" :dictCode="item.dict_field"/>
|
||||
</div>
|
||||
<div class="box-title-text" v-else-if="item.field_show_type == 'date'">
|
||||
<div class="title-text" :title="item.db_field_txt">
|
||||
<span>{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-date-picker class="box-input" v-model="queryParam[item.db_field_name]"/>
|
||||
</div>
|
||||
<div class="box-title-text" v-else-if="item.field_show_type == 'list'">
|
||||
<div class="title-text" :title="item.db_field_txt">
|
||||
{{item.db_field_txt}}
|
||||
</div>
|
||||
<j-dict-select-tag class="box-input" v-model="queryParam[item.db_field_name]"
|
||||
:placeholder="$t('selectStatus')" :type="'select'"
|
||||
:triggerChange="false" :dictCode="item.dict_field"/>
|
||||
</div>
|
||||
</div>
|
||||
<span class="table-page-search-submitButtons button">
|
||||
<a-button class="box-button" type="primary" @click="searchQuery">{{$t('query')}}</a-button>
|
||||
<a-button class="box-button" style="margin-left: 8px" @click="searchReset">{{$t('reset')}}</a-button>
|
||||
</span>
|
||||
</a-form>
|
||||
<div style="height: 100%">
|
||||
<div class="box">
|
||||
<a-table
|
||||
v-if="visible"
|
||||
class="table"
|
||||
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
||||
:columns="columns"
|
||||
:pagination="false"
|
||||
:data-source="dataSource"
|
||||
:loading="loading"
|
||||
>
|
||||
</a-table>
|
||||
</div>
|
||||
<div class="page" v-if="dataSource.length > 0">
|
||||
<a-pagination
|
||||
:show-total="total => `共 ${total} 条`"
|
||||
show-quick-jumper
|
||||
show-size-changer
|
||||
:page-size.sync="pageSize"
|
||||
:total="total"
|
||||
@change="onChange"
|
||||
@showSizeChange="SizeChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drawer-bootom-button">
|
||||
<a-button style="margin-right: .8rem" @click="handleCancel">{{$t('cancel')}}</a-button>
|
||||
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button>
|
||||
</div>
|
||||
</a-drawer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getAction } from '@/api/manage'
|
||||
export default {
|
||||
name: 'index',
|
||||
props:{
|
||||
url: {
|
||||
type: Object,
|
||||
default: {}
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '调取已入库文件',
|
||||
drawerWidth: 800,
|
||||
visible: false,
|
||||
confirmLoading: false,
|
||||
queryParam: {},
|
||||
selectedRowKeys: [],
|
||||
searchList: [
|
||||
{
|
||||
field_show_type: 'text',
|
||||
db_field_name: 'name',
|
||||
db_field_txt: '标题'
|
||||
},
|
||||
{
|
||||
field_show_type: 'text',
|
||||
db_field_name: 'name',
|
||||
db_field_txt: '标题'
|
||||
},
|
||||
{
|
||||
field_show_type: 'text',
|
||||
db_field_name: 'name',
|
||||
db_field_txt: '标题dsfdsfds'
|
||||
},
|
||||
{
|
||||
field_show_type: 'text',
|
||||
db_field_name: 'name',
|
||||
db_field_txt: '标题1111'
|
||||
}
|
||||
],
|
||||
columns: [],
|
||||
dataSource: [],
|
||||
loading: false,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
pageNo: 1
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
watch:{
|
||||
visible:function(val) {
|
||||
if (val){
|
||||
this.queryParam = {}
|
||||
this.getData()
|
||||
this.getTableList()
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleCancel() {
|
||||
this.visible = false
|
||||
},
|
||||
handleSubmit() {
|
||||
|
||||
},
|
||||
searchQuery() {
|
||||
this.getTableList()
|
||||
},
|
||||
searchReset() {
|
||||
this.queryParam = {}
|
||||
this.getTableList()
|
||||
},
|
||||
onSelectChange() {
|
||||
|
||||
},
|
||||
SizeChange(page, pageSize) {
|
||||
this.pageSize = pageSize
|
||||
this.getTableList()
|
||||
},
|
||||
onChange(page, pageSize) {
|
||||
this.pageNo = page
|
||||
this.getTableList()
|
||||
},
|
||||
getData() {
|
||||
let params = {
|
||||
flag:'1',
|
||||
}
|
||||
getAction(this.url.tableHeader, params).then((res) => {
|
||||
if (res.success) {
|
||||
var jsonHead = res.result
|
||||
this.columns = []
|
||||
jsonHead.forEach(res => {
|
||||
this.columns.push({
|
||||
title: res.db_field_txt,
|
||||
dataIndex: res.db_field_name,
|
||||
align: 'center'
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getTableList() {
|
||||
let params = {
|
||||
...this.queryParam,
|
||||
pageNo: this.pageNo,
|
||||
pageSize: this.pageSize
|
||||
}
|
||||
this.loading = true
|
||||
getAction(this.url.tableList, params).then((res) => {
|
||||
if (res.success) {
|
||||
this.dataSource = res.result.records
|
||||
this.total = res.result.total
|
||||
this.loading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.box-title-text {
|
||||
line-height: 1.4;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.title-text {
|
||||
width: 50px;
|
||||
display: inline-block;
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
margin-right: 16px;
|
||||
margin-top: 3px;
|
||||
text-align: right;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.box-input {
|
||||
display: inline-block;
|
||||
width: 70%;
|
||||
height: 38px;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.box-button {
|
||||
height: 38px;
|
||||
}
|
||||
|
||||
.drawer-bootom-button {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
border-top: 1px solid #e8e8e8;
|
||||
padding: 10px 16px;
|
||||
text-align: right;
|
||||
left: 0;
|
||||
background: #fff;
|
||||
border-radius: 0 0 2px 2px;
|
||||
}
|
||||
|
||||
.button {
|
||||
margin-left: 18px;
|
||||
}
|
||||
.page {
|
||||
text-align: right;
|
||||
margin-top: 20px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,500 @@
|
||||
<template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form-model :model="formInline" v-if="isFormInline" class="formAdd" :rules="rules" ref="ruleForm">
|
||||
|
||||
<div v-for="(val,index) in headerText" :key="index">
|
||||
<div class="header-text">
|
||||
{{val.text}}
|
||||
</div>
|
||||
<a-row :gutter="24">
|
||||
<div v-for="item in val.content">
|
||||
<a-col :span="12" v-if="item.field_show_type === 'text'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" :prop="item.db_field_name">
|
||||
<a-input class="box-input"
|
||||
:disabled="disabled"
|
||||
v-model="formInline[item.db_field_name]"
|
||||
:placeholder="'请输入'+item.db_field_txt"/>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="12" v-else-if="item.field_show_type === 'CHECKBOX'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" :prop="item.db_field_name">
|
||||
<j-multi-select-tag class="box-input" v-model="formInline[item.db_field_name]"
|
||||
:disabled="disabled"
|
||||
:placeholder="$t('selectStatus')" :type="'checkbox'"
|
||||
:triggerChange="false" :dictCode="item.dict_field"/>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="12" v-else-if="item.field_show_type === 'date'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" :prop="item.db_field_name">
|
||||
<a-date-picker class="box-input" v-model="formInline[item.db_field_name]"
|
||||
:disabled="disabled"
|
||||
style="width: 100%"/>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="12" v-else-if="item.field_show_type === 'SMULTITIME'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" :prop="item.db_field_name">
|
||||
<a-range-picker class="box-input" v-model="formInline[item.db_field_name]"
|
||||
:disabled="disabled"
|
||||
@change="onChange"></a-range-picker>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="12" v-else-if="item.field_show_type === 'NUMBER'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" :prop="item.db_field_name">
|
||||
<a-input-number class="box-input"
|
||||
:disabled="disabled"
|
||||
v-model="formInline[item.db_field_name]" :min="1" :max="99999999"/>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="12" v-else-if="item.field_show_type === 'list'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" :prop="item.db_field_name">
|
||||
<j-dict-select-tag class="box-input" v-model="formInline[item.db_field_name]"
|
||||
:disabled="disabled"
|
||||
@input="handleInput(item.db_field_name)"
|
||||
:placeholder="$t('selectStatus')" :type="'select'"
|
||||
:triggerChange="false" :dictCode="item.dict_field"/>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="12" v-else-if="item.field_show_type === 'list_multi'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" :prop="item.db_field_name">
|
||||
<j-multi-select-tag class="box-input" v-model="formInline[item.db_field_name]"
|
||||
:disabled="disabled"
|
||||
:placeholder="$t('selectStatus')" :type="'select'"
|
||||
:triggerChange="false" :dictCode="item.dict_field"/>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="12" v-else-if="item.field_show_type === 'RADIO'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" :prop="item.db_field_name">
|
||||
<j-dict-select-tag v-model="formInline[item.db_field_name]"
|
||||
:disabled="disabled"
|
||||
@input="handleInput(item.db_field_name)"
|
||||
:placeholder="$t('selectStatus')"
|
||||
:type="'radio'" :triggerChange="false" :dictCode="item.dict_field"/>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="24" v-else-if="item.field_show_type === 'TEXTAREA'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" :prop="item.db_field_name">
|
||||
<a-textarea :placeholder="$t('selectStatus')"
|
||||
:disabled="disabled"
|
||||
v-model="formInline[item.db_field_name]" :rows="4"/>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="12" v-else-if="item.field_show_type === 'file'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" :prop="item.db_field_name">
|
||||
<a-button type="primary" class="button-text"
|
||||
@click="clickButtonToUpload(item.db_field_name)">
|
||||
{{ (formInline[item.db_field_name] === 'null' || formInline[item.db_field_name] === '' ||
|
||||
formInline[item.db_field_name] == null) ? '点击上传' : '查看已上传文件'
|
||||
}}
|
||||
</a-button>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="24" v-else-if="item.field_show_type === 'STANDARD'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" :prop="item.db_field_name">
|
||||
<Standardselection :query="item" :disabled="disabled" v-model="formInline[item.db_field_name]"/>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
</div>
|
||||
</a-row>
|
||||
</div>
|
||||
<uploadFile ref="uploadFile" :disabled="disabled" @uploadSuccess="uploadSuccess"></uploadFile>
|
||||
</a-form-model>
|
||||
</a-spin>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uploadFile from '@/components/uploadFile/file'
|
||||
import Standardselection from '@/components/Standardselection/index'
|
||||
import { getAction, postAction } from '@/api/manage'
|
||||
import eventBUs from '../../common/event'
|
||||
|
||||
export default {
|
||||
name: 'index',
|
||||
components: {
|
||||
uploadFile,
|
||||
Standardselection
|
||||
},
|
||||
props: {
|
||||
url: {
|
||||
type: Object,
|
||||
default: {}
|
||||
},
|
||||
flag: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formInline: {},
|
||||
isFormInline: false,
|
||||
rules: {},
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 6 }
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 17 }
|
||||
},
|
||||
dataList: [],
|
||||
ruleList: [],
|
||||
validatorRules: {},
|
||||
confirmLoading: false,
|
||||
uploadName: '',
|
||||
headerText: [
|
||||
{
|
||||
text: '基本信息',
|
||||
content: []
|
||||
},
|
||||
{
|
||||
text: '文本信息',
|
||||
content: []
|
||||
},
|
||||
{
|
||||
text: '关联信息',
|
||||
content: []
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getForm()
|
||||
},
|
||||
methods: {
|
||||
sumber() {
|
||||
this.$refs.ruleForm.validate(valid => {
|
||||
if (valid) {
|
||||
let url = ''
|
||||
if (this.formInline.id) {
|
||||
url = this.url.updateInfo
|
||||
} else {
|
||||
url = this.url.addInfo
|
||||
}
|
||||
let formInline = JSON.parse(JSON.stringify(this.formInline))
|
||||
Object.keys(formInline).forEach(res => {
|
||||
if (formInline[res] instanceof Array) {
|
||||
formInline[res] = formInline[res].join(',')
|
||||
}
|
||||
})
|
||||
postAction(url, formInline).then((res) => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
eventBUs.$emit('searchReset')
|
||||
this.$emit('addFormClick')
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
onChange(date, dateString) {
|
||||
console.log(date, dateString)
|
||||
},
|
||||
clickButtonToUpload(current) {
|
||||
this.$refs.uploadFile.visible = true
|
||||
this.uploadName = current
|
||||
},
|
||||
/** 上传文件的回调 */
|
||||
uploadSuccess(data) {
|
||||
console.log(data)
|
||||
let attIdList = []
|
||||
data.map(item => {
|
||||
attIdList.push(item.id || data.name)
|
||||
})
|
||||
/** 赋值给当前对应的表单文件 */
|
||||
this.formInline[this.uploadName] = attIdList.join(',')
|
||||
this.formInline = { ...this.formInline }
|
||||
},
|
||||
handleInput(value) {
|
||||
this.$nextTick(() => {
|
||||
this.formInline = { ...this.formInline }
|
||||
this.$refs.ruleForm.validateField([value])
|
||||
})
|
||||
},
|
||||
IntegrateData() {
|
||||
this.isFormInline = false
|
||||
let rules = {}
|
||||
this.ruleList.forEach((res, index) => {
|
||||
const rule = []
|
||||
if (res.field_must_input == 0) {
|
||||
if (res.field_show_type === 'text') {
|
||||
rule.push({
|
||||
required: true,
|
||||
message: res.db_field_txt + '不能为空',
|
||||
trigger: 'blur'
|
||||
})
|
||||
} else if (res.field_show_type === 'CHECKBOX' || res.field_show_type === 'list_multi' ||
|
||||
res.field_show_type === 'date' || res.field_show_type === 'file') {
|
||||
rule.push({
|
||||
required: true,
|
||||
message: res.db_field_txt + '不能为空',
|
||||
trigger: 'change'
|
||||
})
|
||||
} else if (res.field_show_type === 'NUMBER') {
|
||||
rule.push({
|
||||
required: true,
|
||||
message: res.db_field_txt + '不能为空',
|
||||
trigger: 'blur'
|
||||
})
|
||||
} else if (res.field_show_type === 'TEXTAREA') {
|
||||
rule.push({
|
||||
required: true,
|
||||
message: res.db_field_txt + '不能为空',
|
||||
trigger: 'blur'
|
||||
})
|
||||
} else if (res.field_show_type === 'RADIO' || res.field_show_type === 'list') {
|
||||
rule.push({
|
||||
required: true,
|
||||
message: res.db_field_txt + '不能为空',
|
||||
trigger: 'change'
|
||||
})
|
||||
}
|
||||
}
|
||||
if (rule.length > 0) {
|
||||
rules[res.db_field_name] = rule
|
||||
}
|
||||
})
|
||||
this.$set(this, 'rules', rules)
|
||||
this.isFormInline = true
|
||||
this.confirmLoading = false
|
||||
},
|
||||
getForm() {
|
||||
this.confirmLoading = true
|
||||
let params = {
|
||||
flag: this.flag
|
||||
}
|
||||
getAction(this.url.getAddForm, params).then((res) => {
|
||||
if (res.success) {
|
||||
this.dataList = res.result
|
||||
this.ruleList = res.result
|
||||
this.IntegrateData()
|
||||
this.headerText.forEach((res) => {
|
||||
res.content = []
|
||||
this.dataList.forEach(val => {
|
||||
if (res.text === val.area) {
|
||||
res.content.push(val)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
edit(item) {
|
||||
getAction(this.url.getDocumentInfo, { id: item.id }).then((res) => {
|
||||
if (res.success) {
|
||||
this.formInline = res.result[0]
|
||||
}
|
||||
})
|
||||
},
|
||||
add(){
|
||||
this.formInline = {}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.formAdd .ant-form-item-label {
|
||||
width: 130px;
|
||||
}
|
||||
|
||||
.formAdd .ant-form-item-control-wrapper {
|
||||
display: inline-block;
|
||||
width: calc(100% - 130px);
|
||||
}
|
||||
|
||||
/*.formAdd .ant-form-item {*/
|
||||
/* margin-bottom: 20px;*/
|
||||
/*}*/
|
||||
|
||||
.itemModel .ant-form-item-control-wrapper {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.box-input .ant-select-selection--single {
|
||||
height: 38px;
|
||||
}
|
||||
|
||||
.box-input .ant-select-selection--multiple {
|
||||
height: 38px;
|
||||
}
|
||||
|
||||
.box-input .ant-select-selection__rendered {
|
||||
line-height: 38px;
|
||||
height: 38px;
|
||||
}
|
||||
|
||||
.box-input .ant-select-selection--multiple .ant-select-selection__rendered > ul > li {
|
||||
margin-top: 6px;
|
||||
}
|
||||
|
||||
.box-input .ant-calendar-picker {
|
||||
line-height: 38px;
|
||||
height: 38px;
|
||||
}
|
||||
|
||||
.box-input .ant-calendar-picker-input {
|
||||
height: 38px;
|
||||
}
|
||||
|
||||
.box-input .ant-input-number-input-wrap {
|
||||
line-height: 38px;
|
||||
height: 38px;
|
||||
}
|
||||
</style>
|
||||
<style scoped>
|
||||
.box-title-text {
|
||||
line-height: 1.4;
|
||||
display: flex;
|
||||
/*align-items: center;*/
|
||||
}
|
||||
|
||||
.title-text {
|
||||
width: 114px;
|
||||
text-align: right;
|
||||
display: inline-block;
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
margin-right: 16px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.box-input {
|
||||
display: inline-block;
|
||||
height: 38px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.itemModel {
|
||||
width: calc(100% - 130px);
|
||||
display: inline-block;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.Required {
|
||||
color: red;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.title-text-text {
|
||||
margin-top: 11px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.header-text {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
margin-left: 15px;
|
||||
/*border-bottom: 1px #d9d9d9 dashed;*/
|
||||
height: 30px;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.formAdd {
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
|
||||
.button-text {
|
||||
height: 38px;
|
||||
width: calc(100% - 120px);
|
||||
line-height: 38px;
|
||||
background: #fff;
|
||||
border: 1px #00B3BE solid;
|
||||
color: #00B3BE;
|
||||
}
|
||||
</style>
|
||||
@@ -5,7 +5,7 @@
|
||||
<template v-if="index < 2">
|
||||
<div class="box-title-text" v-if="item.field_show_type == 'text'">
|
||||
<div class="title-text">
|
||||
<!-- <span>{{item.db_field_en_name}}</span><br>-->
|
||||
<!-- <span>{{item.db_field_en_name}}</span><br>-->
|
||||
<span>{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-input class="box-input" :placeholder="item.placeholder"
|
||||
@@ -13,7 +13,7 @@
|
||||
</div>
|
||||
<div class="box-title-text" v-else-if="item.field_show_type == 'list_multi'">
|
||||
<div class="title-text">
|
||||
<!-- <span>{{item.db_field_en_name}}</span><br>-->
|
||||
<!-- <span>{{item.db_field_en_name}}</span><br>-->
|
||||
<span>{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<j-multi-select-tag class="box-input" v-model="queryParam[item.db_field_name]"
|
||||
@@ -22,14 +22,14 @@
|
||||
</div>
|
||||
<div class="box-title-text" v-else-if="item.field_show_type == 'date'">
|
||||
<div class="title-text">
|
||||
<!-- <span>{{item.db_field_en_name}}</span><br>-->
|
||||
<!-- <span>{{item.db_field_en_name}}</span><br>-->
|
||||
<span>{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-date-picker class="box-input" v-model="queryParam[item.db_field_name]"/>
|
||||
</div>
|
||||
<div class="box-title-text" v-else-if="item.field_show_type == 'list'">
|
||||
<div class="title-text">
|
||||
<!-- <span>{{item.db_field_en_name}}</span><br>-->
|
||||
<!-- <span>{{item.db_field_en_name}}</span><br>-->
|
||||
<span>{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<j-dict-select-tag class="box-input" v-model="queryParam[item.db_field_name]"
|
||||
@@ -40,7 +40,7 @@
|
||||
<template v-if="toggleSearchStatus && index >= 2">
|
||||
<div class="box-title-text" v-if="item.field_show_type == 'text'">
|
||||
<div class="title-text">
|
||||
<!-- <span>{{item.db_field_en_name}}</span><br>-->
|
||||
<!-- <span>{{item.db_field_en_name}}</span><br>-->
|
||||
<span>{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-input class="box-input" :placeholder="item.placeholder"
|
||||
@@ -48,7 +48,7 @@
|
||||
</div>
|
||||
<div class="box-title-text" v-else-if="item.field_show_type == 'list_multi'">
|
||||
<div class="title-text">
|
||||
<!-- <span>{{item.db_field_en_name}}</span><br>-->
|
||||
<!-- <span>{{item.db_field_en_name}}</span><br>-->
|
||||
<span>{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<j-multi-select-tag class="box-input" v-model="queryParam[item.db_field_name]"
|
||||
@@ -57,14 +57,14 @@
|
||||
</div>
|
||||
<div class="box-title-text" v-else-if="item.field_show_type == 'date'">
|
||||
<div class="title-text">
|
||||
<!-- <span>{{item.db_field_en_name}}</span><br>-->
|
||||
<!-- <span>{{item.db_field_en_name}}</span><br>-->
|
||||
<span>{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-date-picker class="box-input" v-model="queryParam[item.db_field_name]"/>
|
||||
</div>
|
||||
<div class="box-title-text" v-else-if="item.field_show_type == 'list'">
|
||||
<div class="title-text">
|
||||
<!-- <span>{{item.db_field_en_name}}</span><br>-->
|
||||
<!-- <span>{{item.db_field_en_name}}</span><br>-->
|
||||
<span>{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<j-dict-select-tag class="box-input" v-model="queryParam[item.db_field_name]"
|
||||
@@ -106,8 +106,8 @@
|
||||
data() {
|
||||
return {
|
||||
queryParam: {},
|
||||
toggleSearchStatus:false,
|
||||
searchList:[],
|
||||
toggleSearchStatus: false,
|
||||
searchList: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -131,9 +131,9 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
handleToggleSearch(){
|
||||
this.toggleSearchStatus = !this.toggleSearchStatus
|
||||
},
|
||||
handleToggleSearch() {
|
||||
this.toggleSearchStatus = !this.toggleSearchStatus
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -166,6 +166,6 @@
|
||||
|
||||
.box-button {
|
||||
height: 38px;
|
||||
margin-top: 2px;
|
||||
/*margin-top: 2px;*/
|
||||
}
|
||||
</style>
|
||||
@@ -46,15 +46,15 @@
|
||||
type: Array,
|
||||
default: []
|
||||
},
|
||||
//是否显示操作;默认显示
|
||||
isOperation: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
flag: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
//是否显示操作;默认不显示
|
||||
showAction:{
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -99,12 +99,14 @@
|
||||
align: 'center'
|
||||
})
|
||||
})
|
||||
this.columns.push({
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
fixed: 'right',
|
||||
scopedSlots: { customRender: 'operation' }
|
||||
})
|
||||
if (this.showAction){
|
||||
this.columns.push({
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
fixed: 'right',
|
||||
scopedSlots: { customRender: 'operation' }
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -136,7 +138,7 @@
|
||||
},
|
||||
OperationClick(ol, item) {
|
||||
this.$emit(ol.ClickEvent, item)
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
@editTable="editTable"
|
||||
@deleteTable="deleteTable"
|
||||
:url="url"
|
||||
showAction
|
||||
@Collection="Collection"
|
||||
@subscribe="subscribe"
|
||||
/>
|
||||
@@ -28,6 +29,11 @@
|
||||
:url="url"
|
||||
:flag="'1'"
|
||||
/>
|
||||
<frameAssembly
|
||||
:url="url"
|
||||
ref="frameAssemblyRef"
|
||||
/>
|
||||
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
@@ -35,14 +41,15 @@
|
||||
import search from '@/components/search/index'
|
||||
import tableData from '@/components/tableDate/index'
|
||||
import addForm from './modules/addForm'
|
||||
|
||||
import frameAssembly from '@/components/frameAssembly/index'
|
||||
|
||||
export default {
|
||||
name: 'docLibrary',
|
||||
components: {
|
||||
search,
|
||||
addForm,
|
||||
tableData
|
||||
tableData,
|
||||
frameAssembly
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -74,7 +81,7 @@
|
||||
addInfo:'document/bussDocumentLibraryEO/addInfo', //新增
|
||||
updateInfo:'document/bussDocumentLibraryEO/updateInfo', //编辑
|
||||
getDocumentInfo:'document/bussDocumentLibraryEO/getDocumentInfoById', //查看
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -97,6 +104,9 @@
|
||||
|
||||
},
|
||||
handleCompare() {
|
||||
this.$nextTick(()=>{
|
||||
this.$refs.frameAssemblyRef.visible = true
|
||||
})
|
||||
// this.$refs.addFormRef.add()
|
||||
},
|
||||
handleFileImport(){
|
||||
@@ -104,8 +114,7 @@
|
||||
},
|
||||
//编辑按钮
|
||||
editTable(val) {
|
||||
this.$refs.addFormRef.edit()
|
||||
console.log(val)
|
||||
this.$refs.addFormRef.edit(val)
|
||||
},
|
||||
//删除按钮
|
||||
deleteTable(val){
|
||||
|
||||
@@ -12,22 +12,18 @@
|
||||
ref="addFormDataRef"
|
||||
@addFormClick="addFormClick"
|
||||
:flag="'1'"
|
||||
isDisplayType
|
||||
v-if="visible"
|
||||
:url="url"
|
||||
/>
|
||||
<div class="drawer-bootom-button">
|
||||
<a-popconfirm :title="$t('AreYouWantDiscardEditing')" @confirm="handleCancel" :okText="$t('determine')"
|
||||
:cancelText="$t('cancel')">
|
||||
<a-button style="margin-right: .8rem">{{$t('cancel')}}</a-button>
|
||||
</a-popconfirm>
|
||||
<a-button style="margin-right: .8rem" @click="handleCancel">{{$t('cancel')}}</a-button>
|
||||
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button>
|
||||
</div>
|
||||
</a-drawer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import addFormData from '@/components/addForm/index'
|
||||
import addFormData from '@/components/libraryAddForm/index'
|
||||
|
||||
export default {
|
||||
name: 'docLibraryAddForm',
|
||||
@@ -36,15 +32,15 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '添加',
|
||||
title: '新增',
|
||||
drawerWidth: 900,
|
||||
visible: false,
|
||||
confirmLoading: false,
|
||||
isDisplayType:false,
|
||||
dataList:[]
|
||||
isDisplayType: false,
|
||||
dataList: []
|
||||
}
|
||||
},
|
||||
props:{
|
||||
props: {
|
||||
flag: {
|
||||
type: String,
|
||||
default: ''
|
||||
@@ -53,7 +49,7 @@
|
||||
url: {
|
||||
type: Object,
|
||||
default: {}
|
||||
},
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
@@ -63,17 +59,25 @@
|
||||
this.visible = false
|
||||
},
|
||||
add() {
|
||||
this.title = '新增'
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addFormDataRef.add()
|
||||
})
|
||||
},
|
||||
edit() {
|
||||
edit(item) {
|
||||
this.title = '编辑'
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addFormDataRef.edit(item)
|
||||
})
|
||||
},
|
||||
handleSubmit() {
|
||||
this.$refs.addFormDataRef.sumber()
|
||||
},
|
||||
addFormClick(){
|
||||
addFormClick() {
|
||||
this.visible = false
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,90 +1,101 @@
|
||||
<template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<j-form-container :disabled="formDisabled">
|
||||
<a-form :form="form" slot="detail">
|
||||
<!-- <a-spin :spinning="confirmLoading">-->
|
||||
<!-- <j-form-container :disabled="formDisabled">-->
|
||||
<div class="form-tag">
|
||||
<a-form>
|
||||
<a-form-model
|
||||
class="tag-content"
|
||||
:model="form"
|
||||
:rules="validatorRules"
|
||||
ref="tagEditForm"
|
||||
:label-col="labelCol"
|
||||
:wrapper-col="wrapperCol"
|
||||
>
|
||||
<a-row>
|
||||
<p class="tag-info">基本信息</p>
|
||||
<a-divider dashed />
|
||||
<a-col :span="24">
|
||||
<a-form-item label="所属模块" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<j-dict-select-tag type="list" v-decorator="['isModel', validatorRules.isModel]" :trigger-change="true" dictCode="module" placeholder="请选择所属模块" />
|
||||
</a-form-item>
|
||||
<a-form-model-item label="所属模块" prop="isModel">
|
||||
<j-dict-select-tag type="list" v-model="form.isModel" dictCode="module" placeholder="请选择所属模块" />
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="属性名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input v-decorator="['dbFieldTxt', validatorRules.dbFieldTxt]" placeholder="请输入属性名称" :maxLength="120" ></a-input>
|
||||
</a-form-item>
|
||||
<a-form-model-item label="属性名称" prop="dbFieldTxt">
|
||||
<a-input v-model="form.dbFieldTxt" placeholder="请输入属性名称" :maxLength="120" ></a-input>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="英文名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input v-decorator="['dbFieldName', validatorRules.dbFieldName]" placeholder="请输入英文名称" :maxLength="120" ></a-input>
|
||||
</a-form-item>
|
||||
<a-form-model-item label="英文名称" prop="dbFieldName">
|
||||
<a-input v-model="form.dbFieldName" placeholder="请输入英文名称" :maxLength="120" ></a-input>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="属性类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<j-dict-select-tag type="list" v-decorator="['fieldShowType', validatorRules.fieldShowType]" :trigger-change="true" dictCode="attribute_type" placeholder="请选择属性类型" />
|
||||
</a-form-item>
|
||||
<a-form-model-item label="属性类型" prop="fieldShowType">
|
||||
<j-dict-select-tag type="list" v-model="form.fieldShowType" dictCode="attribute_type" placeholder="请选择属性类型" />
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24" v-if="isTagContent">
|
||||
<a-form-item label="选项内容" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<j-dict-select-tag type="list" v-decorator="['dictName', validatorRules.dictName]" :trigger-change="true" dictCode="sys_dict,选项内容,dict_name" placeholder="请选择选项内容" />
|
||||
</a-form-item>
|
||||
<a-form-model-item label="选项内容" prop="dictName">
|
||||
<j-dict-select-tag type="list" v-model="form.dictName" dictCode="" placeholder="请选择选项内容" />
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="字段长度" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input-number v-decorator="['dbLength', validatorRules.dbLength]" :min="1" :max="200" placeholder="请输入字段长度" style="width: 100%" :formatter="limitNumber" :parser="limitNumber" />
|
||||
</a-form-item>
|
||||
<a-form-model-item label="字段长度" prop="dbLength">
|
||||
<a-input-number v-model="form.dbLength" :min="1" :max="200" placeholder="请输入字段长度" style="width: 100%" :formatter="limitNumber" :parser="limitNumber" />
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="展示顺序" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input-number v-decorator="['orderNum', validatorRules.orderNum]" placeholder="请输入展示顺序" style="width: 100%" :min="1" :formatter="limitNumber" :parser="limitNumber" />
|
||||
</a-form-item>
|
||||
<a-form-model-item label="展示顺序" prop="orderNum">
|
||||
<a-input-number v-model="form.orderNum" placeholder="请输入展示顺序" style="width: 100%" :min="1" :formatter="limitNumber" :parser="limitNumber" />
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="是否必填" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<j-dict-select-tag type="list" v-decorator="['fieldMustInput', validatorRules.fieldMustInput]" :trigger-change="true" dictCode="yn" placeholder="请选择是否必填" />
|
||||
</a-form-item>
|
||||
<a-form-model-item label="是否必填" prop="fieldMustInput">
|
||||
<j-dict-select-tag type="list" v-model="form.fieldMustInput" dictCode="yn" placeholder="请选择是否必填" />
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
|
||||
|
||||
<p class="tag-info">文档库模块展示</p>
|
||||
<a-divider dashed />
|
||||
<a-col :span="24">
|
||||
<a-form-item label="文档库列表展示" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<j-dict-select-tag type="list" v-decorator="['isShowForm', validatorRules.isShowForm]" :trigger-change="true" dictCode="yn" placeholder="请选择是否文档库列表展示" />
|
||||
</a-form-item>
|
||||
<a-form-model-item label="文档库列表展示" prop="isShowForm">
|
||||
<j-dict-select-tag type="list" v-model="form.isShowForm" dictCode="yn" placeholder="请选择是否文档库列表展示" />
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="展示区域" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<j-dict-select-tag type="list" v-decorator="['showArea', validatorRules.showArea]" :trigger-change="true" dictCode="onl_cgform_area,展示区域,show_area" placeholder="请选择展示区域" />
|
||||
</a-form-item>
|
||||
<a-form-model-item label="展示区域" prop="showArea">
|
||||
<j-dict-select-tag type="list" v-model="form.showArea" dictCode="" placeholder="请选择展示区域" />
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="是否搜索" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<j-dict-select-tag type="list" v-decorator="['isQuery', validatorRules.isQuery]" :trigger-change="true" dictCode="yn" placeholder="请选择是否搜索" />
|
||||
</a-form-item>
|
||||
<a-form-model-item label="是否搜索" prop="isQuery">
|
||||
<j-dict-select-tag type="list" v-model="form.isQuery" dictCode="yn" placeholder="请选择是否搜索" />
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
|
||||
|
||||
<p class="tag-info">其它模块展示</p>
|
||||
<a-divider dashed />
|
||||
<a-col :span="24">
|
||||
<a-form-item label="法规清单展示" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<j-dict-select-tag type="list" v-decorator="['isShowLawsList', validatorRules.isShowLawsList]" :trigger-change="true" dictCode="yn" placeholder="请选择法规清单是否展示" />
|
||||
</a-form-item>
|
||||
<a-form-model-item label="法规清单展示" prop="isShowLawsList">
|
||||
<j-dict-select-tag type="list" v-model="form.isShowLawsList" dictCode="yn" placeholder="请选择法规清单是否展示" />
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="搜索中心展示" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<j-dict-select-tag type="list" v-decorator="['isShowSearch', validatorRules.isShowSearch]" :trigger-change="true" dictCode="yn" placeholder="请选择搜索中心是否展示" />
|
||||
</a-form-item>
|
||||
<a-form-model-item label="搜索中心展示" prop="isShowSearch">
|
||||
<j-dict-select-tag type="list" v-model="form.isShowSearch" dictCode="yn" placeholder="请选择搜索中心是否展示" />
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<!-- <a-col v-if="showFlowSubmitButton" :span="24" style="text-align: center">-->
|
||||
<!-- <a-button @click="submitForm">提 交</a-button>-->
|
||||
<!-- </a-col>-->
|
||||
</a-row>
|
||||
</a-form-model>
|
||||
</a-form>
|
||||
</j-form-container>
|
||||
</a-spin>
|
||||
</div>
|
||||
<!-- </j-form-container>-->
|
||||
<!-- </a-spin>-->
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -119,11 +130,24 @@
|
||||
isTagContent:{
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
drawerVisible:{
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
editData:{
|
||||
type: Object,
|
||||
},
|
||||
editId:{
|
||||
type:String
|
||||
},
|
||||
submitEdit:{
|
||||
type:String
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
form: this.$form.createForm(this),
|
||||
form: {},
|
||||
model: {},
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
@@ -135,72 +159,47 @@
|
||||
},
|
||||
confirmLoading: false,
|
||||
validatorRules: {
|
||||
isModel: {
|
||||
rules: [
|
||||
{ required: true, message: '请输入所属模块!'},
|
||||
]
|
||||
},
|
||||
dbFieldTxt: {
|
||||
rules: [
|
||||
{ required: true, message: '请输入属性名称!'},
|
||||
]
|
||||
},
|
||||
dbFieldName: {
|
||||
rules: [
|
||||
{ required: true, message: '请输入英文名称!'},
|
||||
]
|
||||
},
|
||||
fieldShowType: {
|
||||
rules: [
|
||||
{ required: true, message: '请输入属性类型!'},
|
||||
]
|
||||
},
|
||||
dictName: {
|
||||
rules: [
|
||||
// { required: true, message: '请输入选项内容!'},
|
||||
]
|
||||
},
|
||||
dbLength: {
|
||||
rules: [
|
||||
{ required: true, message: '请输入字段长度!'},
|
||||
]
|
||||
},
|
||||
orderNum: {
|
||||
rules: [
|
||||
{ required: true, message: '请输入展示顺序!'},
|
||||
]
|
||||
},
|
||||
fieldMustInput: {
|
||||
rules: [
|
||||
{ required: true, message: '请输入字段是否必填!'},
|
||||
]
|
||||
},
|
||||
isShowForm: {
|
||||
rules: [
|
||||
{ required: true, message: '请选择是否显示文档库列表'},
|
||||
]
|
||||
},
|
||||
showArea: {
|
||||
rules: [
|
||||
// { required: true, message: '请输入展示区域!'},
|
||||
]
|
||||
},
|
||||
isQuery: {
|
||||
rules: [
|
||||
{ required: true, message: '请输入是否查询条件0否 1是!'},
|
||||
]
|
||||
},
|
||||
isShowLawsList: {
|
||||
rules: [
|
||||
{ required: true, message: '请选择法规清单是否展示!'},
|
||||
]
|
||||
},
|
||||
isShowSearch: {
|
||||
rules: [
|
||||
{ required: true, message: '请选择搜索中心是否展示!'},
|
||||
]
|
||||
},
|
||||
isModel: [
|
||||
{ required: true, message: '请输入所属模块!',trigger: 'change'},
|
||||
],
|
||||
dbFieldTxt: [
|
||||
{ required: true, message: '请输入属性名称!',trigger: 'blur'},
|
||||
],
|
||||
dbFieldName: [
|
||||
{ required: true, message: '请输入英文名称!',trigger: 'blur'},
|
||||
],
|
||||
fieldShowType: [
|
||||
{ required: true, message: '请输入属性类型!',trigger: 'change'},
|
||||
],
|
||||
dictName: [
|
||||
// { required: true, message: '请输入选项内容!',trigger: 'change'},
|
||||
],
|
||||
dbLength: [
|
||||
{ required: true, message: '请输入字段长度!',trigger: 'blur'},
|
||||
],
|
||||
orderNum: [
|
||||
{ required: true, message: '请输入展示顺序!',trigger: 'blur'},
|
||||
],
|
||||
fieldMustInput: [
|
||||
{ required: true, message: '请输入字段是否必填!',trigger: 'change'},
|
||||
],
|
||||
isShowForm: [
|
||||
{ required: true, message: '请选择是否显示文档库列表',trigger: 'change'},
|
||||
],
|
||||
showArea: [
|
||||
// { required: true, message: '请输入展示区域!',trigger: 'change'},
|
||||
],
|
||||
isQuery: [
|
||||
{ required: true, message: '请输入是否查询条件',trigger: 'change'},
|
||||
],
|
||||
isShowLawsList: [
|
||||
{ required: true, message: '请选择法规清单是否展示!',trigger: 'change'},
|
||||
],
|
||||
isShowSearch: [
|
||||
{ required: true, message: '请选择搜索中心是否展示!',trigger: 'change'},
|
||||
],
|
||||
},
|
||||
addVisible:false,
|
||||
url: {
|
||||
add: "tag/onlCgformTag/add",
|
||||
edit: "tag/onlCgformTag/edit",
|
||||
@@ -208,7 +207,28 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
// 'form.fieldShowType'(val){
|
||||
// console.log('valDb',val)
|
||||
// console.log(val==3)
|
||||
// if(val==3||val==4||val==9||val==10){
|
||||
// this.isTagContent=true
|
||||
// console.log('isTag',this.isTagContent)
|
||||
// }else{
|
||||
// this.isTagContent=false
|
||||
// console.log('isTag',this.isTagContent)
|
||||
//
|
||||
// }
|
||||
//
|
||||
// },
|
||||
// 'form.dbLength'(val){
|
||||
// console.log('val')
|
||||
// }
|
||||
},
|
||||
computed: {
|
||||
changeType(val){
|
||||
console.log('changtType',val)
|
||||
},
|
||||
formDisabled(){
|
||||
if(this.formBpm===true){
|
||||
if(this.formData.disabled===false){
|
||||
@@ -231,16 +251,22 @@
|
||||
//如果是流程中表单,则需要加载流程表单data
|
||||
this.showFlowData();
|
||||
},
|
||||
mounted() {
|
||||
console.log('edit3333',this.editData)
|
||||
this.form={...this.editData}
|
||||
// console.log('drawerVisible',this.drawerVisible)
|
||||
},
|
||||
methods: {
|
||||
add () {
|
||||
this.edit({});
|
||||
|
||||
},
|
||||
edit (record) {
|
||||
this.form.resetFields();
|
||||
this.model = Object.assign({}, record);
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,'isModel','dbFieldTxt','dbFieldName','fieldShowType','dictName','dbLength','orderNum','fieldMustInput','isShowForm','showArea','isQuery','isShowLawsList','isShowSearch'))
|
||||
// this.form.setFieldsValue(pick(this.model,'isModel','dbFieldTxt','dbFieldName','fieldShowType','dictName','dbLength','orderNum','fieldMustInput','isShowForm','showArea','isQuery','isShowLawsList','isShowSearch'))
|
||||
})
|
||||
},
|
||||
//渲染流程表单数据
|
||||
@@ -255,32 +281,38 @@
|
||||
}
|
||||
},
|
||||
submitForm () {
|
||||
const that = this;
|
||||
// const that = this;
|
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
that.confirmLoading = true;
|
||||
// console.log(this.$refs.tagform)
|
||||
this.$refs.tagEditForm.validate((valid)=>{
|
||||
// console.log('valid',valid)
|
||||
if (valid) {
|
||||
this.confirmLoading = true;
|
||||
let httpurl = '';
|
||||
let method = '';
|
||||
if(!this.model.id){
|
||||
console.log('this.editId',this.editId)
|
||||
if(this.submitEdit=='add'){
|
||||
httpurl+=this.url.add;
|
||||
method = 'post';
|
||||
}else{
|
||||
this.form.id=''
|
||||
}else if(this.submitEdit=='edit'){
|
||||
httpurl+=this.url.edit;
|
||||
method = 'put';
|
||||
this.form.id=this.editId
|
||||
}
|
||||
let formData = Object.assign(this.model, values);
|
||||
console.log("表单提交数据",formData)
|
||||
httpAction(httpurl,formData,method).then((res)=>{
|
||||
|
||||
// let formData = Object.assign(this.editId, this.form);
|
||||
// console.log("表单提交数据",this.form)
|
||||
httpAction(httpurl,this.form,method).then((res)=>{
|
||||
if(res.success){
|
||||
that.$message.success(res.message);
|
||||
that.$emit('ok',false);
|
||||
this.$message.success(res.message);
|
||||
this.$emit('ok',false);
|
||||
|
||||
}else{
|
||||
that.$message.warning(res.message);
|
||||
this.$message.warning(res.message);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
this.confirmLoading = false;
|
||||
})
|
||||
}
|
||||
|
||||
@@ -303,6 +335,11 @@
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.form-tag{
|
||||
.tag-content{
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
}
|
||||
.tag-info{
|
||||
margin-left: 30px;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,220 @@
|
||||
<template>
|
||||
<div class="dic-list">
|
||||
<div class="dic-list-content">
|
||||
<div class="dic-list-header">
|
||||
<a-form-model :model="form" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||
<a-form-model-item label="名称">
|
||||
<a-input v-model="form.tagName" placeholder="请输入名称" />
|
||||
</a-form-model-item>
|
||||
</a-form-model>
|
||||
<div class="form-btn">
|
||||
<a-button class="form-btn-search" type="primary" @click="search">查询</a-button>
|
||||
<a-button class="form-btn-reset" @click="reset">重置</a-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dic-list-module">
|
||||
<a-button type="primary" class="dic-list-add" @click="dicAdd">{{$t('add')}}</a-button>
|
||||
</div>
|
||||
<div class="dic-list-table">
|
||||
<list-table v-if="dictVal=='list'" :tableData="tableData" @editDict="editDict"></list-table>
|
||||
<tree-table v-if="dictVal=='tree'" :tabletreeData="tabletreeData" @editDict="editTreeDict"></tree-table>
|
||||
</div>
|
||||
<a-modal class="dict-module" v-model="newVisible" title="新增" ok-text="保存" cancel-text="取消" @ok="hideModal" @cancel="cancelModel" v-if="newVisible">
|
||||
<a-form-model
|
||||
v-if="newVisible"
|
||||
class="dic-form-module"
|
||||
ref="ruleForm"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:label-col="labelCol"
|
||||
:wrapper-col="wrapperCol"
|
||||
|
||||
>
|
||||
<a-form-model-item label="名称" prop="name">
|
||||
<a-input v-model="form.name" placeholder="请输入名称" />
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="英文名称" prop="enName">
|
||||
<a-input v-model="form.enName" placeholder="请输入英文名称" />
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="父级名称" prop="parentName" v-if="parentVisible">
|
||||
<a-tree-select
|
||||
v-model="parentName"
|
||||
style="width: 100%"
|
||||
:dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
|
||||
:tree-data="treeData"
|
||||
placeholder="请选择父级名称"
|
||||
tree-default-expand-all
|
||||
>
|
||||
<span v-if="key === '0-0-1'" slot="title" slot-scope="{ key, value }">
|
||||
Child Node1 {{ value }}
|
||||
</span>
|
||||
</a-tree-select>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="描述" prop="describe">
|
||||
<a-input v-model="form.describe" placeholder="请输入描述" />
|
||||
</a-form-model-item>
|
||||
|
||||
</a-form-model>
|
||||
</a-modal>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import listTable from './listTable'
|
||||
import treeTable from './treeTable'
|
||||
export default {
|
||||
name: 'dicList',
|
||||
components:{
|
||||
listTable,
|
||||
treeTable
|
||||
},
|
||||
props:{
|
||||
dictVal:String,
|
||||
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
labelCol: { span: 4 },
|
||||
wrapperCol: { span: 18 },
|
||||
form:{},
|
||||
newVisible:false,
|
||||
rules:{
|
||||
name:[
|
||||
{ required: true, message: '请输入展示区域', trigger: 'blur' },
|
||||
{ min:1, max: 30, message: '长度在 1 - 30字符', trigger: 'blur' },
|
||||
],
|
||||
enName:[
|
||||
{ min:1, max: 100, message: '长度在 1 - 100字符', trigger: 'blur' },
|
||||
],
|
||||
describe:[
|
||||
{ min:1, max: 300, message: '长度在 1 - 300字符', trigger: 'blur' },
|
||||
]
|
||||
},
|
||||
tableData:[
|
||||
{
|
||||
key: '1',
|
||||
name: '适用地区',
|
||||
enName:'aaaaa',
|
||||
describe:'单选',
|
||||
},
|
||||
{
|
||||
key: '2',
|
||||
name: '类别',
|
||||
enName:'bbbb',
|
||||
describe:'单选',
|
||||
},
|
||||
],
|
||||
tabletreeData:[],
|
||||
parentName:undefined,
|
||||
treeData:[
|
||||
{
|
||||
title: 'Node1',
|
||||
value: '0-0',
|
||||
key: '0-0',
|
||||
children: [
|
||||
{
|
||||
value: '0-0-1',
|
||||
key: '0-0-1',
|
||||
scopedSlots: {
|
||||
// custom title
|
||||
title: 'title',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: 'Child Node2',
|
||||
value: '0-0-2',
|
||||
key: '0-0-2',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'Node2',
|
||||
value: '0-1',
|
||||
key: '0-1',
|
||||
},
|
||||
],
|
||||
parentVisible:false,
|
||||
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
parentName(value) {
|
||||
console.log(value);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
console.log(this.dictVal)
|
||||
},
|
||||
methods:{
|
||||
//搜索
|
||||
search(){
|
||||
|
||||
},
|
||||
//重置
|
||||
reset(){
|
||||
|
||||
},
|
||||
//新增
|
||||
dicAdd(){
|
||||
this.newVisible=true;
|
||||
if(this.dictVal=='list'){
|
||||
this.parentVisible=false
|
||||
|
||||
}else if(this.dictVal='tree'){
|
||||
this.parentVisible=true
|
||||
}
|
||||
},
|
||||
//保存
|
||||
hideModal(){
|
||||
|
||||
},
|
||||
//取消
|
||||
cancelModel(){
|
||||
this.newVisible=false;
|
||||
},
|
||||
//列表编辑
|
||||
editDict(val){
|
||||
this.newVisible=val
|
||||
this.parentVisible=false
|
||||
},
|
||||
//树状编辑
|
||||
editTreeDict(val){
|
||||
this.newVisible=val
|
||||
this.parentVisible=true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.dic-list{
|
||||
.dic-list-content{
|
||||
.dic-list-header{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.form-btn{
|
||||
.form-btn-search{
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.dic-list-module{
|
||||
margin-bottom: 20px;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
.dict-module{
|
||||
.ant-modal-footer{
|
||||
align:center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<style lang="less">
|
||||
.dict-module{
|
||||
.ant-modal-footer{
|
||||
text-align:center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,90 @@
|
||||
<template>
|
||||
<div class="list-table">
|
||||
<a-table bordered :data-source="tableData" :columns="columns" :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" class="tag-con-table">
|
||||
|
||||
<template slot="action" slot-scope="text, record">
|
||||
<a class="action-edit" href="javascript:;" @click="actionEdit(record)">编辑</a>
|
||||
<a-popconfirm
|
||||
v-if="tableData.length"
|
||||
title="Sure to delete?"
|
||||
@confirm="() => onDelete(record)"
|
||||
>
|
||||
<a class="action-delete" href="javascript:;">删除</a>
|
||||
</a-popconfirm>
|
||||
</template>
|
||||
</a-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'listTable',
|
||||
props:{
|
||||
tableData:Array,
|
||||
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
selectedRowKeys:[],
|
||||
columns: [
|
||||
{
|
||||
title: '名称',
|
||||
dataIndex: 'name',
|
||||
key: 'name',
|
||||
align: "center",
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '英文名称',
|
||||
align: "center",
|
||||
width: 100,
|
||||
dataIndex: 'enName',
|
||||
},
|
||||
{
|
||||
title: '描述',
|
||||
align: "center",
|
||||
width: 100,
|
||||
dataIndex: 'describe',
|
||||
},
|
||||
{
|
||||
title: this.$t('operation'),
|
||||
dataIndex: 'action',
|
||||
scopedSlots: {customRender: 'action'},
|
||||
align: "center",
|
||||
width: 170
|
||||
}
|
||||
],
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods:{
|
||||
//编辑
|
||||
actionEdit(val){
|
||||
this.$emit('editDict',true)
|
||||
},
|
||||
//删除
|
||||
onDelete(val){
|
||||
|
||||
},
|
||||
onSelectChange(selectedRowKeys) {
|
||||
console.log('selectedRowKeys changed: ', selectedRowKeys);
|
||||
this.selectedRowKeys = selectedRowKeys;
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.list-table{
|
||||
.tag-con-table{
|
||||
.action-edit{
|
||||
margin-right: 5px;
|
||||
}
|
||||
.action-delete{
|
||||
color:red;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="new-tag-drawer">
|
||||
<onl-cgform-tag-form ref="realForm" @ok="submitCallback" :isTagContent="isTagContent" :disabled="disableSubmit" normal> </onl-cgform-tag-form>
|
||||
<onl-cgform-tag-form ref="realForm" @ok="submitCallback" :isTagContent="isTagContent" :editData="editData" :editId=editId :submitEdit="submitEdit" :disabled="disableSubmit" normal> </onl-cgform-tag-form>
|
||||
|
||||
<div class="drawer-footer">
|
||||
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">保存</a-button>
|
||||
@@ -28,7 +28,10 @@
|
||||
},
|
||||
props:{
|
||||
drawerVisible:Boolean,
|
||||
isTagContent:Boolean
|
||||
isTagContent:Boolean,
|
||||
editData:Object,
|
||||
editId:String,
|
||||
submitEdit:String
|
||||
},
|
||||
mounted() {
|
||||
this.visible=this.drawerVisible
|
||||
|
||||
@@ -0,0 +1,255 @@
|
||||
<template>
|
||||
<div class="tree-table">
|
||||
<div class="tree-table-content">
|
||||
<a-table
|
||||
bordered
|
||||
class="tree-table-con"
|
||||
:columns="columns"
|
||||
:data-source="tabData"
|
||||
:row-selection="{selectedRowKeys: selectedRowKeys, onSelectAll: onSelectAll, onSelect: onSelect}"
|
||||
>
|
||||
<template slot="action" slot-scope="text, record">
|
||||
<a class="action-edit" href="javascript:;" @click="actionEdit(record)">编辑</a>
|
||||
<a-popconfirm
|
||||
v-if="tabData.length"
|
||||
title="Sure to delete?"
|
||||
@confirm="() => onDelete(record)"
|
||||
>
|
||||
<a class="action-delete" href="javascript:;">删除</a>
|
||||
</a-popconfirm>
|
||||
</template>
|
||||
</a-table>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'treeTable',
|
||||
props:{
|
||||
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
columns: [
|
||||
{
|
||||
title: '名称',
|
||||
dataIndex: 'name',
|
||||
key: 'name',
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: '英文名称',
|
||||
dataIndex: 'enName',
|
||||
key: 'enName',
|
||||
width: '12%',
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: '描述',
|
||||
dataIndex: 'describe',
|
||||
width: '30%',
|
||||
key: 'describe',
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: this.$t('operation'),
|
||||
dataIndex: 'action',
|
||||
scopedSlots: {customRender: 'action'},
|
||||
align: "center",
|
||||
width: 170
|
||||
}
|
||||
],
|
||||
tabData:[
|
||||
{
|
||||
key: 1,
|
||||
name: 'John Brown sr.',
|
||||
enName: 'ddddd',
|
||||
describe: 'New York No. 1 Lake Park',
|
||||
children: [
|
||||
{
|
||||
key: 11,
|
||||
name: 'John Brown',
|
||||
enName: 'oouuu',
|
||||
describe: 'New York No. 2 Lake Park',
|
||||
},
|
||||
{
|
||||
key: 12,
|
||||
name: 'John Brown jr.',
|
||||
enName: 'John Brown',
|
||||
describe: 'New York No. 3 Lake Park',
|
||||
children: [
|
||||
{
|
||||
key: 121,
|
||||
name: 'Jimmy Brown',
|
||||
enName: 'mmmmm',
|
||||
describe: 'New York No. 3 Lake Park',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 13,
|
||||
name: 'Jim Green sr.',
|
||||
enName: 'lllll',
|
||||
describe: 'London No. 1 Lake Park',
|
||||
children: [
|
||||
{
|
||||
key: 131,
|
||||
name: 'Jim Green',
|
||||
enName: 'yyjjg',
|
||||
describe: 'London No. 2 Lake Park',
|
||||
children: [
|
||||
{
|
||||
key: 1311,
|
||||
name: 'Jim Green jr.',
|
||||
enName: 'uioo',
|
||||
describe: 'London No. 3 Lake Park',
|
||||
},
|
||||
{
|
||||
key: 1312,
|
||||
name: 'Jimmy Green sr.',
|
||||
enName: 'jhkj',
|
||||
describe: 'London No. 4 Lake Park',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 2,
|
||||
name: 'Joe Black',
|
||||
enName: 'trttt',
|
||||
describe: 'Sidney No. 1 Lake Park',
|
||||
},
|
||||
],
|
||||
selectedRowKeys:[]
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods:{
|
||||
//删除
|
||||
onDelete(val){
|
||||
|
||||
},
|
||||
//编辑
|
||||
actionEdit(val){
|
||||
this.$emit('editDict',true)
|
||||
},
|
||||
onSelectAll(selected) {
|
||||
if (selected) {
|
||||
const tabData = this.tabData;
|
||||
const arr = [];
|
||||
setVal(tabData, arr);
|
||||
this.selectedRowKeys = arr;
|
||||
} else {
|
||||
this.selectedRowKeys = [];
|
||||
}
|
||||
function setVal(list, arr) {
|
||||
list.forEach(v => {
|
||||
arr.push(v.key);
|
||||
if (v.children) {
|
||||
setVal(v.children, arr);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
onSelect(record, selected) {
|
||||
const set = new Set(this.selectedRowKeys);
|
||||
const tabData = this.tabData;
|
||||
const key = record.key;
|
||||
if (selected) {
|
||||
set.add(key);
|
||||
record.children && setChildCheck(record.children);
|
||||
setParentCheck(key);
|
||||
} else {
|
||||
set.delete(key);
|
||||
record.children && setChildUncheck(record.children);
|
||||
setParentUncheck(key);
|
||||
}
|
||||
this.selectedRowKeys = Array.from(set);
|
||||
// 设置父级选择
|
||||
function setParentCheck(key) {
|
||||
let parent = getParent(key);
|
||||
if (parent) {
|
||||
set.add(parent.key);
|
||||
setParentCheck(parent.key);
|
||||
}
|
||||
}
|
||||
// 设置父级取消,如果父级的子集有选择,则不取消
|
||||
function setParentUncheck(key) {
|
||||
let childHasCheck = false,
|
||||
parent = getParent(key);
|
||||
if (parent) {
|
||||
let childlist = parent.children;
|
||||
childlist.forEach(function(v) {
|
||||
if (set.has(v.key)) childHasCheck = true;
|
||||
});
|
||||
if (!childHasCheck) {
|
||||
set.delete(parent.key);
|
||||
setParentUncheck(parent.key);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 获取当前对象的父级
|
||||
function getParent(key) {
|
||||
for (let i = 0; i < tabData.length; i++) {
|
||||
if (tabData[i].key === key) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return _getParent(tabData);
|
||||
function _getParent(list) {
|
||||
let childlist,
|
||||
isExist = false;
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
if ((childlist = list[i].children)) {
|
||||
childlist.forEach(function(v) {
|
||||
if (v.key === key) isExist = true;
|
||||
});
|
||||
if (isExist) {
|
||||
return list[i];
|
||||
}
|
||||
if (_getParent(childlist)) {
|
||||
return _getParent(childlist);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 设置child全选
|
||||
function setChildCheck(list) {
|
||||
list.forEach(function(v) {
|
||||
set.add(v.key);
|
||||
v.children && setChildCheck(v.children);
|
||||
});
|
||||
}
|
||||
// 设置child取消
|
||||
function setChildUncheck(list) {
|
||||
list.forEach(function(v) {
|
||||
set.delete(v.key);
|
||||
v.children && setChildUncheck(v.children);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.tree-table{
|
||||
.tree-table-content{
|
||||
.tree-table-con{
|
||||
.action-edit{
|
||||
margin-right: 10px;
|
||||
}
|
||||
.action-delete{
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -16,7 +16,14 @@
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<a @click="editVisible(record.id)">编辑</a>
|
||||
<a-divider type="vertical" />
|
||||
<a class="table-del">删除</a>
|
||||
<a-popconfirm
|
||||
v-if="tableData.length"
|
||||
title="Sure to delete?"
|
||||
@confirm="() => deleteVisible(record.id)"
|
||||
>
|
||||
<a class="table-del" href="javascript:;">删除</a>
|
||||
</a-popconfirm>
|
||||
<!-- <a class="table-del" @click="deleteVisible(record.id)">删除</a>-->
|
||||
</span>
|
||||
</a-table>
|
||||
</div>
|
||||
@@ -49,7 +56,10 @@
|
||||
|
||||
},
|
||||
editVisible(id){
|
||||
this.$emit('visibleEd',true,id)
|
||||
this.$emit('visibleEd',true,id,'编辑标签项')
|
||||
},
|
||||
deleteVisible(id){
|
||||
this.$emit('visibleDelete',id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
<a-modal class="show-content" v-model="contentVisible" title="新增" ok-text="保存" cancel-text="取消" @ok="hideModal" @cancel="cancelModel" v-if="contentVisible">
|
||||
<a-form-model
|
||||
class="tag-content"
|
||||
|
||||
ref="ruleForm"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
@@ -57,20 +56,40 @@
|
||||
</a-form-model>
|
||||
</a-modal>
|
||||
|
||||
<a-table bordered :data-source="tableData" :columns="columns" :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }">
|
||||
<template slot="name" slot-scope="text, record">
|
||||
<editable-cell :text="text" @change="onCellChange(record.key, 'name', $event)" />
|
||||
</template>
|
||||
<template slot="operation" slot-scope="text, record">
|
||||
<a-table bordered :data-source="tableData" :columns="columns" :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" class="tag-con-table">
|
||||
|
||||
<template slot="action" slot-scope="text, record">
|
||||
<a-popover placement="right" v-model="typeVisible[record.key]" trigger="click">
|
||||
<template slot="content" class="type-popover-content">
|
||||
<div class="type-popover">
|
||||
<p class="type type-input" @click="handleDicPop(record,'list')">下拉选择</p>
|
||||
<p class="type type-select" @click="handleDicPop(record,'tree')">树状结构</p>
|
||||
</div>
|
||||
</template>
|
||||
<a class="action-dict" href="javascript:;">字典配置</a>
|
||||
</a-popover>
|
||||
<a class="action-edit" href="javascript:;" @click="actionEdit(record)">编辑</a>
|
||||
<a-popconfirm
|
||||
v-if="dataSource.length"
|
||||
v-if="tableData.length"
|
||||
title="Sure to delete?"
|
||||
@confirm="() => onDelete(record.key)"
|
||||
@confirm="() => onDelete(record)"
|
||||
>
|
||||
<a href="javascript:;">Delete</a>
|
||||
<a class="action-delete" href="javascript:;">删除</a>
|
||||
</a-popconfirm>
|
||||
</template>
|
||||
</a-table>
|
||||
<a-drawer
|
||||
class="dict-drawer"
|
||||
title="字典列表"
|
||||
placement="right"
|
||||
:closable="true"
|
||||
:visible="dicVisible"
|
||||
:after-visible-change="afterDicVisibleChange"
|
||||
@close="onDicClose"
|
||||
width="1000px"
|
||||
>
|
||||
<dic-list :dictVal="dictVal" v-if="dicVisible"></dic-list>
|
||||
</a-drawer>
|
||||
|
||||
<!-- <tab-table :tableData="tableData" :columns="columns"></tab-table>-->
|
||||
</div>
|
||||
@@ -78,10 +97,12 @@
|
||||
|
||||
<script>
|
||||
import tabTable from './tabTable'
|
||||
import dicList from '../dialog/dicList'
|
||||
export default {
|
||||
name: 'tagContent',
|
||||
components:{
|
||||
tabTable
|
||||
tabTable,
|
||||
dicList
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
@@ -132,8 +153,8 @@
|
||||
width: 170
|
||||
}
|
||||
],
|
||||
labelCol: { span: 4 },
|
||||
wrapperCol: { span: 14 },
|
||||
labelCol: { span:4 },
|
||||
wrapperCol: { span: 18 },
|
||||
form:{},
|
||||
rules:{
|
||||
tagName:[{ required: true, message: '请输入标签名称', trigger: 'change' },
|
||||
@@ -142,7 +163,11 @@
|
||||
{ required: true, message: '请选择标签类型', trigger: 'blur' },
|
||||
|
||||
],
|
||||
}
|
||||
},
|
||||
typeVisible:{},
|
||||
dicVisible:false,
|
||||
dictVal:'',
|
||||
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
@@ -162,10 +187,10 @@
|
||||
this.contentVisible=true
|
||||
},
|
||||
hideModal(){
|
||||
console.log('form',this.form)
|
||||
this.$refs.ruleForm.validate((valide)=>{
|
||||
// console.log('form',this.form)
|
||||
this.$refs.ruleForm.validate((valid)=>{
|
||||
// console.log('valide',valide)
|
||||
if(valide){
|
||||
if(valid){
|
||||
this.contentVisible=false
|
||||
}
|
||||
|
||||
@@ -178,17 +203,75 @@
|
||||
onCellChange(){
|
||||
|
||||
},
|
||||
onDelete(){
|
||||
|
||||
//删除
|
||||
onDelete(val){
|
||||
console.log('delval',val)
|
||||
},
|
||||
onSelectChange(selectedRowKeys) {
|
||||
console.log('selectedRowKeys changed: ', selectedRowKeys);
|
||||
this.selectedRowKeys = selectedRowKeys;
|
||||
},
|
||||
//编辑
|
||||
actionEdit(val){
|
||||
this.contentVisible=true
|
||||
},
|
||||
//字典配置
|
||||
handleDicPop(record,val){
|
||||
this.dictVal=val
|
||||
if(val=='list'){
|
||||
this.typeVisible[record.key]=false
|
||||
this.dicVisible=true
|
||||
|
||||
|
||||
}else if(val == 'tree'){
|
||||
this.typeVisible[record.key]=false
|
||||
this.dicVisible=true
|
||||
|
||||
}
|
||||
},
|
||||
afterDicVisibleChange(val) {
|
||||
console.log('visible', val);
|
||||
},
|
||||
//字典列表关闭
|
||||
onDicClose() {
|
||||
this.dicVisible = false;
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
<style lang="less" scoped>
|
||||
.tag-content{
|
||||
.tag-con-table{
|
||||
.action-dict,.action-edit{
|
||||
margin-right: 10px;
|
||||
}
|
||||
.action-delete{
|
||||
color:red;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
.type-popover{
|
||||
p{
|
||||
margin:5px 0;
|
||||
}
|
||||
p:hover{
|
||||
cursor: pointer;
|
||||
color:#0c8fcf;
|
||||
}
|
||||
}
|
||||
.dict-drawer{
|
||||
.ant-drawer-content-wrapper{
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<style lang="less">
|
||||
.show-content{
|
||||
.ant-modal-footer{
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -38,7 +38,7 @@
|
||||
<a-button type="primary" @click="handleShow">展示区域管理</a-button>
|
||||
</div>
|
||||
<a-drawer class="show-drawer" :title="titleTag" placement="right" width="1000px" @close="close" :visible="drawerVisible" :after-visible-change="afterVisibleChange" >
|
||||
<new-drawer v-if="drawerVisible" :isTagContent="isTagContent" :editData="editData" @closeTag="closeTag"></new-drawer>
|
||||
<new-drawer v-if="drawerVisible&&editFlag" :drawerVisible="drawerVisible" :isTagContent="isTagContent" :editData="editData" :editId="editId" :submitEdit="submitEdit" @closeTag="closeTag" ></new-drawer>
|
||||
</a-drawer>
|
||||
<a-modal class="show-area" v-model="areaVisible" title="展示区域管理" :footer="null" @cancel="hideModal">
|
||||
<area-manage v-if="areaVisible" @diaHide="diaHide" :areaTable="areaTable" @submitOk="submitOk" @deleteOk="deleteOk" @updateOk="updateOk"></area-manage>
|
||||
@@ -46,7 +46,7 @@
|
||||
<div class="tag-doc-tab">
|
||||
<a-tabs default-active-key="1" @change="callbackTab">
|
||||
<a-tab-pane key="1" tab="文档库">
|
||||
<tabTable :tableData="tableData" :columns="taglabColumns" @visibleEd="visibleEd"></tabTable>
|
||||
<tabTable :tableData="tableData" :columns="taglabColumns" @visibleEd="visibleEd" @visibleDelete="visibleDelete"></tabTable>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="2" tab="文档拆分" force-render>
|
||||
<tabTable :tableData="tableData" :columns="tagSplit"></tabTable>
|
||||
@@ -57,7 +57,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { putAction,postAction,getAction } from '@/api/manage'
|
||||
import { putAction,postAction,getAction,deleteAction } from '@/api/manage'
|
||||
import JInput from '@/components/jero/JInput'
|
||||
import tabTable from './tabTable'
|
||||
import areaManage from '../dialog/areaManage'
|
||||
@@ -81,7 +81,8 @@
|
||||
titleTag:'新增标签项',
|
||||
typeVisible:false,
|
||||
isTagContent:false,
|
||||
editData:[], //编辑的数据
|
||||
editData:{}, //编辑的数据
|
||||
editFlag:true,
|
||||
areas:[
|
||||
{
|
||||
value: 1,
|
||||
@@ -115,18 +116,16 @@
|
||||
],
|
||||
taglabColumns: [
|
||||
{
|
||||
dataIndex: 'dbFieldName',
|
||||
key: 'dbFieldName',
|
||||
slots: { title: 'customTitle' },
|
||||
scopedSlots: { customRender: 'dbFieldName' },
|
||||
title: '中文名称',
|
||||
align: "center",
|
||||
width: 100,
|
||||
dataIndex: 'dbFieldTxt',
|
||||
},
|
||||
{
|
||||
title: '英文名称',
|
||||
align: "center",
|
||||
width: 100,
|
||||
dataIndex: 'dbFieldEnName',
|
||||
dataIndex: 'dbFieldName',
|
||||
},
|
||||
{
|
||||
title: '属性类型',
|
||||
@@ -138,7 +137,7 @@
|
||||
title: '字段长度',
|
||||
align: "center",
|
||||
width: 80,
|
||||
dataIndex: 'fieldLength'
|
||||
dataIndex: 'dbLength'
|
||||
},
|
||||
{
|
||||
title: '展示顺序',
|
||||
@@ -198,7 +197,9 @@
|
||||
areaVisible:false,
|
||||
areaTable:[],
|
||||
drawerVisible:false,
|
||||
value:1
|
||||
value:1,
|
||||
editId:'',
|
||||
submitEdit:'add'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -213,6 +214,7 @@
|
||||
},
|
||||
handleAdd(){
|
||||
this.drawerVisible=true
|
||||
|
||||
},
|
||||
|
||||
//区域管理列表数据
|
||||
@@ -270,33 +272,66 @@
|
||||
this.handleShow()
|
||||
},
|
||||
//编辑
|
||||
visibleEd(val,id){
|
||||
visibleEd(val,id,title){
|
||||
this.editFlag=false
|
||||
this.drawerVisible=val
|
||||
this.titleTag=title
|
||||
this.editId=id
|
||||
this.submitEdit='edit'
|
||||
let params={
|
||||
id:id
|
||||
}
|
||||
getAction(`Field/onlCgformField/queryById`,params).then(res=>{
|
||||
getAction(`tag/onlCgformTag/queryById`,params).then(res=>{
|
||||
if(res.success){
|
||||
this.editData=res.result
|
||||
this.editFlag=true
|
||||
}
|
||||
})
|
||||
},
|
||||
//删除
|
||||
visibleDelete(id){
|
||||
let params={
|
||||
id:id
|
||||
}
|
||||
// deleteAction(that.url.delete, {depId: this.currentDeptId, userId: id}).then((res) => {
|
||||
// if (res.success) {
|
||||
//
|
||||
// }
|
||||
// })
|
||||
deleteAction(`tag/onlCgformTag/delete`,params).then(res=>{
|
||||
if(res.success){
|
||||
this.$message('删除成功')
|
||||
}
|
||||
})
|
||||
},
|
||||
//新增关闭
|
||||
closeTag(val){
|
||||
this.drawerVisible=val
|
||||
this.loadData(1)
|
||||
},
|
||||
afterVisibleChange(val){
|
||||
// console.log('val',val)
|
||||
},
|
||||
handleAddPop(val){
|
||||
this.drawerVisible=true
|
||||
this.titleTag='新增标签项'
|
||||
this.submitEdit='add'
|
||||
if(val=='input'){
|
||||
this.typeVisible=false
|
||||
this.isTagContent=false
|
||||
// this.getFormCon()
|
||||
} else if(val='select'){
|
||||
this.typeVisible=false
|
||||
this.isTagContent=true
|
||||
}
|
||||
},
|
||||
//获取表单内容
|
||||
getFormCon(){
|
||||
getAction(`tag/onlCgformTag/list`, { }).then(res=>{
|
||||
if(res.success){
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user