朱思禹提交:提交子表单实现的相关代码

init
Administrator 4 years ago
parent 1f3801eebb
commit b0985f67b4

@ -71,3 +71,7 @@
.__bar-is-horizontal {
display: none !important;
}
.__view{
width: 100% !important;
}

@ -88,8 +88,11 @@
// this.createEditor();
},
content:function (newData) {
this.contentHtml = newData;
this.editorCom.txt.html(this.contentHtml)
if (newData !== this.contentHtml){
this.contentHtml = newData;
this.editorCom.txt.html(this.contentHtml)
}
}
}
}

@ -74,7 +74,7 @@
type:Boolean,
required: true
},
data:{
fileData:{
type:Array,
default: function () {
return [];
@ -103,10 +103,10 @@
uploadType:parseInt(this.type),
opt:_.cloneDeep(this.option),
uploader:null,
fileList:this.data,//
fileList:_.cloneDeep(this.fileData),//
isLoading:false,
singleSignature:null,//
hasUploadList:_.cloneDeep(this.data),//
hasUploadList:_.cloneDeep(this.fileData),//
alertShow:false//
}
},
@ -244,7 +244,7 @@
this.fileList[i].resource_id_int = data.resource_id_int;
this.fileList[i].resource_info_id = data.resource_info_id;
this.fileList[i].percent = 100;
let item = ObjectFns.clone(this.fileList[i]);
let item = _.cloneDeep(this.fileList[i]);
this.hasUploadList.push(item);
}
})
@ -340,7 +340,7 @@
this.initUpload()
}
},
data:function (newData) {
fileData:function (newData) {
this.fileList = newData;//
this.hasUploadList=_.cloneDeep(newData);//
}

@ -32,11 +32,11 @@
{{getDictionaryValue(value)}}
</span>
<span slot="img" slot-scope="value" style="display:flex;justify-items: center;justify-content: center"><!--图片-->
<ShowAttachment v-if="value && value !== '' && value !== '[]'" :type="2" :img="getImg(value)" :file-list="getFileList(value)"
<ShowAttachment v-if="value && value !== '' && value !== '[]' && Array.isArray(JSON.parse(value))" :type="2" :img="getImg(value)" :file-list="getFileList(value)"
picture-width="8rem" picture-height="4.5rem" :badge-count="getBadgeCount(value)"/>
</span>
<span slot="attachment" slot-scope="value"><!--附件类型字段-->
<ShowAttachment v-if="value && value !== '' && value !== '[]'" :type="1" :file-list="getFileList(value)" :badge-count="getBadgeCount(value)"/>
<ShowAttachment v-if="value && value !== '' && value !== '[]' && Array.isArray(JSON.parse(value))" :type="1" :file-list="getFileList(value)" :badge-count="getBadgeCount(value)"/>
</span>
<span slot="editor" slot-scope="value" v-html="value"></span><!--//-->
<span slot="depart_person" slot-scope="value"><!--部门人员类型字段-->

@ -0,0 +1,37 @@
<template>
<div v-if="data.props.type === 1" style="width: 100%;">
<a-divider v-if="data.props.value === ''" :dashed="data.props.dashed"
:style="{marginTop:data.props.marginTop + 'px',marginBottom:data.props.marginBottom + 'px'}"/>
<a-divider v-else :dashed="data.props.dashed" :orientation="data.props.orientation"
:style="{marginTop:data.props.marginTop + 'px',marginBottom:data.props.marginBottom + 'px'}">
{{data.props.value}}
</a-divider>
</div>
<div v-else :style="{width:'100%',height:data.props.height + 'px'}"></div>
</template>
<script>
import {Divider} from "ant-design-vue"
export default {
name: "Divider",
props:["field","disabled"],
data:function(){
return{
data:this.field,
}
},
components:{
ADivider:Divider
}
}
</script>
<style scoped>
/*.divider-container-style{*/
/* min-height: 2.5rem;*/
/* display: flex;*/
/* align-items: center;*/
/* align-content: center;*/
/* width: 100%;*/
/*}*/
</style>

@ -1,6 +1,6 @@
<template>
<Upload :type="data.props.type" :title="data.props.title" :option="data.props.option" :multiple="data.props.multiple" :canDownload="data.props.can_downLoad"
:data="data.props.value" :can-upload="canUpload !== false"/>
:fileData="data.props.value" :can-upload="canUpload !== false"/>
</template>
<script>

@ -1,14 +1,19 @@
<template>
<div class="sonFormContainer">
<div class="numContainer">
<div v-if="data.props.multiple" class="numContainer">
<a-checkbox class="numTitle"></a-checkbox>
<a-checkbox class="numContent" style="text-align: left"></a-checkbox>
</div>
<div v-if="data.props.showLineNum" class="numContainer">
<div class="numTitle">序号</div>
<div class="numContent">1</div>
</div>
<div class="draggableContainer">
<div class="draggableContainer" :style="{width:'calc(100% - ' + (data.props.multiple && data.props.showLineNum?'4rem':
(data.props.multiple || data.props.showLineNum?'2rem':'0')) + ')'}">
<draggable group="itemGroup" class="sonFormDraggble" filter=".tip" v-model="data.props.data" :style="{width:'auto'}"
forceFallback="true" chosenClass="chosen" ghostClass="ghost-son-style" @add="onAdd" handle=".move"
:disabled= "draggableDisabled">
<FieldItem v-for="field in data.props.data" :key="field.id" :item="field" :design="true"/>
<FieldItem v-for="field in data.props.data" :key="field.id" :item="field" :design="true" @delete="deleteRowData" @copy="copyRowData"/>
<div v-if="data.props.data.length === 0" class="tip"></div>
</draggable>
</div>
@ -21,6 +26,8 @@
import Common from '../../../utils/common'
import FieldItem from '../systemConfig/FieldItem'
import {EventConfig} from '../../../utils/eventConfig'
import {Checkbox} from 'ant-design-vue'
import _ from 'lodash'
export default {
name: "SonForm",
props:["field","disabled"],
@ -35,7 +42,8 @@
},
components:{
draggable,
FieldItem
FieldItem,
ACheckbox:Checkbox
},
mounted:function(){
this.$bus.on(EventConfig.SON_FORM_DISABLED,this.onDisabledChange)
@ -44,12 +52,38 @@
this.$bus.off(EventConfig.SON_FORM_DISABLED,this.onDisabledChange)
},
methods:{
copyRowData: function (data) {
let copyRowData = _.cloneDeep(data[0]);
let index = this.data.props.data.findIndex((field)=>{return field.id === copyRowData.id})
copyRowData.id = copyRowData.tag + "_" + Common.getRandom(12);
this.data.props.data.splice(index+1,0,copyRowData);
this.curItem.item = copyRowData;
// this.selectedItem = this.curItem.item
this.$bus.emit("clickItem",copyRowData)
},
deleteRowData: function (data) {
let item = data[0];
let index = this.data.props.data.findIndex((field)=>{return field.id === item.id})
if (this.data.props.data.length > 1){
if (index === this.data.props.data.length - 1){
this.curItem.item = this.data.props.data[index - 1];
}else{
this.curItem.item = this.data.props.data[index + 1];
}
// this.selectedItem = this.curItem.item
this.$bus.emit("clickItem",this.curItem.item)
}else{
// this.selectedItem = {}
this.curItem.item = {}
}
this.data.props.data.splice(index,1)
},
onAdd:function (e) {
if (e.from.className === "itemInnerContainer"){
this.$set(this.data.props.data[e.newIndex].props,"is_sonForm_field",true)
this.$set(this.data.props.data[e.newIndex].props,"label_alignment",this.data.props.son_label_alignment)
}else{
this.curItem.item.id = this.curItem.tag + "_" + Common.getRandom(12);
this.curItem.item.id = this.curItem.item.tag + "_" + Common.getRandom(12);
this.$set(this.curItem.item.props,"is_sonForm_field",true)
if(this.curItem.item.tag !== "label"){
Object.keys(this.commonConfig).forEach((prop)=>{
@ -80,6 +114,7 @@
border:1px solid #e5e5e5;
.numContainer{
width: 2rem;
border-right:1px solid #e5e5e5;
.numTitle{
width: 100%;
height: 2.5rem;
@ -95,7 +130,7 @@
}
}
.draggableContainer{
width: calc(100% - 2rem);
/*width: calc(100% - 2rem);*/
overflow: auto;
.sonFormDraggble{
min-width: 100%;
@ -103,7 +138,7 @@
height:100%;
border-radius: 5px;
display: flex;
border-left:1px solid #e5e5e5;
/*border-left:1px solid #e5e5e5;*/
.tip{
position: absolute;
top: 0;

@ -0,0 +1,275 @@
<template>
<div class="son-form-filling-style">
<div v-if="data.props.showTitle" class="title-style" :style="{textAlign:son_label_alignment}">
{{data.props.label_prefix + data.field_name + data.props.label_suffix}}
</div>
<div v-if="canEdit && (data.props.add || data.props.multiple)" class="operate-container-style">
<a-button v-if="data.props.add" type="primary" class="btn-style" @click="addRecord"></a-button>
<a-button v-if="data.props.multiple" type="primary" class="btn-style" @click="onDeleteRecords"></a-button>
</div>
<a-table class="table-style" :rowSelection="canEdit && data.props.multiple && this.fieldData.props.data.length > 0?{selectedRowKeys:selectedRowKeys,columnWidth:60,
onChange:onSelectedChange,getCheckboxProps:setCheckboxProps}:null" :columns="columns" :pagination="false" :dataSource="tableData" rowKey="value_id"
:scroll="{x:true}" size="small">
<SonFieldItem slot="col" slot-scope="value,record" :item="value" :is_edit="!!(curEditItem && curEditItem.value_id === record.value_id)"/>
<template slot="operate" slot-scope="value,record,index">
<template v-if="canEdit">
<a-icon v-if="!curEditItem || curEditItem.value_id !== record.value_id" title="编辑" type="edit" class="operate-btn-style" @click="editData(record)"/>
<template v-else>
<a-icon title="保存" type="save" class="operate-btn-style" @click="onSave(record)"/>
<a-icon title="取消" type="close-circle" class="operate-btn-style" @click="onCancel(record)"/>
</template>
<a-icon v-if="index >= data.props.defaultLineCount" title="删除" type="delete" style="color:red;margin-right: 0" class="operate-btn-style" @click="onDelete(index)"/>
</template>
</template>
</a-table>
</div>
</template>
<script>
import {Button,Table,Icon,Modal} from 'ant-design-vue'
import GUID_UUID from '../../../global-llibs/guid-uuid'
import SonFieldItem from '../systemConfig/SonFieldItem'
import _ from 'lodash'
export default {
name: "SonFormFilling",
props:["fieldData","edit"],
data:function () {
return {
data:this.fieldData,
canEdit:this.edit !== false,
selectedRowKeys:[],
tableData:this.fieldData.props.tableData?this.fieldData.props.tableData:(this.fieldData.props.defaultLineCount === 0?[]:this.getDefaultTableData()),
columns:this.getColumns(),
curEditItem:null
}
},
components:{
// FieldItem,
AButton:Button,
ATable:Table,
AIcon:Icon,
SonFieldItem
// ShowAttachment,
},
methods:{
onDeleteRecords:function(){
if (this.selectedRowKeys.length === 0){
Modal.warning({
centered:true,
closable:true,
title:"批量删除失败",
content:"请选择需要删除的数据"
})
}else{
Modal.confirm({
centered:true,
closable:true,
title:"批量删除",
content:"确定删除已选数据吗?",
onOk:()=>{
this.selectedRowKeys.forEach((value_id)=>{
if (this.curEditItem && this.curEditItem.value_id === value_id){
this.curEditItem.isEdit = false;
this.curEditItem = null;
}
let index = this.tableData.findIndex((record)=>{return record.value_id === value_id});
if (index !== -1){
this.tableData.splice(index,1);
}
})
}
})
}
},
onDelete:function(index){
if (this.curEditItem && this.curEditItem.value_id === this.tableData[index].value_id){
this.curEditItem.isEdit = false;
this.curEditItem = null;
}
this.tableData.splice(index,1);
},
addRecord:function(){
if(this.fieldData.props.data && this.fieldData.props.data.length > 0){
if (this.curEditItem){
Modal.confirm({
centered:true,
closable:true,
title:'添加记录',
content:'当前有未保存的记录,是否保存?',
cancelText:'不保存',
okText:'保存',
onCancel:()=>{this.onAdd()},
onOk:()=>{this.onSave(this.curEditItem);this.onAdd()}
});
}else{
this.onAdd();
}
}
},
onAdd:function(){
let data = {
value_id:GUID_UUID.guid(),
}
this.fieldData.props.data.forEach((item)=>{
item.props.show_title = false;
data[item.id + "_json"] = _.cloneDeep(item);
data[item.id + "_json_copy"] = _.cloneDeep(item);
})
this.tableData.push(data);
data.isEdit = true;
this.curEditItem = data;
},
setCheckboxProps:function(record){
let index = this.tableData.findIndex((item)=>{return item.value_id === record.value_id});
return {
props:{
disabled:index === -1 || index < this.data.props.defaultLineCount
}
}
},
onSave:function(record){
this.fieldData.props.data.forEach((item)=>{
let field = record[item.id + "_json_copy"];
if (field.field_type === 3){
if (field.props.value !== ""){
field.dics_value = (field.props.datas.filter((f)=>{return f.dic_code === field.props.value})[0]).dic_value;
}else{
field.dics_value = "";
}
}else if (field.field_type === 4 || field.field_type === 6){
field.dics_value = ""
if (field.props.value){
if(this.TypesCheck.isArray(field.props.value)){
field.props.value.forEach((selected,index)=>{
field.dics_value += (field.props.datas.filter((f)=>{return f.dic_code === selected})[0]).dic_value;
if (index < field.props.value.length - 1){
field.dics_value += "";
}
});
}else{
field.dics_value += (field.props.datas.filter((f)=>{return f.dic_code === field.props.value})[0]).dic_value;
}
}
}else if (field.field_type === 15 || field.field_type === 25 || field.field_type === 26){
field.dics_value = field.props.default_value_name?field.props.default_value_name:"";
}else if (field.field_type === 17 || field.field_type === 18){///
field.dics_value = "";
field.props.value.forEach((selected,index)=>{
field.dics_value += selected[field.field_type === 17?'name':'person_name'];
if (index < field.props.value.length - 1){
field.dics_value += "";
}
})
}
})
record.isEdit = false;
this.fieldData.props.data.forEach((item)=>{
record[item.id + "_json"] = _.cloneDeep(record[item.id + "_json_copy"]);
})
this.curEditItem = null;
},
onCancel:function(record){
this.fieldData.props.data.forEach((item)=>{
record[item.id + "_json_copy"] = _.cloneDeep(record[item.id + "_json"]);
})
record.isEdit = false;
this.curEditItem = null;
},
editData:function(record){
record.isEdit = true;
this.curEditItem = record;
},
getDefaultTableData:function(){
let defaultData = [];
if(this.fieldData.props.data && this.fieldData.props.data.length > 0){
for (let i = 0; i < this.fieldData.props.defaultLineCount; i++){
let data = {
value_id:GUID_UUID.guid(),
}
this.fieldData.props.data.forEach((item)=>{
item.props.show_title = false;
data[item.id + "_json"] = _.cloneDeep(item);
data[item.id + "_json_copy"] = _.cloneDeep(item);
})
defaultData.push(data);
}
}
return defaultData;
},
onSelectedChange:function (selectedRowKeys) {
this.selectedRowKeys = selectedRowKeys
},
getColumns:function(){
let ary = [];
if (this.fieldData.props.data && this.fieldData.props.data.length > 0){
if (this.fieldData.props.showLineNum){
ary.push({title:"序号",customRender:(text,record,index)=>{return index + 1},align:'center',width:60})
}
this.fieldData.props.data.forEach((item)=>{
let obj = {align:"center",title:item.props.label_prefix + item.field_name + item.props.label_suffix,dataIndex:item.id + "_json_copy",
scopedSlots:{customRender:"col"},slots:{title:"headerTitle"},width:item.field_type === 11?300:150};
ary.push(obj)
})
if (this.edit !== false){
ary.push({align:"center",title:"操作", scopedSlots:{customRender: 'operate'},width:64})
}
}
return ary
}
},
watch:{
fieldData:function (newData) {
// eslint-disable-next-line no-debugger
debugger;
this.data = newData;
this.tableData = newData.props.tableData?newData.props.tableData:(newData.props.defaultLineCount === 0?[]:this.getDefaultTableData());
}
}
}
</script>
<style scoped lang="scss">
.son-form-filling-style{
width: 100%;
font-size: 0.875rem;
.title-style{
width: 100%;
height: 2.5rem;
display: flex;
align-content: center;
align-items: center;
}
.operate-container-style{
width: 100%;
height: 2.5rem;
display: flex;
align-content: center;
align-items: center;
justify-items: flex-end;
justify-content: flex-end;
.btn-style{
margin-left: 0.5rem;
font-size: 0.875rem;
height: 2rem;
}
}
.operate-btn-style{
font-size: 1rem;
color:#31a8fa;
cursor:pointer;
margin-right: 0.2rem;
}
/deep/.ant-table-body{
overflow-y: hidden;
}
}
</style>

@ -31,7 +31,7 @@
</div>
</div>
<!-- <template v-if="is_loading === false">-->
<div class="clearfix" :style="showScroll?{height: businessType !== 2 ? 'calc(100% - 4rem)':'100%'}:null">
<div v-if="is_loading===false" class="clearfix" :style="showScroll?{height: businessType !== 2 ? 'calc(100% - 4rem)':'100%'}:null">
<vue-scroll v-if="showScroll" :ops="ops">
<div :style="{float:'left',width:isShowOperate?'65%':'100%',padding:'1rem 0'}">
<view-form :fieldsList="field_list?field_list:[]" :form_width="form_config?form_config.form_width:100" :is_edit="type < 3"/>
@ -74,6 +74,7 @@
import ModalPanel from '../../../components/common/modal/ModalPanel'
import ApprovalComment from '../approve/ApprovalComment'
import CommonOperate from '../utils/commonOperate'
import GUID_UUID from '../../../global-llibs/guid-uuid'
/*
* @props
* pageType 1新建 2编辑 3查看 4审批
@ -357,36 +358,119 @@
return false;
}
},
submitFormData:function(){
testFormData:function(){
let b = true;
for (let i = 0; i < this.field_list.length; i++){
let item = this.field_list[i];
if (item.is_input_field === 1 && item.field_must_input === 1){//
if(this.isEmptyValue(item.props.value)){
if (item.tag !== "son_form"){
if (item.is_input_field === 1 && item.field_must_input === 1){//
if(this.isEmptyValue(item.props.value)){
Modal.warning({
centered:true,
title:"提交提示",
content:"请填写“" + item.field_name + "”后再提交"
})
b = false;
break;
}
}
}else{
if (item.props.tableData.some((data)=>{return data.isEdit === true})){
Modal.warning({
centered:true,
title:"提交提示",
content:"请填写“" + item.field_name + "”后再提交"
content:"当前有子表单存在编辑状态的数据,请保存数据后再提交"
})
b = false;
break;
}else{
for (let j = 0; j < item.props.tableData.length; j++){//
let rowData = item.props.tableData[j];
for (let k = 0; k < item.props.data.length; k++){
let fieldData = rowData[item.props.data[k].id + "_json"];
if (fieldData.is_input_field === 1 && fieldData.field_must_input === 1){
if(this.isEmptyValue(fieldData.props.value)){
Modal.warning({
centered:true,
title:"提交提示",
content:"请填写子表单中“" + fieldData.field_name + "”后再提交"
})
b = false;
break;
}
}
}
if (b === false){
break;
}
}
}
}
}
// this.field_list.forEach((item)=>{
// if (item.is_input_field === 1 && item.field_must_input === 1){//
// if(this.isEmptyValue(item.props.value)){
// Modal.warning({
// title:"",
// content:"" + item.field_name + ""
// })
//
// b = false
// }
// }
// });
return b;
},
if (b === false){
getSubmitDatas:function(item,obj){
let type = parseInt(item.field_type)
if (item.is_input_field === 1 && type !== 27){//,
if(type === 3){//
obj[item.column_name] = this.isEmptyValue(item.props.value)?"":"DICS#" + item.props.value + "!" +
(item.props.datas.filter((f)=>{return f.dic_code === item.props.value})[0]).dic_value;
}else if (type === 4 || type === 6){//
if(this.isEmptyValue(item.props.value)){
obj[item.column_name] = "";
}else{
obj[item.column_name] = "DICS#";
if(TypesCheck.isArray(item.props.value)){
item.props.value.forEach((selected,index)=>{
obj[item.column_name] += selected + "!" + (item.props.datas.filter((f)=>{return f.dic_code === selected})[0]).dic_value;
if (index < item.props.value.length - 1){
obj[item.column_name] += "+";
}
});
}else{
obj[item.column_name] += item.props.value + "!" +
(item.props.datas.filter((f)=>{return f.dic_code === item.props.value})[0]).dic_value;
}
}
}else if (type === 15 || type === 25 || type === 26){
if(this.isEmptyValue(item.props.value)){
obj[item.column_name] = "";
}else{
obj[item.column_name] = "DICS#";
let ary = item.props.default_value_name.split("");
item.props.value.forEach((selected,index)=>{
obj[item.column_name] += selected + "!" + ary[index];
if (index < item.props.value.length - 1){
obj[item.column_name] += ",";
}
})
}
}else if (type === 8 || type === 9 || type ===10){
if(item.props.value && this.TypesCheck.isArray(item.props.value) && item.props.value.length > 0){
obj[item.column_name] = JSON.stringify(item.props.value);
}else{
obj[item.column_name] = "";
}
}else if (type === 17 || type === 18){///
if(this.isEmptyValue(item.props.value)){
obj[item.column_name] = "";
}else{
obj[item.column_name] = "";
item.props.value.forEach((selected,index)=>{
obj[item.column_name] += selected[type === 17?'id':'person_id'] + "!" + selected[type === 17?'name':'person_name'];
if (index < item.props.value.length - 1){
obj[item.column_name] += "+";
}
})
}
}else{
obj[item.column_name] = item.props.value;
}
}
},
submitFormData:function(){
if (this.testFormData() === false){
return
}
@ -395,64 +479,21 @@
let dataValue = [{form_id:this.form_id,value_list:[]}]
let obj = {};
this.field_list.forEach((item)=>{
let type = parseInt(item.field_type)
if (item.is_input_field === 1 && type !== 27){//,
if(type === 3){//
obj[item.column_name] = this.isEmptyValue(item.props.value)?"":"DICS#" + item.props.value + "!" +
(item.props.datas.filter((f)=>{return f.dic_code === item.props.value})[0]).dic_value;
}else if (type === 4 || type === 6){//
if(this.isEmptyValue(item.props.value)){
obj[item.column_name] = "";
}else{
obj[item.column_name] = "DICS#";
if(TypesCheck.isArray(item.props.value)){
item.props.value.forEach((selected,index)=>{
obj[item.column_name] += selected + "!" + (item.props.datas.filter((f)=>{return f.dic_code === selected})[0]).dic_value;
if (index < item.props.value.length - 1){
obj[item.column_name] += "+";
}
});
}else{
obj[item.column_name] += item.props.value + "!" +
(item.props.datas.filter((f)=>{return f.dic_code === item.props.value})[0]).dic_value;
}
}
}else if (type === 15 || type === 25 || type === 26){
if(this.isEmptyValue(item.props.value)){
obj[item.column_name] = "";
}else{
obj[item.column_name] = "DICS#";
let ary = item.props.default_value_name.split("");
item.props.value.forEach((selected,index)=>{
obj[item.column_name] += selected + "!" + ary[index];
if (index < item.props.value.length - 1){
obj[item.column_name] += ",";
}
})
}
}else if (type === 8 || type === 9 || type ===10){
if(item.props.value && this.TypesCheck.isArray(item.props.value) && item.props.value.length > 0){
obj[item.column_name] = JSON.stringify(item.props.value);
}else{
obj[item.column_name] = "";
}
}else if (type === 17 || type === 18){///
if(this.isEmptyValue(item.props.value)){
obj[item.column_name] = "";
}else{
obj[item.column_name] = "";
item.props.value.forEach((selected,index)=>{
obj[item.column_name] += selected[type === 17?'id':'person_id'] + "!" + selected[type === 17?'name':'person_name'];
if (index < item.props.value.length - 1){
obj[item.column_name] += "+";
}
})
}
}else{
obj[item.column_name] = item.props.value;
if (item.tag === "son_form"){//
let sonFormData = {
form_id:item.child_form_id,
value_list:[],
}
}else if (type === 21 || type === 23 || type === 24 || type > 200){//
item.props.tableData.forEach((data)=>{
let sonObj = {};
item.props.data.forEach((title)=>{
this.getSubmitDatas(data[title.id + "_json"],sonObj);
});
sonFormData.value_list.push(sonObj)
})
dataValue.push(sonFormData);
}else{
this.getSubmitDatas(item,obj);
}
});
@ -545,7 +586,7 @@
filedList.forEach((field)=>{
let json = JSON.parse(field.field_json);
json.form_id = field.form_id;
json.child_form_id = field.form_id;
json.child_form_id = field.child_form_id;
let field_type = parseInt(json.field_type);
if (json.field_type === 1 && json.field_input_type === 2){//
if (json.filed_auto_input_info === "person_num"){
@ -565,18 +606,19 @@
this.getChildFormData(json,data.data_id,data.version_no)
}else{//
if (json.tag === "son_form"){//
json.props.data.tableData = [];
if (json.props.data.value > 0){//1
for(let i = 0; i < json.props.data.value; i++){
let data = {}
json.props.tableData = [];
if (json.props.defaultLineCount > 0){//1
for(let i = 0; i < json.props.defaultLineCount; i++){
let data = {value_id:GUID_UUID.guid()}
json.props.data.forEach((item)=>{
if (item.column_name && item.column_name !== ""){
data[item.column_name + "_json"] = _.cloneDeep(item)
}else{
data[item.id + "_json"] = _.cloneDeep(item)
}
// if (item.column_name && item.column_name !== ""){
// data[item.column_name + "_json"] = _.cloneDeep(item)
// }else{
data[item.id + "_json"] = _.cloneDeep(item);
data[item.id + "_json_copy"] = _.cloneDeep(item)
// }
})
json.props.data.tableData.push(data)
json.props.tableData.push(data)
}
}
}
@ -632,23 +674,28 @@
this.hasGetFormDataCount += 1;
if (json.tag === "son_form"){
let tableData = []
tableData.forEach((formData)=>{
let data = {}
result.data.form_data_list.forEach((formData)=>{
let data = {
value_id:formData.value_id
}
json.props.data.forEach((field)=>{
if (field.is_input_field === 1){
this.organizeData(field,formData);
}
if (field.column_name && field.column_name !== ""){
data[field.column_name + "_json"] = _.cloneDeep(field)
}else{
data[field.id + "_json"] = _.cloneDeep(field)
}
data[field.id + "_json"] = _.cloneDeep(field)
data[field.id + "_json_copy"] = _.cloneDeep(field)
// if (field.column_name && field.column_name !== ""){
// data[field.column_name + "_json"] = _.cloneDeep(field)
// }else{
// data[field.id + "_json"] = _.cloneDeep(field)
// }
})
tableData.push(data);
});
this.$set(json.props,"tableData",tableData)
this.$set(json.props,"tableData",tableData);
}
if (this.mainFormErgodicComplete === true && this.sonFormCount === this.hasGetFormDataCount){//
this.is_loading = false;

@ -5,21 +5,23 @@
backgroundColor:data.tag === 'input' && data.props.field_input_type === 2 ? '#f2f2f2':null}">
<div class="single-attribute-container-style">
<div class="attribute-title">标题内容</div>
<a-input placeholder="标题内容最多50个字符" :maxLength="50" :allowClear="true" :disabled="data.props.show_title === false"
<a-input placeholder="标题内容最多50个字符" :maxLength="50" :allowClear="true" :disabled="data.props.show_title === false && [23,230,231].every((num)=>{return num !== data.field_type})"
v-model="data.field_name"/>
<a-switch v-if="data.props.is_sonForm_field !== true" v-model="data.props.show_title" checkedChildren="显示" unCheckedChildren="隐藏" style="float: right;margin-top: 0.2rem" size="small"/>
<a-switch v-if="data.props.is_sonForm_field !== true" v-model="data.props.show_title" checkedChildren="显示" unCheckedChildren="隐藏"
style="float: right;margin-top: 0.2rem" size="small" :disabled="[21,22,24].some((num)=>{return num === data.field_type})"/>
</div>
<div v-if="data.props.is_sonForm_field !== true" class="single-attribute-container-style">
<div v-if="data.props.is_sonForm_field !== true && data.props.show_title === true" class="single-attribute-container-style">
<div class="attribute-title">标题宽度</div>
<a-slider :disabled="data.props.show_title === false" :min="1" :max="10" v-model="data.props.label_width"/>
</div>
<div v-if="data.props.is_sonForm_field !== true" class="single-attribute-container-style">
<div v-if="data.props.is_sonForm_field !== true && data.props.show_title === true" class="single-attribute-container-style">
<div class="attribute-title">标题对齐方式</div>
<a-radio-group default-value="flex-end" v-model="data.props.label_alignment" button-style="solid"
style="margin-bottom: 2rem">
style="margin-bottom: 2rem" :disabled="data.props.show_title === false">
<a-radio-button value="flex-end" style="padding: 0 10px;font-size: 0.75rem;">右对齐</a-radio-button>
<a-radio-button v-if="[23,231,230].some((num)=>{return num === data.field_type})" value="center" style="padding: 0 10px;font-size: 0.75rem;"></a-radio-button>
<a-radio-button value="flex-start" style="padding: 0 10px;font-size: 0.75rem;">左对齐</a-radio-button>
<a-radio-button value="top" style="padding: 0 10px;font-size: 0.75rem;">顶部对齐</a-radio-button>
<a-radio-button v-if="[23,231,230].every((num)=>{return num !== data.field_type})" value="top" style="padding: 0 10px;font-size: 0.75rem;"></a-radio-button>
</a-radio-group>
</div>
<div v-if="data.props.is_sonForm_field !== true" class="single-attribute-container-style">
@ -29,8 +31,8 @@
<component :is="getSelfAttribute" :data="data" :form_id="formId"/>
<div class="single-attribute-container-style">
<div class="attribute-title">展示方式</div>
<a-checkbox v-model="data.props.is_read_only"></a-checkbox>
<a-checkbox v-model="data.props.is_disabled"></a-checkbox>
<a-checkbox v-if="[21,22,23,24].every((num)=>{return num !== data.field_type})" v-model="data.props.is_read_only"></a-checkbox>
<a-checkbox v-if="[21,22,23,24].every((num)=>{return num !== data.field_type})" v-model="data.props.is_disabled"></a-checkbox>
<a-checkbox v-model="data.props.is_hidden"></a-checkbox>
</div>
<div v-if="[20,21,22,23,24,27].every((num)=>{return num !== data.field_type})" class="single-attribute-container-style">

@ -1,31 +1,33 @@
<template>
<div :class="['field-item-style',{'select-style':(selected_id === fieldData.id || curItem.item.id === fieldData.id) && design},
{'sonForm-field-style':fieldData.props.is_sonForm_field === true}]" @click.stop="onSelect(fieldData)"
{'sonForm-field-style':fieldData.props.is_sonForm_field === true && design}]" @click.stop="onSelect(fieldData)"
:style="design?{backgroundColor:fieldData.props.is_hidden?'rgba(255,11,124,0.1)':''}:{display:fieldData.props.is_hidden && !design?'none':'block',
padding:'0.5rem 0 0 0',borderBottom:'1px solid #e5e5e5',margin:'0 0.5rem'}" :data-operate="design">
padding:'0.5rem 0 0 0',borderBottom:fieldData.field_type < 21 || fieldData.field_type > 24 ?'1px solid #e5e5e5':null,margin:'0 0.5rem'}" :data-operate="design">
<span v-if="fieldData.props.show_title === true || (design && fieldData.props.is_sonForm_field === true)"
class="label-style" ref="label" :style="{display:fieldData.props.label_alignment === 'top'?'flex':'inline-flex',
justifyContent:fieldData.props.label_alignment === 'top'?'flex-start':fieldData.props.label_alignment,width:fieldData.props.label_width + 'rem',
opacity:fieldData.props.is_disabled?'0.5':null}">
class="label-style" ref="label" :style="[23,230,231].some((num)=>{return num === fieldData.field_type})?{display:'flex',width:'100%',justifyContent:fieldData.props.label_alignment}:
{display:fieldData.props.label_alignment === 'top'?'flex':'inline-flex',justifyContent:fieldData.props.label_alignment === 'top'?'flex-start':fieldData.props.label_alignment,
width:fieldData.props.label_width + 'rem',opacity:fieldData.props.is_disabled?'0.5':null}">
<span v-if="fieldData.props.is_must === true" style="color:red">*</span>
{{fieldData.props.label_prefix + fieldData.field_name + fieldData.props.label_suffix}}
</span>
<div class="content-style" :style="{width:fieldData.props.show_title === false || fieldData.props.label_alignment === 'top'?'100%':
'calc((100% - ' + fieldData.props.label_width + 'rem) * ' + fieldData.props.content_width / 100 +')',paddingLeft:design?null:'0.5rem',marginBottom:design?null:'0.5rem',
<div class="content-style" :style="{width:[23,230,231].some((num)=>{return num === fieldData.field_type}) ? fieldData.props.content_width + '%':
(fieldData.props.show_title === false || fieldData.props.label_alignment === 'top'? fieldData.props.content_width + '%':
'calc((100% - ' + fieldData.props.label_width + 'rem) * ' + fieldData.props.content_width / 100 +')'),paddingLeft:design ||
fieldData.props.showTitle === false || [21,22,23,24,210,211,230,231,240,241].some((num)=>{return num === fieldData.field_type})?null:'0.5rem',marginBottom:design?null:'0.5rem',
pointerEvents:(design && fieldData.tag !== 'son_form') || (edit === false && (fieldData.field_type !== 9 && fieldData.field_type !== 10))?'none':null,borderLeft:design ||
fieldData.props.show_title === false?null:'1px solid #e5e5e5'}">
fieldData.props.show_title === false || [21,22,23,24,230,231,210,211,240,241].some((num)=>{return num === fieldData.field_type}) || fieldData.props.is_sonForm_field === true ?null:'1px solid #e5e5e5'}">
<!--表单设计-->
<template v-if="design">
<component :is="com" :field="fieldData" :disabled="true"></component>
</template>
<!--表单新建/查看/编辑-->
<template v-else>
<template v-if="edit === false"><!---->
<div v-if="fieldData.tag === 'son_form'"></div>
<component v-else-if="fieldData.field_type > 200 || fieldData.field_type === 22 || fieldData.field_type === 13 || fieldData.field_type === 14"
<SonFormFilling v-if="fieldData.tag === 'son_form'" :fieldData="fieldData" :edit="edit"></SonFormFilling>
<template v-else-if="edit === false"><!--查看-->
<component v-if="fieldData.field_type > 200 || fieldData.field_type === 22 || fieldData.field_type === 13 || fieldData.field_type === 14"
:is="com" :field="fieldData"></component>
<Upload v-else-if="fieldData.field_type === 9 || fieldData.field_type === 10" :type="fieldData.props.type" :title="fieldData.props.title" :option="fieldData.props.option" :multiple="fieldData.props.multiple"
:canDownload="fieldData.props.can_downLoad" :canUpload="false" :data="getUploadData()"/>
:canDownload="fieldData.props.can_downLoad" :canUpload="false" :fileData="getUploadData()"/>
<div v-else-if="fieldData.field_type === 1 || fieldData.field_type === 2 || fieldData.field_type === 5 || fieldData.field_type === 12
|| fieldData.field_type === 20 || fieldData.field_type === 27">
{{ fieldData.props.value }}
@ -35,10 +37,9 @@
<div v-else>{{getDicValue()}}</div>
</template>
<template v-else><!--/-->
<div v-if="fieldData.tag === 'son_form'"> </div>
<Upload v-else-if="fieldData.field_type === 9 || fieldData.field_type === 10" :type="fieldData.props.type"
<Upload v-if="fieldData.field_type === 9 || fieldData.field_type === 10" :type="fieldData.props.type"
:title="fieldData.props.title" :option="fieldData.props.option" :multiple="fieldData.props.multiple"
:canDownload="fieldData.props.can_downLoad" :canUpload="true" :data="getUploadData()"/>
:canDownload="fieldData.props.can_downLoad" :canUpload="true" :fileData="getUploadData()"/>
<component v-else :is="com" :field="fieldData"></component>
</template>
</template>
@ -63,6 +64,7 @@
import {curItem} from './fieldAndFormConfig'
import Upload from '../../../components/common/uploader/Upload'
import TypesCheck from '../../../global-llibs/under-score/types-check'
import SonFormFilling from '../fieldComponent/SonFormFilling'
const IconFont = Icon.createFromIconfontCN({
scriptUrl: '//at.alicdn.com/t/font_2363602_ovz7ocuydo.js',
});
@ -79,7 +81,8 @@
components: {
IconFont,
AIcon:Icon,
Upload
Upload,
SonFormFilling
},
data:function () {
return {

@ -50,7 +50,7 @@
<div class="itemOuterContainer" style="height: calc(100% - 3rem);padding: 0.5rem 0;background-color: #f2f2f2">
<vue-scroll :ops="ops" style="height:100%">
<draggable group="itemGroup" v-model="fieldsList" class="itemInnerContainer"
:style="{width:form_width !== 100 ? form_width + '%':'calc(100% - 1rem)',margin: '0 0.5rem',minHeight:draggableMinHeight}" handle=".move"
:style="{width:form_width !== 100 ? form_width + '%':'calc(100% - 1rem)',margin: '0 auto',minHeight:draggableMinHeight}" handle=".move"
filter=".no-field" forceFallback="true" chosenClass="chosen" ghostClass="ghost" @add="onAdd">
<FieldItem v-for="field in fieldsList" :key="field.id" :item="field" @delete="deleteRowData" @copy="copyRowData" :design="true"/>
<div v-if="fieldsList.length <= 0" class="no-field"></div>
@ -227,7 +227,7 @@ export default {
// console.log(e);
// console.log(list);
let tag = list[e.oldIndex].tag;
if (tag === "son_form" || tag === "table" || tag === "grid" || tag === "son_form"){
if (tag === "son_form" || tag === "table" || tag === "grid" || tag === "divider"){
this.fieldsList.forEach((item)=>{
if (item.tag === "son_form"){
// eslint-disable-next-line no-debugger
@ -271,13 +271,21 @@ export default {
// }
}
if (this.curItem.item.field_type <=24 && this.curItem.item.field_type >= 21){
this.curItem.item.props.show_title = false;
if (this.curItem.item.field_type === 23){//
this.curItem.item.props.label_alignment = "center"
}
}
this.selectedItem = this.curItem.item
this.$bus.emit("clickItem",this.curItem.item)
},
copyRowData: function (data) {
let copyRowData = _.cloneDeep(data[0]);
let index = this.fieldsList.findIndex((field)=>{return field.id === copyRowData.id})
copyRowData.id = copyRowData.tag + "_" + Common.getRandom(12);
this.fieldsList.push(copyRowData)
this.fieldsList.splice(index+1,0,copyRowData)
this.curItem.item = copyRowData;
this.selectedItem = this.curItem.item
this.$bus.emit("clickItem",copyRowData)
@ -518,6 +526,15 @@ export default {
stopTest = true;
break;
}
}else if ((item.field_type === 23 || item.field_type === 231) && item.props.data.length === 0){
Modal.warning({
title: '表单提交失败',
content:"子表单中必须至少包含一个字段",
okText:'我知道了',
centered:true
})
stopTest = true;
break;
}
if (item.props.max_length){

@ -0,0 +1,85 @@
<template>
<div class="field-item-style" :style="{display:fieldData.props.is_hidden?'none':'block',padding:'0',minHeight:0}">
<div class="content-style" style="width:100%;justify-content: center;justify-items: center">
<template v-if="edit === false"><!---->
<component v-if="fieldData.field_type > 200 || fieldData.field_type === 22 || fieldData.field_type === 13 || fieldData.field_type === 14"
:is="com" :field="fieldData"></component>
<Upload v-else-if="fieldData.field_type === 9 || fieldData.field_type === 10" :type="fieldData.props.type" :title="fieldData.props.title" :option="fieldData.props.option" :multiple="fieldData.props.multiple"
:canDownload="fieldData.props.can_downLoad" :canUpload="false" :fileData="getUploadData()" style="text-align: center"/>
<div v-else-if="fieldData.field_type === 1 || fieldData.field_type === 2 || fieldData.field_type === 5 || fieldData.field_type === 12
|| fieldData.field_type === 20 || fieldData.field_type === 27" style="text-align: center">
{{ fieldData.props.value }}
</div>
<div v-else-if="fieldData.field_type === 11" v-html="fieldData.props.value" style="padding-top: 0.65rem;text-align: center"></div>
<div v-else-if="fieldData.field_type === 8">头像</div>
<div v-else style="text-align: center">{{getDicValue()}}</div>
</template>
<template v-else><!--/-->
<Upload v-if="fieldData.field_type === 9 || fieldData.field_type === 10" :type="fieldData.props.type"
:title="fieldData.props.title" :option="fieldData.props.option" :multiple="fieldData.props.multiple"
:canDownload="fieldData.props.can_downLoad" :canUpload="true" :fileData="getUploadData()" style="text-align: center"/>
<component v-else :is="com" :field="fieldData"></component>
</template>
</div>
</div>
</template>
<script>
import {curItem} from './fieldAndFormConfig'
import Upload from '../../../components/common/uploader/Upload'
import TypesCheck from '../../../global-llibs/under-score/types-check'
/*
* props:
* item 每个组件数据
* design 是否为表单设计模式
* is_edit true 新建/编辑 false 查看 (非表单设计模式下的)
* */
export default {
name: "SonFieldItem",
props:["item","is_edit"],
components: {
Upload,
},
data:function () {
return {
fieldData:this.item,
url: this.item.el,
selected_id:"",
curItem,
edit:this.is_edit !== false
}
},
methods:{
getUploadData:function(){
return TypesCheck.isArray(this.fieldData.props.value)?this.fieldData.props.value:
(this.fieldData.props.value && TypesCheck.isString(this.fieldData.props.value)?JSON.parse(this.fieldData.props.value):[])
},
getDicValue:function () {
//
return this.fieldData.dics_value && this.fieldData.dics_value !==""?this.fieldData.dics_value:""
}
},
computed:{
com: function (){
// eslint-disable-next-line no-debugger
// let a = this
// let url ="Input.vue"
return () => import(`@/views/teacherInfo/fieldComponent/${this.url}`)
}
},
watch:{
is_edit:function (newData) {
this.edit = newData
},
item:function (newData) {
this.fieldData = newData
}
}
}
</script>
<style scoped lang="scss">
@import "style/fieldItem";
</style>

@ -0,0 +1,83 @@
<template>
<div>
<div class="single-attribute-container-style">
<div class="attribute-title">分隔线/</div>
<a-radio-group button-style="solid" v-model="attribute.props.type" @change="typeChange">
<a-radio-button :value="1" class="radio-button-style">分隔线</a-radio-button>
<a-radio-button :value="2" class="radio-button-style">分隔符</a-radio-button>
</a-radio-group>
</div>
<template v-if="attribute.props.type === 1">
<div class="single-attribute-container-style">
<div class="attribute-title">分隔线类型</div>
<a-radio-group button-style="solid" v-model="attribute.props.dashed" >
<a-radio-button :value="false" style="padding: 0 10px;font-size: 0.75rem;">实线</a-radio-button>
<a-radio-button :value="true" style="padding: 0 10px;font-size: 0.75rem;">虚线</a-radio-button>
</a-radio-group>
</div>
<div class="single-attribute-container-style">
<div class="attribute-title">分隔线标题</div>
<a-input v-model="attribute.props.value" placeholder="请输入分隔线标题" :maxLength="10" :allowClear="true"/>
</div>
<div class="single-attribute-container-style">
<div class="attribute-title">文本布局方式</div>
<a-radio-group button-style="solid" v-model="attribute.props.orientation" >
<a-radio-button value="left" style="padding: 0 10px;font-size: 0.75rem;">左对齐</a-radio-button>
<a-radio-button value="center" style="padding: 0 10px;font-size: 0.75rem;">中间对齐</a-radio-button>
<a-radio-button value="right" style="padding: 0 10px;font-size: 0.75rem;">右对齐</a-radio-button>
</a-radio-group>
</div>
<div class="single-attribute-container-style">
<div class="attribute-title">上边距</div>
<a-input-number :min="8" :step="1" v-model="attribute.props.marginTop"/>
</div>
<div class="single-attribute-container-style">
<div class="attribute-title">下边距</div>
<a-input-number :min="8" :step="1" v-model="attribute.props.marginBottom"/>
</div>
</template>
<div v-else class="single-attribute-container-style">
<div class="attribute-title">分隔符高度</div>
<a-input-number :min="40" :step="1" v-model="attribute.props.height"/>
</div>
</div>
</template>
<script>
import {Input,InputNumber} from 'ant-design-vue'
import ARadioGroup from 'ant-design-vue/es/radio/Group'
import ARadioButton from 'ant-design-vue/es/radio/RadioButton'
import 'ant-design-vue/es/radio/style/css'
export default {
name: "DividerAttribute",
props:["data"],
data: function(){
return {
attribute:this.data
}
},
components:{
ARadioGroup,
ARadioButton,
AInput:Input,
AInputNumber:InputNumber
},
methods:{
typeChange:function () {
if (this.attribute.props.type === 1){//线
this.attribute.props.value = "";
this.attribute.props.orientation = "center";
this.attribute.props.dashed = false;
this.attribute.props.marginTop = 8;
this.attribute.props.marginBottom = 8;
}else{
this.attribute.props.height = 40;
}
}
}
}
</script>
<style scoped lang="scss">
@import "style/attributeCommonStyle";
</style>

@ -19,7 +19,7 @@
<a-select style="margin-top: 0.5rem;width: 100%" :allowClear="true" :defaultActiveFirstOption="false"
:disabled="!attribute.props.data_source_form_id || attribute.props.data_source_form_id === ''"
placeholder="请选择数据来源字段" :showSearch="true" v-model="attribute.props.data_source_field_id"
optionFilterProp="children" @change="resourceFieldChange">
optionFilterProp="children">
<a-select-option v-for="field in fieldList" :key="field.field_id" :value="field.field_id">
{{ field.field_name }}
</a-select-option>

@ -10,19 +10,23 @@
</a-radio-group>
</div>
<div class="single-attribute-container-style">
<div class="attribute-title">添加多行</div>
<a-switch v-model="attribute.props.is_can_add" size="small"/>
<div class="attribute-title">操作</div>
<div class="clearfix">
<a-checkbox v-model="attribute.props.add" style="float:left"></a-checkbox>
<a-checkbox v-model="attribute.props.showLineNum" style="float:left;margin-left: 0"></a-checkbox>
<a-checkbox v-model="attribute.props.multiple" style="float:left;margin-left: 0"></a-checkbox>
</div>
</div>
<div class="single-attribute-container-style">
<div class="attribute-title">默认值</div>
<a-input-number :min="0" :step="1" v-model="attribute.props.value"/>
<a-input-number :min="0" :step="1" v-model="attribute.props.defaultLineCount"/>
<span style="margin-left: 0.2rem"></span>
</div>
</div>
</template>
<script>
import {InputNumber,Switch} from 'ant-design-vue';
import {InputNumber,Checkbox} from 'ant-design-vue';
import ARadioGroup from "ant-design-vue/es/radio/Group"
import ARadioButton from "ant-design-vue/es/radio/RadioButton"
import 'ant-design-vue/es/radio/style/css'
@ -36,9 +40,9 @@
},
components:{
AInputNumber:InputNumber,
ASwitch:Switch,
ARadioGroup,
ARadioButton
ARadioButton,
ACheckbox:Checkbox
},
methods:{
onChange: function (e) {

@ -90,7 +90,7 @@ export const advancedFields = [
props:{max_length:50,can_search:true,is_search:true,placeholder:"请选择",value:[],data_range:3,default_value_name:""}}, //data_range是数据范围 1:省市区 2省市 3
{ field_type: 23, field_name: '子表单',tag:"son_form",el:"SonForm.vue",attributeUrl:"SonFormAttribute",
props:{value:0,data:[],is_can_add:true,son_label_alignment:"center"}}
props:{defaultLineCount:0,data:[],add:true,son_label_alignment:"center",showLineNum:true,multiple:true,value:[]}}
]
export const businessFields = [
@ -113,6 +113,6 @@ export const businessFields = [
export const layoutFields = [
{ field_type: 24, field_name: '栅格',tag:"grid",content_width:100},
{ field_type: 21, field_name: '表格',tag:"table",content_width:100},
{ field_type: 22, field_name: '分割线',tag:"dividing_line",el:"DivideLine.vue",attributeUrl:"DivideLineAttribute",
props:{value:"",can_search:false,is_search:false,type:"horizontal",dashed:false,orientation:"center"}}
{ field_type: 22, field_name: '分隔线/符',tag:"divider",el:"Divider.vue",attributeUrl:"DividerAttribute",
props:{value:"",can_search:false,is_search:false,dashed:false,orientation:"center",type:1,marginTop:8,marginBottom:8,height:40}}
]

@ -46,6 +46,9 @@
align-content: center;
align-items: center;
//width: calc(100% - 6rem);
/deep/.w-e-text{
text-align: left;
}
}
.move{
position: absolute;

@ -20,11 +20,11 @@
{{getDictionaryValue(value)}}
</span>
<span slot="img" slot-scope="value" style="display:flex;justify-items: center;justify-content: center"><!--图片-->
<ShowAttachment v-if="value && value !== '' && value !== '[]'" :type="2" :img="getImg(value)" :file-list="getFileList(value)"
<ShowAttachment v-if="value && value !== '' && value !== '[]' && Array.isArray(JSON.parse(value))" :type="2" :img="getImg(value)" :file-list="getFileList(value)"
picture-width="8rem" picture-height="4.5rem" :badge-count="getBadgeCount(value)"/>
</span>
<span slot="attachment" slot-scope="value"><!--附件类型字段-->
<ShowAttachment v-if="value && value !== '' && value !== '[]'" :type="1" :file-list="getFileList(value)" :badge-count="getBadgeCount(value)"/>
<ShowAttachment v-if="value && value !== '' && value !== '[]' && Array.isArray(JSON.parse(value))" :type="1" :file-list="getFileList(value)" :badge-count="getBadgeCount(value)"/>
</span>
<span slot="editor" slot-scope="value" v-html="value"></span><!--//-->
<span slot="depart_person" slot-scope="value"><!--部门人员类型字段-->
@ -123,6 +123,8 @@
obj.scopedSlots = {"customRender":"depart_person"}
}else if(27 === type){
obj.scopedSlots = {"customRender":"associate"}
}else if (20 === type){
obj.scopedSlots = {"customRender":"label"}
}
ary.push(obj)
}

@ -24,11 +24,11 @@
{{getDictionaryValue(value)}}
</span>
<span slot="img" slot-scope="value" style="display:flex;justify-items: center;justify-content: center"><!--图片-->
<ShowAttachment v-if="value && value !== '' && value !== '[]'" :type="2" :img="getImg(value)" :file-list="getFileList(value)"
<ShowAttachment v-if="value && value !== '' && value !== '[]' && Array.isArray(JSON.parse(value))" :type="2" :img="getImg(value)" :file-list="getFileList(value)"
picture-width="8rem" picture-height="4.5rem" :badge-count="getBadgeCount(value)"/>
</span>
<span slot="attachment" slot-scope="value" style="text-align: center"><!--附件类型字段-->
<ShowAttachment v-if="value && value !== '' && value !== '[]'" :type="1" :file-list="getFileList(value)" :badge-count="getBadgeCount(value)"/>
<ShowAttachment v-if="value && value !== '' && value !== '[]' && Array.isArray(JSON.parse(value))" :type="1" :file-list="getFileList(value)" :badge-count="getBadgeCount(value)"/>
</span>
<span slot="editor" slot-scope="value" v-html="value"></span><!--//-->
<span slot="depart_person" slot-scope="value"><!--部门人员类型字段-->

@ -40,11 +40,11 @@
{{getDictionaryValue(value)}}
</span>
<span slot="img" slot-scope="value" style="display:flex;justify-items: center;justify-content: center"><!--图片-->
<ShowAttachment v-if="value && value !== '' && value !== '[]'" :type="2" :img="getImg(value)" :file-list="getFileList(value)"
<ShowAttachment v-if="value && value !== '' && value !== '[]' && Array.isArray(JSON.parse(value))" :type="2" :img="getImg(value)" :file-list="getFileList(value)"
picture-width="8rem" picture-height="4.5rem" :badge-count="getBadgeCount(value)"/>
</span>
<span slot="attachment" slot-scope="value"><!--附件类型字段-->
<ShowAttachment v-if="value && value !== '' && value !== '[]'" :type="1" :file-list="getFileList(value)" :badge-count="getBadgeCount(value)"/>
<ShowAttachment v-if="value && value !== '' && value !== '[]' && Array.isArray(JSON.parse(value))" :type="1" :file-list="getFileList(value)" :badge-count="getBadgeCount(value)"/>
</span>
<span slot="editor" slot-scope="value" v-html="value"></span><!--//-->
<span slot="depart_person" slot-scope="value"><!--部门人员类型字段-->

Loading…
Cancel
Save