Browse Source

Merge branch 'lwx_15' of http://172.20.2.87:3000/herenshan112/hxgksystemapp into qin_v10_master

# Conflicts:
#	src/types/components.d.ts
lwx_15
超级管理员 1 year ago
parent
commit
669e88c2b0
  1. 9154
      node_modules/element-plus/es/components/slider/src/composables/use-slide.d.ts
  2. 12
      src/api/DesignForm/requestapi.ts
  3. 1
      src/api/DesignForm/tableButton.ts
  4. 3
      src/api/DesignForm/types.ts
  5. 12
      src/components/DesignForm/app/formPage.vue
  6. 97
      src/components/DesignForm/app/index.vue
  7. 12
      src/components/DesignForm/assembly/index.ts
  8. 142
      src/components/DesignForm/formControlAttr.vue
  9. 133
      src/components/DesignForm/formControlPropertiNew.vue
  10. 7
      src/components/DesignForm/public/form/form.vue
  11. 10
      src/components/DesignForm/public/form/formGroup.vue
  12. 46
      src/components/DesignForm/public/form/formItem.vue
  13. 97
      src/components/DesignForm/tableListPage/index.vue
  14. 17
      src/types/components.d.ts
  15. 28
      src/views/sysworkflow/lowcodepage/appFormList.vue
  16. 53
      src/views/sysworkflow/lowcodepage/appPage/appPageForm/openAppFormPage.vue
  17. 43
      src/views/sysworkflow/lowcodepage/appPage/appPageForm/pageForm.vue
  18. 3
      src/views/sysworkflow/lowcodepage/appPage/createAppFormPage.vue
  19. 16
      src/views/sysworkflow/lowcodepage/pageDesignes.vue
  20. 12
      src/views/sysworkflow/lowcodepage/pageFlow/appTableFlow.vue
  21. 15
      src/views/sysworkflow/lowcodepage/pageFlow/tableFlow.vue
  22. 49
      src/views/sysworkflow/lowcodepage/runApp/runAppForm.vue
  23. 79
      src/widget/associatedforms/associatedForms.vue
  24. 136
      src/widget/associatedforms/associatedFormsTinyace.vue
  25. 127
      src/widget/associatedforms/associatedFormsTinyaceRange.vue
  26. 7
      src/widget/associatedforms/index.vue

9154
node_modules/element-plus/es/components/slider/src/composables/use-slide.d.ts

File diff suppressed because it is too large

12
src/api/DesignForm/requestapi.ts

