Browse Source

获取字段作为选项v1.0

lwx_v12^2
liwenxuan 1 year ago
parent
commit
fc6f7684e3
  1. 2
      src/components/DesignForm/formControlAttr.vue
  2. 2
      src/components/DesignForm/formControlPropertiNew.vue
  3. 25
      src/views/sysworkflow/lowcodepage/appFormList.vue

2
src/components/DesignForm/formControlAttr.vue

@ -4002,7 +4002,7 @@ const disabledIstrue = (val:string) => {
<template v-if="controlData.type=='radio'||controlData.type=='select'">
<template v-if="(controlData.type=='radio'||controlData.type=='select')&&controlData.config.optionsType==0">
<el-table
:data="controlData.options" stripe border style="width: 100%;min-height:50px;max-height:500px;overflow-y:auto"

2
src/components/DesignForm/formControlPropertiNew.vue

@ -4032,7 +4032,7 @@ const disabledIstrue = (val:string) => {
<template v-if="controlData.type=='radio'||controlData.type=='select'">
<template v-if="(controlData.type=='radio'||controlData.type=='select')&&controlData.config.optionsType==0">
<el-table
:data="controlData.options" stripe border style="width: 100%;min-height:50px;max-height:500px;overflow-y:auto"

25
src/views/sysworkflow/lowcodepage/appFormList.vue

@ -5,7 +5,7 @@
-->
<script lang='ts' setup>
import { customerFormCont } from "@/api/DesignForm/type";
import { getCustomerFormList,editProductionFormStatus,appJwtPower } from '@/api/DesignForm/requestapi'
import { getCustomerFormList,editProductionFormStatus,appJwtPower,getFieldRecord } from '@/api/DesignForm/requestapi'
import {Delete,Edit,View,MoreFilled} from '@element-plus/icons-vue'
import { json2string,objToStringify,string2json,stringToObj } from '@/utils/DesignForm/form'
import { useUserStore } from "@/store/modules/user";
@ -175,6 +175,29 @@ const lookFormList = (val:any) => {
let stateData = string2json(val.listjson)
console.log(val.listjson)
console.log("查看表单列表---->",stateData)
if(stateData.tableData.columns.length>0){
for(let i = 0;i<stateData.tableData.columns.length;i++){
if(stateData.tableData.columns[i].config!=undefined && stateData.tableData.columns[i].control!=undefined){
console.log(stateData.tableData.columns[i])
let paramx:string = ""+stateData.tableData.columns[i].control.optionsValue3Field
/*
在这里请求后台获取字段
*/
getFieldRecord(paramx).then(({ data }) => {
stateData.tableData.columns[i].options = data
if(stateData.searchData.length>0){
for(let j = 0;j<stateData.searchData.length;j++){
console.log(stateData.searchData[j])
if(stateData.searchData[j].id==stateData.tableData.columns[i].id){
stateData.searchData[j].options = data
}
}
}
})
}
}
}
state.tableData = stateData.tableData
state.searchData = stateData.searchData
state.loading = stateData.loading

Loading…
Cancel
Save