@ -545,6 +545,17 @@ export function afreshAppSubmit(data: any) {
});
}
//动态获取关联的系统字段数据作为单选下拉多选的选项
export function getFieldRecord(param1: any) {
return request({
url: '/javasys/lowCode/AssociatedForms/getFieldRecord',
method: 'post',
data: {
optionsValue3Field:param1
},
})
}
//获取数据库表字段
export function gainTableField(data: any) {
return request({
@ -559,6 +570,7 @@ export function gainListTableField(data: any) {
url: '/systemapi/customer_form/gainListTableField',
method: 'post',
data: data
});
}
//多视图数据处理

1
src/api/DesignForm/tableButton.ts

@ -1,4 +1,5 @@
export interface tableButton {
control: any;
id?: string;
name?: string;
field?: string;

3
src/api/DesignForm/types.ts

@ -103,7 +103,8 @@ export interface formData{
form: {
size: any;
name:any,
formName:any
formName:any,
dataTitle:any
};
config: any;
events?:any;

12
src/components/DesignForm/app/formPage.vue

@ -98,6 +98,7 @@ const emits = defineEmits<{
(e: 'change', val: any): void //
(e: 'update:issave', type: boolean): void
(e: 'closePage', type: string): void
(e: 'optionsValue3Get3', val: any,fieldName: string): void
}>()
const route = useRoute()
@ -689,6 +690,7 @@ const appFormSubmit = (params = {}) => {
}
return
}
console.log(params)
validate((valid: boolean, fields: any) => {
if (valid) {
const formatParams = Object.assign({}, fields, params)
@ -1025,6 +1027,14 @@ defineExpose({
// getEditData,
// submitEdit
})
function optionsValue3Get2(data: any,fieldName: string){
emits('optionsValue3Get3',data,fieldName)
}
</script>
<template>
<div class="common-layout">
@ -1067,7 +1077,7 @@ defineExpose({
}"
>
<FormGroup :tableinfo="formData.form" :numrun="numrun" :data="formData.list" />
<FormGroup :tableinfo="formData.form" :numrun="numrun" :data="formData.list" @optionsValue3Get2="optionsValue3Get2"/>
<slot></slot>
</el-form>

97
src/components/DesignForm/app/index.vue

@ -1,7 +1,7 @@
<!--
@ 作者: 秦东
@ 时间: 2024-06-03 13:23:59
@ 备注: App表单列表
@ 备注: App表单列表1
-->
<script lang='ts' setup>
import { json2string,objToStringify,string2json,stringToObj } from '@/utils/DesignForm/form'
@ -12,7 +12,7 @@ import { inputUnit,timeUnit,choiceUnit,switchUnit,orgUnit,checkboxUnit } from '@
import type { FormInstance, FormRules,ElNotification } from 'element-plus'
import { gainFormPageListCont } from '@/api/DesignForm/requestapi'
import { Picture,InfoFilled,QuestionFilled } from '@element-plus/icons-vue'
import request from '@/utils/request';
import { softDeletion,retractRunWorkFlow } from '@/api/taskapi/management'
@ -271,6 +271,7 @@ const handleSizeChange = (page: number) => {
const handleCurrentChange = (page: number) => {
getListData(page)
}
/**
@ 作者: 秦东
@ 时间: 2024-04-01 14:15:16
@ -303,7 +304,7 @@ const searchSend = reactive({
pagesize:state.pageSize,
searchData:json2string(props.searchData)
})
let asfDetails = []
/**
@ 作者: 秦东
@ 时间: 2024-04-01 15:51:32
@ -344,7 +345,75 @@ const getPageData = () => {
gainFormPageListCont(sendData)
.then((data)=>{
console.log("获取列表详细信息----------------->",data)
tableDataList.value = data.data.list
//liwenxuan start
let dataList = data
//console.log(dataList)
asfDetails = props.data.columns.filter((item: any) => {
return item.fieldClass=="associatedForms"
})
if(asfDetails.length>0){
//console.log(data.data.list)
//,asf
let asfQueryParams = []
for(let j = 0;j< asfDetails.length;j++){
let asfQueryParamsItem :any = {}
//console.log(asfDetails[j])
asfQueryParamsItem.formId = asfDetails[j].control.formid
asfQueryParamsItem.field = asfDetails[j].field
let asfToSelectIds = []
for(let i = 0;i<data.data.list.length;i++){
let asfMasterAndAsfId:any = {}
asfMasterAndAsfId.asfId = data.data.list[i][asfDetails[j].field]
asfMasterAndAsfId.asfMasterId = data.data.list[i].id
asfToSelectIds.push(asfMasterAndAsfId)
}
asfQueryParamsItem.asfToSelectIds = asfToSelectIds
asfQueryParams.push(asfQueryParamsItem)
}
let queryCount = 0
for(let i = 0;i<asfQueryParams[0].asfToSelectIds.length;i++){
if(asfQueryParams[0].asfToSelectIds[i].asfId!=""){
queryCount++
}
}
//console.log(asfQueryParams)
if(queryCount>0){
getAsfDataTitlesByIds(asfQueryParams).then(({ data }) => {
//console.log(data)
for(let i = 0;i<dataList.data.list.length; i++){
//console.log(dataList.data.list[i])
for(let j = 0;j<data.length;j++){
//console.log(data[j])
for(let n = 0;n<data[j].list.length;n++){
if(dataList.data.list[i].id==data[j].list[n].asfMasterId){
dataList.data.list[i][data[j].field] = data[j].list[n].label
}
//console.log(data[j].list[n])
}
}
}
tableDataList.value = dataList.data.list
});
}else{
tableDataList.value = data.data.list
}
}else{
tableDataList.value = data.data.list
}
//tableDataList.value = data.data.list
//liwenxuan end
state.total = data.data.total
state.loading = false;
})
@ -353,6 +422,15 @@ const getPageData = () => {
})
}
}
//liwenxuan start
function getAsfDataTitlesByIds(asfQueryParams: any[]) {
return request({
url: '/javasys/lowCode/AssociatedForms/getAsfDataTitlesByIds',
method: 'post',
data: asfQueryParams,
});
}
//liwenxuan end
onMounted(()=>{
getPageData()
})
@ -845,6 +923,17 @@ const tabsView = (val:any,types:number) => {
<template v-if="item.fieldClass=='baidumap'" #default="scope">
{{scope.row[scope.column.property]}}
</template>
<template v-if="item.fieldClass=='associatedForms'" #default="scope">
<el-button
key="primary"
type="primary"
link
@click="console.log(item);console.log(scope)"
>
{{scope.row[scope.column.property]}}
</el-button>
</template>
</el-table-column>
</template>
</el-table>

12
src/components/DesignForm/assembly/index.ts

@ -14,7 +14,7 @@ const selectOption: any = [
}*/
]
const config: { optionsType: number } = {
optionsType: 0 // 0固定 1数据源 2 接口字典
optionsType: 0 // 0固定 1数据源 2 接口字典 3系统表单字段
}
export default [
{
@ -753,9 +753,19 @@ export default [
modelValue: '',
hideConditionHtml: '',
hideConditionHtmlCopy: '',
hideGongShi:{
formulaHtml:'',
mathsFormula:'',
mathsString:'',
},
formid: '',
dataRangeConditionHtml: '',
dataRangeConditionHtmlCopy: '',
dataRangeGongShi:{
formulaHtml:'',
mathsFormula:'',
mathsString:'',
},
saveFlag: false,
asfasfLabel:'',
fillRoles: [

142
src/components/DesignForm/formControlAttr.vue

@ -1153,7 +1153,7 @@
//liwenxuan 20240508 checkbox start
let delflag = true
let breakFlag = 0
if(controlData.value.type === 'checkbox'){
if(controlData.value.type === 'checkbox'&& controlData.value.config.optionsType==0){
for(var i = 0;i < controlData.value.control.glxxszForCheckBox.length;i ++){
if(breakFlag>0){
break
@ -2034,6 +2034,7 @@ function formidChangedOptionsValue3(){
}
const associatedFormsCurrentFormFieldTree = ref<Tree[]>()
const associatedFormsCurrentFormFieldTreeNoTable = ref<Tree[]>()
const associatedFormsCurrentFormFieldTreeForGlxxsz = ref<Tree[]>()
let associatedFormsCurrentFormFieldTreeForGlxxszExceptSelf = ref<Tree[]>()
let resDataForGlxxszExceptself: any[] = []
@ -2047,6 +2048,7 @@ getAssociatedFormsCurrentFieldTree().then(({ data }) => {
//alert("cfid")
}else{
let resData = ref(data.children)
let resDataNoTable = JSON.parse(JSON.stringify(data.children))
//let rootid_ = data.value.label
associatedFormsCurrentFormFieldTree.value = [{
id: 'rootid_'+data.label,
@ -2056,6 +2058,15 @@ getAssociatedFormsCurrentFieldTree().then(({ data }) => {
treeAttrs: data.treeAttrs,
}]
resDataNoTable = resDataNoTable.filter((item: { type: string | null }) => item.type!="table")
associatedFormsCurrentFormFieldTreeNoTable.value = [{
id: 'rootid_'+data.label,
label: '当前表单-'+data.treeAttrs.show,
children: [...resDataNoTable],
treeAttrs: data.treeAttrs,
}]
let resDataForGlxxsz = ref(data.children.slice(8))
resDataForGlxxszExceptself = JSON.parse(JSON.stringify(resDataForGlxxsz.value));
@ -2263,9 +2274,20 @@ function aftTextChanged(str:string){
controlData.value.control.hideConditionHtml = str
}
function aftGongshiChanged(gongshi:any){
controlData.value.control.hideGongShi.formulaHtml = gongshi.formulaHtml
controlData.value.control.hideGongShi.mathsFormula = gongshi.mathsFormula
controlData.value.control.hideGongShi.mathsString = gongshi.mathsString
}
function aftTextChangedRange(str:string){
controlData.value.control.dataRangeConditionHtml = str
}
function aftGongshiChangedRange(gongshi:any){
controlData.value.control.dataRangeGongShi.formulaHtml = gongshi.formulaHtml
controlData.value.control.dataRangeGongShi.mathsFormula = gongshi.mathsFormula
controlData.value.control.dataRangeGongShi.mathsString = gongshi.mathsString
}
//asf
function asfhTextCancel(){
determine.value = false
@ -2436,54 +2458,64 @@ watch(()=>controlData.value.control,(newVal) => {
//radio,select
watch(()=>controlData.value.options, (changedOptions:any) => {
if(controlData.value.type === "radio" || controlData.value.type === "select"){
if(changedOptions.length===0){
//option
controlData.value.control.glxxsz = []
}else{
if(changedOptions.length < controlData.value.control.glxxsz.length){
//option
controlData.value.control.glxxsz = controlData.value.control.glxxsz.filter((item: { optionValue: any }) => changedOptions.find((bItem: { value: any }) => item.optionValue == bItem.value))
}else{
for(var i = 0; i < changedOptions.length; i++){
if(controlData.value.control.glxxsz[i]===undefined){
//option
controlData.value.control.glxxsz.push(
{
conditionField: controlData.value.name,
optionLabel: changedOptions[i].label,
optionValue: changedOptions[i].value,
tableIndex: i,
id: uuidv4().replaceAll('-','').toString(),
}
)
if(controlData.value.type === "radio" || controlData.value.type === "select"){
if(controlData.value.config.optionsType==0){
if(changedOptions.length===0){
//option
controlData.value.control.glxxsz = []
}else{
if(changedOptions.length < controlData.value.control.glxxsz.length){
//option
controlData.value.control.glxxsz = controlData.value.control.glxxsz.filter((item: { optionValue: any }) => changedOptions.find((bItem: { value: any }) => item.optionValue == bItem.value))
}else{
//option
controlData.value.control.glxxsz[i].optionLabel = changedOptions[i].label
controlData.value.control.glxxsz[i].optionValue = changedOptions[i].value
for(var i = 0; i < changedOptions.length; i++){
if(controlData.value.control.glxxsz[i]===undefined){
//option
controlData.value.control.glxxsz.push(
{
conditionField: controlData.value.name,
optionLabel: changedOptions[i].label,
optionValue: changedOptions[i].value,
tableIndex: i,
id: uuidv4().replaceAll('-','').toString(),
}
)
}else{
//option
controlData.value.control.glxxsz[i].optionLabel = changedOptions[i].label
controlData.value.control.glxxsz[i].optionValue = changedOptions[i].value
}
}
}
}
}
}else if(controlData.value.type === "checkbox"){
}
}else if(controlData.value.type === "checkbox"){
}
},{ deep: true })
function createRowForGlxxsz(){
controlData.value.control.glxxszForCheckBox.push(
{
conditionField: controlData.value.name,
selectedOptions:[],
showFields:[],
id: uuidv4().replaceAll('-','').toString(),
}
)
if(controlData.value.config.optionsType==0){
controlData.value.control.glxxszForCheckBox.push(
{
conditionField: controlData.value.name,
selectedOptions:[],
showFields:[],
id: uuidv4().replaceAll('-','').toString(),
}
)
}
}
function deleteRowForGlxxsz(row: { id: any }){
controlData.value.control.glxxszForCheckBox = controlData.value.control.glxxszForCheckBox.filter((item: { id: any }) => item.id!=row.id)
if(controlData.value.config.optionsType==0){
controlData.value.control.glxxszForCheckBox = controlData.value.control.glxxszForCheckBox.filter((item: { id: any }) => item.id!=row.id)
}
}
/* */
@ -2498,6 +2530,11 @@ function handleDetermineoptionsValue3(){
//liwenxuan20240426 end
function optionsTypeChanged(){
controlData.value.config.optionsFun = ''
controlData.value.options = []
}
@ -3122,13 +3159,13 @@ const disabledIstrue = (val:string) => {
</el-form-item>
</div>
</div>
<div v-if="showHide(['switch'],true)">
<el-button @click="handelGlxxszDialogSwitch">关联选项设置</el-button>
<div v-if="showHide(['switch'],true)&&controlData.config.optionsType==0">
<el-button @click="handelGlxxszDialogSwitch">关联选项设置</el-button>
</div>
<div v-if="showHide(['radio','select',],true)">
<div v-if="showHide(['radio','select',],true)&&controlData.config.optionsType==0">
<el-button @click="handelGlxxszDialog">关联选项设置</el-button>
</div>
<div v-if="showHide(['checkbox',],true)">
<div v-if="showHide(['checkbox',],true)&&controlData.config.optionsType==0">
<el-button @click="handelGlxxszDialogCheckbox">关联选项设置</el-button>
</div>
<div
@ -3157,7 +3194,7 @@ const disabledIstrue = (val:string) => {
<el-form-item label="选项数据源" class="form_cont">
<el-select
v-model="controlData.config.optionsType"
@change="controlData.config.optionsFun = ''"
@change="optionsTypeChanged"
>
<el-option :value="0" label="固定选项" />
<el-option :value="3" label="系统表单字段"/>
@ -3442,6 +3479,21 @@ const disabledIstrue = (val:string) => {
<el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
</el-upload>
</el-form-item>
<el-form-item class="form_cont">
数据标题
<el-tree-select
v-model="formData.dataTitle"
multiple
clearable
collapse-tags
:data="associatedFormsCurrentFormFieldTreeNoTable"
:render-after-expand="false"
style="width: 240px"
/>
</el-form-item>
<template v-if="!state.isSearch">
<el-divider content-position="left">接口数据事件</el-divider>
@ -3807,7 +3859,7 @@ const disabledIstrue = (val:string) => {
<el-main style="border: 1px solid gainsboro; padding: 3px;" class="associatedFormsHideDialogMain">
<div style="border: 1px solid gainsboro; height: 7%; border-bottom: 0px; padding-top: 3px; padding-left: 5px; background-color: #E6F3FE;">当满足以下条件时此控件隐藏</div>
<div id="associatedFormsHideEditArea" style="border: 1px solid gainsboro; height: 63%; border-bottom: 0px;">
<AssociatedFormsTinyace ref="aft" :aft-text="controlData.control.hideConditionHtml" :aft-text-copy = "controlData.control.hideConditionHtmlCopy" @text-change = "aftTextChanged"></AssociatedFormsTinyace>
<AssociatedFormsTinyace ref="aft" :aft-text="controlData.control.hideConditionHtml" :aft-text-copy = "controlData.control.hideConditionHtmlCopy" @text-change = "aftTextChanged" @gongshi-change = "aftGongshiChanged"></AssociatedFormsTinyace>
<!-- <div style="border: 1px solid #4189EF;width:90px;height:26px;border-radius: 3px;padding:2px;text-align: center;cursor:pointer;float: right;margin-top: -32px;margin-right: 5px;z-index:99999999;position: relative;">
<span style="color: #4189EF;font:6px;margin-right: 5px;">fx</span>插入函数
</div> -->
@ -3917,7 +3969,7 @@ const disabledIstrue = (val:string) => {
<el-main style="border: 1px solid gainsboro; padding: 3px;" class="associatedFormsHideDialogMain">
<div style="border: 1px solid gainsboro; height: 7%; border-bottom: 0px; padding-top: 3px; padding-left: 5px; background-color: #E6F3FE;">仅可选择符合以下条件的数据</div>
<div id="associatedFormsHideEditArea" style="border: 1px solid gainsboro; height: 63%; border-bottom: 0px;">
<AssociatedFormsTinyaceRange ref="aftRange" :aft-text="controlData.control.dataRangeConditionHtml" :aft-text-copy = "controlData.control.dataRangeConditionHtmlCopy" @text-change = "aftTextChangedRange"></AssociatedFormsTinyaceRange>
<AssociatedFormsTinyaceRange ref="aftRange" :aft-text="controlData.control.dataRangeConditionHtml" :aft-text-copy = "controlData.control.dataRangeConditionHtmlCopy" @text-change = "aftTextChangedRange" @gongshi-change = "aftGongshiChangedRange"></AssociatedFormsTinyaceRange>
<!-- <div style="border: 1px solid #4189EF;width:90px;height:26px;border-radius: 3px;padding:2px;text-align: center;cursor:pointer;float: right;margin-top: -32px;margin-right: 5px;z-index:99999999;position: relative;">
<span style="color: #4189EF;font:6px;margin-right: 5px;">fx</span>插入函数
</div> -->
@ -3991,7 +4043,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"

133
src/components/DesignForm/formControlPropertiNew.vue

@ -1201,7 +1201,7 @@ const delSelectOption = (index: number, type?: string) => {
//liwenxuan 20240508 checkbox start
let delflag = true
let breakFlag = 0
if(controlData.value.type === 'checkbox'){
if(controlData.value.type === 'checkbox'&& controlData.value.config.optionsType==0){
for(var i = 0;i < controlData.value.control.glxxszForCheckBox.length;i ++){
if(breakFlag>0){
break
@ -2076,6 +2076,7 @@ function formidChangedOptionsValue3(){
}
const associatedFormsCurrentFormFieldTree = ref<Tree[]>()
const associatedFormsCurrentFormFieldTreeNoTable = ref<Tree[]>()
const associatedFormsCurrentFormFieldTreeForGlxxsz = ref<Tree[]>()
let associatedFormsCurrentFormFieldTreeForGlxxszExceptSelf = ref<Tree[]>()
let resDataForGlxxszExceptself: any[] = []
@ -2089,20 +2090,30 @@ getAssociatedFormsCurrentFieldTree().then(({ data }) => {
//alert("cfid")
}else{
let resData = ref(data.children)
let resDataNoTable = JSON.parse(JSON.stringify(data.children))
//let rootid_ = data.value.label
associatedFormsCurrentFormFieldTree.value = [{
id: 'rootid_'+data.label,
//label: '',
label: '当前表单-'+data.treeAttrs.show,
children: [...resData.value],
treeAttrs: data.treeAttrs,
}]
resDataNoTable = resDataNoTable.filter((item: { type: string | null }) => item.type!="table")
associatedFormsCurrentFormFieldTreeNoTable.value = [{
id: 'rootid_'+data.label,
label: '当前表单-'+data.treeAttrs.show,
children: [...resDataNoTable],
treeAttrs: data.treeAttrs,
}]
let resDataForGlxxsz = ref(data.children.slice(8))
resDataForGlxxszExceptself = JSON.parse(JSON.stringify(resDataForGlxxsz.value));
// console.log(resDataForGlxxszExceptself)
@ -2305,9 +2316,20 @@ function aftTextChanged(str:string){
controlData.value.control.hideConditionHtml = str
}
function aftGongshiChanged(gongshi:any){
controlData.value.control.hideGongShi.formulaHtml = gongshi.formulaHtml
controlData.value.control.hideGongShi.mathsFormula = gongshi.mathsFormula
controlData.value.control.hideGongShi.mathsString = gongshi.mathsString
}
function aftTextChangedRange(str:string){
controlData.value.control.dataRangeConditionHtml = str
}
function aftGongshiChangedRange(gongshi:any){
controlData.value.control.dataRangeGongShi.formulaHtml = gongshi.formulaHtml
controlData.value.control.dataRangeGongShi.mathsFormula = gongshi.mathsFormula
controlData.value.control.dataRangeGongShi.mathsString = gongshi.mathsString
}
//asf
function asfhTextCancel(){
determine.value = false
@ -2479,30 +2501,32 @@ watch(()=>controlData.value.control,(newVal) => {
//radio,select
watch(()=>controlData.value.options, (changedOptions:any) => {
if(controlData.value.type === "radio" || controlData.value.type === "select"){
if(changedOptions.length===0){
//option
controlData.value.control.glxxsz = []
}else{
if(changedOptions.length < controlData.value.control.glxxsz.length){
//option
controlData.value.control.glxxsz = controlData.value.control.glxxsz.filter((item: { optionValue: any }) => changedOptions.find((bItem: { value: any }) => item.optionValue == bItem.value))
if(controlData.value.config.optionsType==0){
if(changedOptions.length===0){
//option
controlData.value.control.glxxsz = []
}else{
for(var i = 0; i < changedOptions.length; i++){
if(controlData.value.control.glxxsz[i]===undefined){
//option
controlData.value.control.glxxsz.push(
{
conditionField: controlData.value.name,
optionLabel: changedOptions[i].label,
optionValue: changedOptions[i].value,
tableIndex: i,
id: uuidv4().replaceAll('-','').toString(),
}
)
}else{
//option
controlData.value.control.glxxsz[i].optionLabel = changedOptions[i].label
controlData.value.control.glxxsz[i].optionValue = changedOptions[i].value
if(changedOptions.length < controlData.value.control.glxxsz.length){
//option
controlData.value.control.glxxsz = controlData.value.control.glxxsz.filter((item: { optionValue: any }) => changedOptions.find((bItem: { value: any }) => item.optionValue == bItem.value))
}else{
for(var i = 0; i < changedOptions.length; i++){
if(controlData.value.control.glxxsz[i]===undefined){
//option
controlData.value.control.glxxsz.push(
{
conditionField: controlData.value.name,
optionLabel: changedOptions[i].label,
optionValue: changedOptions[i].value,
tableIndex: i,
id: uuidv4().replaceAll('-','').toString(),
}
)
}else{
//option
controlData.value.control.glxxsz[i].optionLabel = changedOptions[i].label
controlData.value.control.glxxsz[i].optionValue = changedOptions[i].value
}
}
}
}
@ -2514,18 +2538,22 @@ watch(()=>controlData.value.options, (changedOptions:any) => {
function createRowForGlxxsz(){
controlData.value.control.glxxszForCheckBox.push(
{
conditionField: controlData.value.name,
selectedOptions:[],
showFields:[],
id: uuidv4().replaceAll('-','').toString(),
}
)
if(controlData.value.config.optionsType==0){
controlData.value.control.glxxszForCheckBox.push(
{
conditionField: controlData.value.name,
selectedOptions:[],
showFields:[],
id: uuidv4().replaceAll('-','').toString(),
}
)
}
}
function deleteRowForGlxxsz(row: { id: any }){
controlData.value.control.glxxszForCheckBox = controlData.value.control.glxxszForCheckBox.filter((item: { id: any }) => item.id!=row.id)
if(controlData.value.config.optionsType==0){
controlData.value.control.glxxszForCheckBox = controlData.value.control.glxxszForCheckBox.filter((item: { id: any }) => item.id!=row.id)
}
}
/* */
@ -2542,6 +2570,13 @@ function handleDetermineoptionsValue3(){
//liwenxuan20240426 end
function optionsTypeChanged(){
controlData.value.config.optionsFun = ''
controlData.value.options = []
}
const optionsCss = [
@ -3172,13 +3207,13 @@ const disabledIstrue = (val:string) => {
</el-form-item>
</div>
</div>
<div v-if="showHide(['switch'],true)">
<div v-if="showHide(['switch'],true)&&controlData.config.optionsType==0">
<el-button @click="handelGlxxszDialogSwitch">关联选项设置</el-button>
</div>
<div v-if="showHide(['radio','select',],true)">
<div v-if="showHide(['radio','select',],true)&&controlData.config.optionsType==0">
<el-button @click="handelGlxxszDialog">关联选项设置</el-button>
</div>
<div v-if="showHide(['checkbox',],true)">
<div v-if="showHide(['checkbox',],true)&&controlData.config.optionsType==0">
<el-button @click="handelGlxxszDialogCheckbox">关联选项设置</el-button>
</div>
<div
@ -3207,7 +3242,7 @@ const disabledIstrue = (val:string) => {
<el-form-item label="选项数据源" class="form_cont">
<el-select
v-model="controlData.config.optionsType"
@change="controlData.config.optionsFun = ''"
@change="optionsTypeChanged"
>
<el-option :value="0" label="固定选项" />
<el-option :value="3" label="系统表单字段"/>
@ -3494,6 +3529,20 @@ const disabledIstrue = (val:string) => {
<el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
</el-upload>
</el-form-item>
<el-form-item class="form_cont">
数据标题
<el-tree-select
v-model="formData.dataTitle"
multiple
clearable
collapse-tags
:data="associatedFormsCurrentFormFieldTreeNoTable"
:render-after-expand="false"
style="width: 240px"
/>
</el-form-item>
<template v-if="!state.isSearch">
<el-divider content-position="left">接口数据事件</el-divider>
@ -3859,7 +3908,7 @@ const disabledIstrue = (val:string) => {
<el-main style="border: 1px solid gainsboro; padding: 3px;" class="associatedFormsHideDialogMain">
<div style="border: 1px solid gainsboro; height: 7%; border-bottom: 0px; padding-top: 3px; padding-left: 5px; background-color: #E6F3FE;">当满足以下条件时此控件隐藏</div>
<div id="associatedFormsHideEditArea" style="border: 1px solid gainsboro; height: 63%; border-bottom: 0px;">
<AssociatedFormsTinyace ref="aft" :aft-text="controlData.control.hideConditionHtml" :aft-text-copy = "controlData.control.hideConditionHtmlCopy" @text-change = "aftTextChanged"></AssociatedFormsTinyace>
<AssociatedFormsTinyace ref="aft" :aft-text="controlData.control.hideConditionHtml" :aft-text-copy = "controlData.control.hideConditionHtmlCopy" @text-change = "aftTextChanged" @gongshi-change = "aftGongshiChanged"></AssociatedFormsTinyace>
<!-- <div style="border: 1px solid #4189EF;width:90px;height:26px;border-radius: 3px;padding:2px;text-align: center;cursor:pointer;float: right;margin-top: -32px;margin-right: 5px;z-index:99999999;position: relative;">
<span style="color: #4189EF;font:6px;margin-right: 5px;">fx</span>插入函数
</div> -->
@ -3969,7 +4018,7 @@ const disabledIstrue = (val:string) => {
<el-main style="border: 1px solid gainsboro; padding: 3px;" class="associatedFormsHideDialogMain">
<div style="border: 1px solid gainsboro; height: 7%; border-bottom: 0px; padding-top: 3px; padding-left: 5px; background-color: #E6F3FE;">仅可选择符合以下条件的数据</div>
<div id="associatedFormsHideEditArea" style="border: 1px solid gainsboro; height: 63%; border-bottom: 0px;">
<AssociatedFormsTinyaceRange ref="aftRange" :aft-text="controlData.control.dataRangeConditionHtml" :aft-text-copy = "controlData.control.dataRangeConditionHtmlCopy" @text-change = "aftTextChangedRange"></AssociatedFormsTinyaceRange>
<AssociatedFormsTinyaceRange ref="aftRange" :aft-text="controlData.control.dataRangeConditionHtml" :aft-text-copy = "controlData.control.dataRangeConditionHtmlCopy" @text-change = "aftTextChangedRange" @gongshi-change = "aftGongshiChangedRange"></AssociatedFormsTinyaceRange>
<!-- <div style="border: 1px solid #4189EF;width:90px;height:26px;border-radius: 3px;padding:2px;text-align: center;cursor:pointer;float: right;margin-top: -32px;margin-right: 5px;z-index:99999999;position: relative;">
<span style="color: #4189EF;font:6px;margin-right: 5px;">fx</span>插入函数
</div> -->
@ -4043,7 +4092,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"

7
src/components/DesignForm/public/form/form.vue

@ -84,6 +84,7 @@ const emits = defineEmits<{
(e: 'change', val: any): void //
(e: 'update:issave', type: boolean): void
(e: 'refresh'): void
(e: 'optionsValue3Get3', val: any,fieldName: string): void
}>()
const route = useRoute()
const router = useRouter()
@ -1587,6 +1588,10 @@ const submitEdit = (type: string, res: any) => {
}
}
function optionsValue3Get2(data: any,fieldName: string){
emits('optionsValue3Get3',data,fieldName)
}
defineExpose({
setOptions,
setValue,
@ -1616,7 +1621,7 @@ defineExpose({
}"
>
<FormGroup :tableinfo="formData.form" :numrun="numrun" :data="formData.list" />
<FormGroup :tableinfo="formData.form" :numrun="numrun" :data="formData.list" @optionsValue3Get2="optionsValue3Get2"/>
<slot></slot>
</el-form>

10
src/components/DesignForm/public/form/formGroup.vue

@ -35,6 +35,7 @@ const props = withDefaults(
}
)
let emits = defineEmits(['optionsValue3Get2']);
const store = useDesignFormStore() as any //
const formProps = inject(constFormProps, {}) as any
@ -352,6 +353,7 @@ const linksIf = (obj: FormList) => {
//
const injectBtnEvent:any = inject(constFormBtnEvent)
const clickBtn = (control: any) => {
console.log(control)
// 0: '',
// 1: '',
// 2: '',
@ -378,6 +380,10 @@ const getFormItemLableStyle = (ele: any) => {
}
}
function optionsValue3Get1(data: any,fieldName: string){
emits('optionsValue3Get2',data,fieldName)
}
</script>
<template>
<draggable
@ -571,7 +577,7 @@ const getFormItemLableStyle = (ele: any) => {
<AssociatedForms v-else-if="element.type === 'associatedForms'" :data="element" />
<AssociatedForms v-else-if="element.type === 'associatedForms'" :data="element" :form-props="formProps" :tablekey="props.tableinfo" />
<LowcodeImage v-else-if="element.type === 'lowcodeImage'" :data="element" />
<LowcodeTransfer v-else-if="element.type === 'lowcodeTransfer'" :data="element" />
@ -586,7 +592,7 @@ const getFormItemLableStyle = (ele: any) => {
<UrlLink v-else-if="element.type === 'urllink'" :data="element" />
<SerialNumber v-else-if="element.type === 'serialNumber'" :data="element" :tablekey="props.tableinfo.name" :numrun="props.numrun" />
<!--其他组件-->
<FormItem v-else :data="element" />
<FormItem v-else :data="element" @optionsValue3Get1="optionsValue3Get1"/>
<!--组件设计外功能框架-->
<template v-if="type === 5">

46
src/components/DesignForm/public/form/formItem.vue

@ -37,6 +37,8 @@ import TextImg from "@/assets/image/tinymce.png"
import { AnalysisCss,AnalysisInputCss } from '@/components/DesignForm/public/form/calculate/cssInfo.ts'
import request from '@/utils/request';
const props = withDefaults(
defineProps<{
data: FormList
@ -47,6 +49,7 @@ const props = withDefaults(
)
const emits = defineEmits<{
(e: 'update:modelValue', val: any): void
(e: 'optionsValue3Get1', val: any,fieldName: string): void
}>()
const route = useRoute()
const formProps = inject(constFormProps, {}) as any
@ -68,7 +71,7 @@ const control = computed(() => {
return props.data.control
// return props.data
})
const options = ref(props.data.options)
const options = ref(props.data.options)
//console.log("FormItem*********************************************************"+JSON.stringify(props.data))
const changeEvent = inject(constControlChange, '') as any
const updateModel = (val: any) => {
@ -187,6 +190,7 @@ const itemRules = computed(() => {
})
// data selectdata
const getAxiosOptions = debounce((data?: any) => {
//console.log(props.data)
const {
optionsType,
optionsFun,
@ -277,14 +281,50 @@ const getAxiosOptions = debounce((data?: any) => {
// console.log(res)
// })
}
}
}else if(optionsType === 3){//liwenxuan 20240611
/*
在这里请求后台获取字段
*/
getFieldRecord(props.data.control.optionsValue3Field).then(({ data }) => {
let fieldName = props.data.name
emits('optionsValue3Get1',data,fieldName)
})
}
setFormDict(formProps.value.dict) //
}
})
watch(
() => props.data.control.optionsValue3Field,
() => {
getAxiosOptions()
}
)
watch(
() => props.data.config.optionsType,
() => {
getAxiosOptions()
}
)
function getFieldRecord(param1: any) {
return request({
url: '/javasys/lowCode/AssociatedForms/getFieldRecord',
method: 'post',
data: {
optionsValue3Field:param1
},
});
}
watch(
() => formProps.value.model[sourceFunKey.value],
() => {
getAxiosOptions()
getAxiosOptions()
}
)
// customRulesrules

97
src/components/DesignForm/tableListPage/index.vue

@ -12,7 +12,7 @@ import { inputUnit,timeUnit,choiceUnit,switchUnit,orgUnit,checkboxUnit } from '@
import type { FormInstance, FormRules,ElNotification } from 'element-plus'
import { gainFormPageListCont } from '@/api/DesignForm/requestapi'
import { Picture,InfoFilled,QuestionFilled } from '@element-plus/icons-vue'
import request from '@/utils/request';
import { softDeletion,retractRunWorkFlow } from '@/api/taskapi/management'
@ -240,6 +240,7 @@ const selectionChange = (row: any) => {
@ 功能: 获取表格头内容
*/
const columnsFilter = computed(() => {
if (!state.columnsCheck?.length) {
return props.data.columns
} else {
@ -279,6 +280,7 @@ watch(()=>props.lookPageIsShow,(val:boolean)=>{
}
})
let asfDetails = []
/**
@ 作者: 秦东
@ -296,8 +298,74 @@ const getPageData = () => {
console.log("获取列表详细信息",sendData)
gainFormPageListCont(sendData)
.then((data)=>{
console.log("获取列表详细信息----------------->",data)
tableDataList.value = data.data.list
//console.log("----------------->",data)
//liwenxuan start
let dataList = data
//console.log(dataList)
asfDetails = props.data.columns.filter((item: any) => {
return item.fieldClass=="associatedForms"
})
if(asfDetails.length>0){
//console.log(data.data.list)
//,asf
let asfQueryParams = []
for(let j = 0;j< asfDetails.length;j++){
let asfQueryParamsItem :any = {}
//console.log(asfDetails[j])
asfQueryParamsItem.formId = asfDetails[j].control.formid
asfQueryParamsItem.field = asfDetails[j].field
let asfToSelectIds = []
for(let i = 0;i<data.data.list.length;i++){
let asfMasterAndAsfId:any = {}
asfMasterAndAsfId.asfId = data.data.list[i][asfDetails[j].field]
asfMasterAndAsfId.asfMasterId = data.data.list[i].id
asfToSelectIds.push(asfMasterAndAsfId)
}
asfQueryParamsItem.asfToSelectIds = asfToSelectIds
asfQueryParams.push(asfQueryParamsItem)
}
let queryCount = 0
for(let i = 0;i<asfQueryParams[0].asfToSelectIds.length;i++){
if(asfQueryParams[0].asfToSelectIds[i].asfId!=""){
queryCount++
}
}
//console.log(asfQueryParams)
if(queryCount>0){
getAsfDataTitlesByIds(asfQueryParams).then(({ data }) => {
//console.log(data)
for(let i = 0;i<dataList.data.list.length; i++){
//console.log(dataList.data.list[i])
for(let j = 0;j<data.length;j++){
//console.log(data[j])
for(let n = 0;n<data[j].list.length;n++){
if(dataList.data.list[i].id==data[j].list[n].asfMasterId){
dataList.data.list[i][data[j].field] = data[j].list[n].label
}
//console.log(data[j].list[n])
}
}
}
tableDataList.value = dataList.data.list
});
}else{
tableDataList.value = data.data.list
}
}else{
tableDataList.value = data.data.list
}
//liwenxuan end
state.total = data.data.total
state.loading = false;
})
@ -308,6 +376,16 @@ const getPageData = () => {
onMounted(()=>{
getPageData()
})
//liwenxuan start
function getAsfDataTitlesByIds(asfQueryParams: any[]) {
return request({
url: '/javasys/lowCode/AssociatedForms/getAsfDataTitlesByIds',
method: 'post',
data: asfQueryParams,
});
}
//liwenxuan end
/**
@ 作者: 秦东
@ 时间: 2024-04-02 13:59:21
@ -553,7 +631,7 @@ const editFormSendFlow = (val:any) => {
content="折叠查询表单"
placement="bottom"
>
<el-button size="small" @click="config.searchIsShow=!config.searchIsShow" class="fa fa-search" />
<!-- <el-button size="small" @click="config.searchIsShow=!config.searchIsShow" class="fa fa-search" /> -->
</el-tooltip>
<el-tooltip
v-if="viewPage.list.status"
@ -747,6 +825,17 @@ const editFormSendFlow = (val:any) => {
<template v-if="item.fieldClass=='baidumap'" #default="scope">
{{scope.row[scope.column.property]}}
</template>
<template v-if="item.fieldClass=='associatedForms'" #default="scope">
<el-button
key="primary"
type="primary"
link
@click="console.log(item);console.log(scope)"
>
{{scope.row[scope.column.property]}}
</el-button>
</template>
</el-table-column>
</template>
</el-table>

17
src/types/components.d.ts

@ -29,6 +29,7 @@ declare module '@vue/runtime-core' {
DragControlApp: typeof import('./../components/DesignForm/dragControlApp.vue')['default']
DragControlNew: typeof import('./../components/DesignForm/dragControlNew.vue')['default']
ElAffix: typeof import('element-plus/es')['ElAffix']
ElAlert: typeof import('element-plus/es')['ElAlert']
ElAside: typeof import('element-plus/es')['ElAside']
ElAvatar: typeof import('element-plus/es')['ElAvatar']
ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb']
@ -38,6 +39,7 @@ declare module '@vue/runtime-core' {
ElCard: typeof import('element-plus/es')['ElCard']
ElCarousel: typeof import('element-plus/es')['ElCarousel']
ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem']
ElCascader: typeof import('element-plus/es')['ElCascader']
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup']
ElCol: typeof import('element-plus/es')['ElCol']
@ -62,6 +64,7 @@ declare module '@vue/runtime-core' {
ElImageViewer: typeof import('element-plus/es')['ElImageViewer']
ElInput: typeof import('element-plus/es')['ElInput']
ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
ElLink: typeof import('element-plus/es')['ElLink']
ElMain: typeof import('element-plus/es')['ElMain']
ElMenu: typeof import('element-plus/es')['ElMenu']
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
@ -69,6 +72,7 @@ declare module '@vue/runtime-core' {
ElPagination: typeof import('element-plus/es')['ElPagination']
ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm']
ElPopover: typeof import('element-plus/es')['ElPopover']
ElProgress: typeof import('element-plus/es')['ElProgress']
ElRadio: typeof import('element-plus/es')['ElRadio']
ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
@ -76,6 +80,7 @@ declare module '@vue/runtime-core' {
ElRow: typeof import('element-plus/es')['ElRow']
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
ElSelect: typeof import('element-plus/es')['ElSelect']
ElSelectV2: typeof import('element-plus/es')['ElSelectV2']
ElSlider: typeof import('element-plus/es')['ElSlider']
ElSpace: typeof import('element-plus/es')['ElSpace']
ElStep: typeof import('element-plus/es')['ElStep']
@ -92,6 +97,7 @@ declare module '@vue/runtime-core' {
ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem']
ElTimePicker: typeof import('element-plus/es')['ElTimePicker']
ElTooltip: typeof import('element-plus/es')['ElTooltip']
ElTransfer: typeof import('element-plus/es')['ElTransfer']
ElTree: typeof import('element-plus/es')['ElTree']
ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
ElUpload: typeof import('element-plus/es')['ElUpload']
@ -124,13 +130,24 @@ declare module '@vue/runtime-core' {
IEpCaretBottom: typeof import('~icons/ep/caret-bottom')['default']
IEpCaretTop: typeof import('~icons/ep/caret-top')['default']
IEpClose: typeof import('~icons/ep/close')['default']
IEpCollection: typeof import('~icons/ep/collection')['default']
IEpDelete: typeof import('~icons/ep/delete')['default']
IEpDownload: typeof import('~icons/ep/download')['default']
IEpEdit: typeof import('~icons/ep/edit')['default']
IEpMessageBox: typeof import('~icons/ep/message-box')['default']
IEpMinus: typeof import('~icons/ep/minus')['default']
IEpOperation: typeof import('~icons/ep/operation')['default']
IEpPicture: typeof import('~icons/ep/picture')['default']
IEpPlus: typeof import('~icons/ep/plus')['default']
IEpPosition: typeof import('~icons/ep/position')['default']
IEpRefresh: typeof import('~icons/ep/refresh')['default']
IEpRefreshLeft: typeof import('~icons/ep/refresh-left')['default']
IEpSearch: typeof import('~icons/ep/search')['default']
IEpSetting: typeof import('~icons/ep/setting')['default']
IEpTop: typeof import('~icons/ep/top')['default']
IEpUploadFilled: typeof import('~icons/ep/upload-filled')['default']
IEpUser: typeof import('~icons/ep/user')['default']
IEpView: typeof import('~icons/ep/view')['default']
LangSelect: typeof import('./../components/LangSelect/index.vue')['default']
LayoutPage: typeof import('./../components/DesignForm/layoutPage/index.vue')['default']
List: typeof import('./../components/DesignForm/public/form/components/list.vue')['default']

28
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";
@ -165,7 +165,7 @@ const closeAppPage = () =>{
*/
const lookFormList = (val:any) => {
emits('getRongQiAttr')
console.log("查看表单列表", val)
console.log("查看表单列表aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", val)
lookPageIsShow.value = true
state.formId = val.idStr
@ -173,7 +173,31 @@ const lookFormList = (val:any) => {
versionTitle.value = val.name
let stateData = string2json(val.listjson)
console.log(val.listjson)
console.log("查看表单列表---->",stateData)
//let holeControlAndConfigStateData = string2json(data.data.appForm.mastesformjson)
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

53
src/views/sysworkflow/lowcodepage/appPage/appPageForm/openAppFormPage.vue

@ -5,7 +5,7 @@
-->
<script lang='ts' setup>
import { json2string,objToStringify,string2json,stringToObj } from '@/utils/DesignForm/form'
import { gainAppPageInfo } from '@/api/DesignForm/requestapi'
import { gainAppPageInfo,getFieldRecord } from '@/api/DesignForm/requestapi'
import { Edit,Picture as IconPicture } from '@element-plus/icons-vue'
import { appPageDataInit,appWorkFlow } from "@/api/date/type"
@ -134,6 +134,7 @@ const handleAppPageClick = () =>{
}
/**
@ 作者: 秦东
@ 时间: 2024-05-20 16:15:54
@ -164,8 +165,41 @@ const gainAppFormPageInit = () =>{
versionTitle.value = data.data.appForm.name
if(data.data.pageList){
let stateData = string2json(data.data.appForm.listjson)
console.log("列表数据---》",stateData)
console.log("列表数据-2--》",data.data.appForm.listjson)
let holeControlAndConfigStateData = string2json(data.data.appForm.mastesformjson)
if(stateData.tableData.columns.length>0){
for(let i = 0;i<stateData.tableData.columns.length;i++){
for(let u = 0;u<holeControlAndConfigStateData.list.length;u++){
if(stateData.tableData.columns[i].id==holeControlAndConfigStateData.list[u].name){
stateData.tableData.columns[i].control = holeControlAndConfigStateData.list[u].control
stateData.tableData.columns[i].config = holeControlAndConfigStateData.list[u].config
}
}
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
}
}
}
})
}
}
}
stateList.tableData = stateData.tableData
stateList.searchData = stateData.searchData
stateList.loading = stateData.loading
@ -201,6 +235,18 @@ const gainAppFormPageInit = () =>{
}
}
function optionsValue3Get3(data: any,fieldName: string){
for(let i = 0; i < stateForm.formData.list.length; i++){
if(stateForm.formData.list[i].name==fieldName){
stateForm.formData.list[i].options = []
for(let j = 0;j<data.length;j++){
stateForm.formData.list[i].options.push(data[j])
}
}
}
}
defineExpose({
gainAppFormPageInit
})
@ -249,6 +295,7 @@ defineExpose({
:close-app-submit="closeAppSubmit"
:change-key-val="changeKeyVal"
:save-draft-page="saveDraftPage"
@optionsValue3Get3="optionsValue3Get3"
/>
</el-scrollbar>

43
src/views/sysworkflow/lowcodepage/appPage/appPageForm/pageForm.vue

@ -501,6 +501,47 @@ const versionPreviewPage = (val:string) => {
}
}
//liwenxuan bug: start
const formNameChanged = (param1: any)=>{
for(let i = 0; i < state.value.formData.list.length; i++){
if(state.value.formData.list[i].type=="radio"||state.value.formData.list[i].type=="select"||state.value.formData.list[i].type=="checkbox"){
if(state.value.formData.list[i].control.glxxsz!=undefined&&state.value.formData.list[i].control.glxxsz.length>0){
state.value.formData.list[i].control.glxxsz = []
state.value.formData.list[i].options.push({
label: '',
value: ''
})
state.value.formData.list[i].options.pop();
}
if(state.value.formData.list[i].control.glxxszForCheckBox!=undefined&&state.value.formData.list[i].control.glxxszForCheckBox.length>0){
state.value.formData.list[i].control.glxxszForCheckBox = []
}
}
}
ElMessage({
message: '因字段标识改变,本表单的所有单选、多选、下拉的关联选项设置已重置,请重新设置。',
type: 'warning',
})
}
//liwenxuan bug: end
function optionsValue3Get3(data: any,fieldName: string){
/* console.log(state.value.formData.list)
console.log(data)
console.log(fieldName) */
for(let i = 0; i < state.value.formData.list.length; i++){
if(state.value.formData.list[i].name==fieldName){
state.value.formData.list[i].options = []
for(let j = 0;j<data.length;j++){
state.value.formData.list[i].options.push(data[j])
}
}
}
}
</script>
<template>
<el-aside class="asideBox leftBox">
@ -529,6 +570,7 @@ const versionPreviewPage = (val:string) => {
:type="5"
:form-data="state.formData"
:dict="state.formDict"
@optionsValue3Get3="optionsValue3Get3"
/>
</div>
</el-main>
@ -544,6 +586,7 @@ const versionPreviewPage = (val:string) => {
:is-edit="isEdit"
:form-field="formFieldAry"
@open-dialog="openAceEditDrawer"
@form-name-change="formNameChanged"
/>
</el-aside>
<ace-drawer

3
src/views/sysworkflow/lowcodepage/appPage/createAppFormPage.vue

@ -73,7 +73,8 @@ const state = reactive<formStruct>({
form: {
size: 'default',
name:'',
formName: formConfigCont.formName
formName: formConfigCont.formName,
dataTitle: []
},
config: {
groupKey:props.groupKey

16
src/views/sysworkflow/lowcodepage/pageDesignes.vue

@ -623,6 +623,21 @@ function refreshFunc(){
index.value = index.value+1
}
function optionsValue3Get3(data: any,fieldName: string){
/* console.log(state.value.formData.list)
console.log(data)
console.log(fieldName) */
for(let i = 0; i < state.value.formData.list.length; i++){
if(state.value.formData.list[i].name==fieldName){
state.value.formData.list[i].options = []
for(let j = 0;j<data.length;j++){
state.value.formData.list[i].options.push(data[j])
}
}
}
}
</script>
<template>
@ -649,6 +664,7 @@ function refreshFunc(){
:type="5"
:form-data="state.formData"
:dict="state.formDict"
@optionsValue3Get3="optionsValue3Get3"
/>
</div>
</div>

12
src/views/sysworkflow/lowcodepage/pageFlow/appTableFlow.vue

@ -485,6 +485,17 @@ const initLoadData = () => {
}
}
function optionsValue3Get3(data: any,fieldName: string){
for(let i = 0; i < stateForm.formData.list.length; i++){
if(stateForm.formData.list[i].name==fieldName){
stateForm.formData.list[i].options = []
for(let j = 0;j<data.length;j++){
stateForm.formData.list[i].options.push(data[j])
}
}
}
}
</script>
<template>
<el-drawer v-model="drawerOpenOrClose" v-loading="loadingData" :title="versiontitle" :close-on-click-modal="false" :close-on-press-escape="false" :destroy-on-close="true" :size="drawbox" class="drawerClass" >
@ -502,6 +513,7 @@ const initLoadData = () => {
:version-id="versionid"
:after-submit="afterSubmit"
add-url="addData"
@optionsValue3Get3="optionsValue3Get3"
/>
</el-drawer>

15
src/views/sysworkflow/lowcodepage/pageFlow/tableFlow.vue

@ -62,7 +62,7 @@ const state = reactive<any>({
id: 0,
loading: true
})
const emits = defineEmits(["update:isopen","searchquery"]);
const emits = defineEmits(["update:isopen","searchquery","optionsValue3Get4"]);
const drawerOpenOrClose = computed({
get: () => props.isopen,
set: (val) => {
@ -408,6 +408,18 @@ const saveDraftPage = (type: string,val?:any) => {
}
closeAppSubmit()
}
function optionsValue3Get3(data: any,fieldName: string){
for(let i = 0; i < state.formData.list.length; i++){
if(state.formData.list[i].name==fieldName){
state.formData.list[i].options = []
for(let j = 0;j<data.length;j++){
state.formData.list[i].options.push(data[j])
}
}
}
}
</script>
<template>
<el-drawer v-model="drawerOpenOrClose" v-loading="loadingData" :title="versiontitle" :close-on-click-modal="false" :close-on-press-escape="false" :destroy-on-close="true" :size="drawbox" class="drawerClass" >
@ -452,6 +464,7 @@ const saveDraftPage = (type: string,val?:any) => {
:after-submit="afterSubmit"
:close-app-submit="closeAppSubmit"
:save-draft-page="saveDraftPage"
@optionsValue3Get3="optionsValue3Get3"
/>
</div>
</el-drawer>

49
src/views/sysworkflow/lowcodepage/runApp/runAppForm.vue

@ -5,7 +5,7 @@
-->
<script lang='ts' setup>
import { json2string,objToStringify,string2json,stringToObj } from '@/utils/DesignForm/form'
import { judgeSubmitCancel,gainAppPageInfo } from '@/api/DesignForm/requestapi'
import { judgeSubmitCancel,gainAppPageInfo,getFieldRecord } from '@/api/DesignForm/requestapi'
import { Edit,Picture as IconPicture } from '@element-plus/icons-vue'
import { appPageDataInit,appWorkFlow } from "@/api/date/type"
import { notAsA_BasisForJudgment,asAnApprovalActionControl,fixedValueControl,timeControl,timeEquation,submitButton, afreshSubmitButton } from '@/utils/workflow/const'
@ -149,7 +149,7 @@ const initLoadData = () => {
appFormTitle.value = props.pickAppMenu.label
gainAppPageInfo({id:props.pickAppMenu.id})
.then((data)=>{
console.log("获取初始化表单数据",data)
console.log("获取初始化表单数据bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",data)
appInitData.value = data.data
console.log("获取初始化表单数据---!",appInitData.value)
mastesformjson.value = data.data.appForm.mastesformjson
@ -171,6 +171,38 @@ const initLoadData = () => {
versionTitle.value = data.data.appForm.name
if(data.data.pageList){
let stateData = string2json(data.data.appForm.listjson)
let holeControlAndConfigStateData = string2json(data.data.appForm.mastesformjson)
if(stateData.tableData.columns.length>0){
for(let i = 0;i<stateData.tableData.columns.length;i++){
for(let u = 0;u<holeControlAndConfigStateData.list.length;u++){
if(stateData.tableData.columns[i].id==holeControlAndConfigStateData.list[u].name){
stateData.tableData.columns[i].control = holeControlAndConfigStateData.list[u].control
stateData.tableData.columns[i].config = holeControlAndConfigStateData.list[u].config
}
}
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
}
}
}
})
}
}
}
stateList.tableData = stateData.tableData
stateList.searchData = stateData.searchData
stateList.loading = stateData.loading
@ -223,6 +255,18 @@ watch(() => props.pickAppMenu,(val:any) => {
},{
deep: true
})
function optionsValue3Get3(data: any,fieldName: string){
for(let i = 0; i < stateForm.formData.list.length; i++){
if(stateForm.formData.list[i].name==fieldName){
stateForm.formData.list[i].options = []
for(let j = 0;j<data.length;j++){
stateForm.formData.list[i].options.push(data[j])
}
}
}
}
</script>
<template>
<el-row>
@ -257,6 +301,7 @@ watch(() => props.pickAppMenu,(val:any) => {
:sign-code="appInitData.signCode"
:version-id="appInitData.versionId"
add-url="addData"
@optionsValue3Get3="optionsValue3Get3"
/>
</el-card>

79
src/widget/associatedforms/associatedForms.vue

@ -1,15 +1,82 @@
<template>
<el-input v-model="input" style="width: 240px" placeholder="" />
<!-- <el-input v-model="input" style="width: 240px" placeholder="" /> -->
<el-select v-model="value1" placeholder="请选择" style="width: 240px" @change="asfValueChanged">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</template>
<script setup >
<script lang='ts' setup>
import request from '@/utils/request';
import { formProps } from 'element-plus';
</script>
import { FormItem, FormList } from '@/api/DesignForm/types'
/* const props = defineProps({
// eslint-disable-next-line vue/require-default-prop
data: {
type: Object,
},
formProps:{
type: Object,
},
tableKey:{
type: Object,
},
}) */
const props = withDefaults(
defineProps<{
data: FormList
formProps:Object
tablekey: any
}>(),
{}
)
const emits = defineEmits(["valueChanged"]);
const value1 = ref('')
<style>
const options = ref([])
onMounted(()=>{
console.log(props.data.control)
if(props.data.control.formid!=null&&props.data.control.formid!=""){
getAsfDataTitles().then(({ data }) => {
//console.log(data)
options.value = data
});
}
})
function asfValueChanged(){
emits("valueChanged",value1.value)
}
function getAsfDataTitles() {
let dataTitle = ''
if(props.tablekey.dataTitle!=null&&props.tablekey.dataTitle.length>0){
for(let i = 0;i<props.tablekey.dataTitle.length;i++){
dataTitle = dataTitle+props.tablekey.dataTitle[i]+"###"
}
}
return request({
url: '/javasys/lowCode/AssociatedForms/getAsfDataTitles',
method: 'post',
data: {
formId:props.data.control.formid,
dataTitle:dataTitle,
rangeFormula:props.data.control.dataRangeGongShi.mathsFormula,
rangeString:props.data.control.dataRangeGongShi.mathsString,
hideFormula:props.data.control.hideGongShi.mathsFormula,
hideString:props.data.control.hideGongShi.mathsString,
},
});
}
</script>
</style>
<style></style>

136
src/widget/associatedforms/associatedFormsTinyace.vue

@ -6,6 +6,7 @@ import "tinymce/models/dom"; // 特别注意 tinymce 6.0.0 版本之后必须引
import "tinymce/themes/silver/theme";
import Editor from "@tinymce/tinymce-vue"; //
import { v4 as uuidv4 } from "uuid";
import { ElMessage } from 'element-plus'
let onlyNumber = uuidv4().replaceAll('-','').toString(); //
@ -42,21 +43,135 @@ const props = defineProps({
},
})
let $emit = defineEmits(["textChange"]);
let $emit = defineEmits(["textChange","gongshiChange"]);
const tinymceHtml = ref("")
tinymceHtml.value = props.aftText
const tinymceBox = ref(null)
onMounted(() => {
tinymce.init({}); //
});
watch(()=>tinymceHtml.value, (val:any) => {
$emit('textChange',val);
},
$emit('textChange',val);
nextTick(()=>{
let formulaOne = [];
let formulaTwo = [];
tinymceBox.value.childNodes.forEach(element => {
element.childNodes.forEach(child => {
formulaOne.push(child.innerText?child.innerText:child.data)
if(child.dataset&&child.dataset.keyid){
formulaTwo.push(child.dataset.keyid)
}else{
formulaTwo.push(child.innerText?child.innerText:child.data)
}
})
});
let suanShitwo = formulaTwo.join('').replace(/\s+/g, "");
let gongShi ={
formulaHtml:tinymceBox.value.innerHTML,
mathsString:tinymceBox.value.innerText,
mathsFormula:suanShitwo,
}
$emit('gongshiChange',gongShi);
if(containsNewline(gongShi.mathsString)){
errorCondition("条件不允许换行")
}else if(!gongShi.formulaHtml.startsWith("<p><span")){
errorCondition("条件需以蓝色块开头")
}else if(gongShi.formulaHtml.endsWith("</span></p>")){
errorCondition("条件不能以蓝色块结尾")
}else if(countSpanTags(gongShi.formulaHtml)>1){
errorCondition("不允许出现多个蓝色块")
}else if(!containsSingleComparator(gongShi.mathsFormula)){
errorCondition("不存在有效符号")
}else if(checkEnding(gongShi.mathsFormula)){
errorCondition("不能以符号为结尾")
}else{
succCondition()
}
})
},
{ deep: true }
)
function checkEnding(str: string) {
const symbols = ['==', '>=', '>', '<=', '<', '!=', '='];
const trimmedStr = str.trim();
for (let symbol of symbols) {
if (trimmedStr.endsWith(symbol)) {
return true;
}
}
return false;
}
function containsSingleComparator(str: string) {
//
const comparators = ['==', '>=', '>', '<=', '<', '!='];
let found = false; //
let i = 0; //
while (i < str.length - 1) { //
//
for (const comparator of comparators) {
if (str.substr(i, comparator.length) === comparator) {
//
if (found) {
// false
return false;
}
found = true; //
//
i += comparator.length - 1;
break; //
}
}
i++; //
}
//
return found;
}
function containsComparator(str: string) {
if(str.includes("==")||str.includes("!=")||str.includes(">")||str.includes(">=")||str.includes("<")||str.includes("<=")){
return true
}else{
return false
}
}
const containsNewline = (str: string) => {
//console.log("Testing string:", str); //
return /\n/.test(str);
};
const countSpanTags = (str: string) => {
// 使<span>
const matches = str.match(/<span\b[^>]*>/gi);
// matchesnull0
//
return matches ? matches.length : 0;
};
function succCondition(){
ElMessage.closeAll()
ElMessage({
showClose: true,
message: '条件格式校验通过',
type: 'success',
duration:3500,
})
}
function errorCondition(str:string){
ElMessage.closeAll()
ElMessage({
showClose: true,
message: '条件格式错误 : '+str+' , 正确条件格式如 : 年龄==10',
type: 'error',
duration:3500,
})
}
const addIcon = (currentObject:any) =>{
@ -83,6 +198,7 @@ const focusEditor = ()=>{
}
defineExpose({
tinymceHtml,
addIcon,
@ -96,12 +212,20 @@ defineExpose({
</script>
<template >
<div >
<editor :id="onlyNumber" v-model="tinymceHtml" :init="tinymceInit"></editor>
<editor :id="onlyNumber" v-model="tinymceHtml" :init="tinymceInit" ></editor>
</div>
<div class="isHidde">
<div ref="tinymceBox" v-html="tinymceHtml"> </div>
</div>
</template>
<style lang='scss' scoped>
.isHidde{
display:none;
position: fixed;
z-index: 1;
margin-top: -10px
}
</style>

127
src/widget/associatedforms/associatedFormsTinyaceRange.vue

@ -42,11 +42,11 @@ const props = defineProps({
},
})
let $emit = defineEmits(["textChange"]);
let $emit = defineEmits(["textChange","gongshiChange"]);
const tinymceHtml = ref("")
tinymceHtml.value = props.aftText
const tinymceBox = ref(null)
onMounted(() => {
@ -54,9 +54,122 @@ onMounted(() => {
});
watch(()=>tinymceHtml.value, (val:any) => {
$emit('textChange',val);
nextTick(()=>{
let formulaOne = [];
let formulaTwo = [];
tinymceBox.value.childNodes.forEach(element => {
element.childNodes.forEach(child => {
formulaOne.push(child.innerText?child.innerText:child.data)
if(child.dataset&&child.dataset.keyid){
formulaTwo.push(child.dataset.keyid)
}else{
formulaTwo.push(child.innerText?child.innerText:child.data)
}
})
});
let suanShitwo = formulaTwo.join('').replace(/\s+/g, "");
let gongShi ={
formulaHtml:tinymceBox.value.innerHTML,
mathsString:tinymceBox.value.innerText,
mathsFormula:suanShitwo,
}
$emit('gongshiChange',gongShi);
if(containsNewline(gongShi.mathsString)){
errorCondition("条件不允许换行")
}else if(!gongShi.formulaHtml.startsWith("<p><span")){
errorCondition("条件需以蓝色块开头")
}else if(gongShi.formulaHtml.endsWith("</span></p>")){
errorCondition("条件不能以蓝色块结尾")
}else if(countSpanTags(gongShi.formulaHtml)>1){
errorCondition("不允许出现多个蓝色块")
}else if(!containsSingleComparator(gongShi.mathsFormula)){
errorCondition("不存在有效符号")
}else if(checkEnding(gongShi.mathsFormula)){
errorCondition("不能以符号为结尾")
}else{
succCondition()
}
})
},
{ deep: true }
)
function containsSingleComparator(str: string) {
//
const comparators = ['==', '>=', '>', '<=', '<', '!='];
let found = false; //
let i = 0; //
while (i < str.length - 1) { //
//
for (const comparator of comparators) {
if (str.substr(i, comparator.length) === comparator) {
//
if (found) {
// false
return false;
}
found = true; //
//
i += comparator.length - 1;
break; //
}
}
i++; //
}
//
return found;
}
function checkEnding(str: string) {
const symbols = ['==', '>=', '>', '<=', '<', '!=', '='];
const trimmedStr = str.trim();
for (let symbol of symbols) {
if (trimmedStr.endsWith(symbol)) {
return true;
}
}
return false;
}
function containsComparator(str: string) {
if(str.includes("==")||str.includes("!=")||str.includes(">")||str.includes(">=")||str.includes("<")||str.includes("<=")){
return true
}else{
return false
}
}
const containsNewline = (str: string) => {
//console.log("Testing string:", str); //
return /\n/.test(str);
};
const countSpanTags = (str: string) => {
// 使<span>
const matches = str.match(/<span\b[^>]*>/gi);
// matchesnull0
//
return matches ? matches.length : 0;
};
function errorCondition(str:string){
ElMessage.closeAll()
ElMessage({
showClose: true,
//message: ' : '+str+' , : ==10',
message: str,
type: 'error',
duration:3500,
})
}
function succCondition(){
ElMessage.closeAll()
ElMessage({
showClose: true,
message: '条件格式校验通过',
type: 'success',
duration:3500,
})
}
const addIcon = (currentObject:any) =>{
@ -99,10 +212,18 @@ defineExpose({
<div >
<editor :id="onlyNumber" v-model="tinymceHtml" :init="tinymceInit"></editor>
</div>
<div class="isHidde">
<div ref="tinymceBox" v-html="tinymceHtml"> </div>
</div>
</template>
<style lang='scss' scoped>
.isHidde{
display:none;
position: fixed;
z-index: 1;
margin-top: -10px
}
</style>

7
src/widget/associatedforms/index.vue

@ -14,7 +14,7 @@
<input v-model="value" type="hidden" >
</el-form-item>
<AssociatedForms :data="props.data"></AssociatedForms>
<AssociatedForms :data="props.data" :form-props="formProps" :tablekey="props.tablekey" @value-changed="valueChanged"></AssociatedForms>
</template>
<script lang='ts' setup>
import AssociatedForms from './associatedForms.vue';
@ -154,7 +154,12 @@ const formatCustomRules = () => {
const valueChanged = (val:any) =>{
console.log("关联表单选择--->",val)
value.value = val
}

Loading…
Cancel
Save