Browse Source

1.修复移动端视频显示异常

2.实现移动端子表关联填充
lwx_v12
liwenxuan 4 weeks ago
parent
commit
64dcf37824
  1. 4
      src/components/formTable/formItemGroup.vue
  2. 12
      src/components/lowCode/assistant/associatedForms.vue
  3. 2
      src/components/lowCode/newFormItem.vue
  4. 122
      src/components/lowCode/tablePage.vue
  5. 8
      src/views/formTable/pageInfo.vue

4
src/components/formTable/formItemGroup.vue

@ -245,7 +245,7 @@ function asfValueChanged(val: any) {
let masterFillRoleFieldsArray = fillFieldsMaster.split(";");
//console.log(masterFillRoleFieldsArray)
masterFillRoleFieldsArray.forEach((item: any) => {
let itemArray = item.split("_");
let itemArray = item.split(/(?<!table)_/);
itemArray.splice(0, 1);
itemArray = itemArray.map((item1: any) => item1.split(":").pop());
@ -274,7 +274,7 @@ function asfValueChanged(val: any) {
getAsfTableFill(val.asfFormId, val.glbbddbd, val.currentVal, fillFieldsChild).then(
({ data }) => {
//console.log(data)
if (data && data.length > 0) {
if (data && data.length > 0 && data!="成功,没有相关数据") {
data.forEach((dataElement: any) => {
tables.forEach((tableItem: any) => {
if (dataElement.tableName == tableItem.name) {

12
src/components/lowCode/assistant/associatedForms.vue

@ -18,7 +18,7 @@
<script lang='ts' setup>
import request from '@/utils/axios/index'
import { AnalysisCss,AnalysisInputCss } from '@/api/common/cssInfo'
import { inject } from 'vue'
import { inject, watch } from 'vue'
import { FormList,FormItem } from "@/api/lowCode/form/type"
import {
formatNumber,
@ -140,6 +140,11 @@ function asfValueChanged() {
//emits("valueChanged", val)
}
watch(() => value1,(newVal:any) => {
asfValueChanged()
},{deep: true})
function asfValueChangedTable() {
let val = {
@ -155,6 +160,11 @@ function asfValueChangedTable() {
//emits("valueChangedTable", val)
}
watch(() => value2,(newVal:any) => {
asfValueChangedTable()
},{deep: true})
function getAsfDataTitles() {
let dataTitle = ''
//console.log(props)

2
src/components/lowCode/newFormItem.vue

@ -536,7 +536,7 @@ const judgeIsEdit = (key: string) => {
/>
<!--视频-->
<component
v-if="['videoUpAndPlay'].includes(data.type) && judgeIsShow(data.name)"
v-else-if="['videoUpAndPlay'].includes(data.type) && judgeIsShow(data.name)"
:types="type"
:is="currentComponent"
:data="data"

122
src/components/lowCode/tablePage.vue

@ -32,8 +32,8 @@ const tableDataNew = computed(() => {
// console.log("-----2---->",formProps.value.model[props.data.name])
// console.log("-----3---->",formProps.value.model)
// console.log("-----4---->",formProps.value)
console.log(formProps.value.model)
console.log(props.data.name)
/* console.log(formProps.value.model)
console.log(props.data.name) */
return formProps.value.model[props.data.name]
})
const type = computed(() => {
@ -43,6 +43,26 @@ const type = computed(() => {
const editDisabled = computed(() => {
return formProps.value.type === 2 && props.data.config?.editDisabled
})
const preFillFlag = computed(() => {
if(props.data.control.preFill){
if(props.data.control.preFill.asf==""){
return 0
}else{
if(props.data.control.preFill.ids.length>0){
return 1
}else{
return 0
}
}
}else{
return 1
}
})
const defaultOneFlag = ref(true)
if(type.value==1 && props.data.control.defaultOne==2){
defaultOneFlag.value = false
@ -104,9 +124,79 @@ function lookOrgAndManTreeFinish(){
},200)
}
}
/**
* 提取字符串中最后一个英文冒号后的内容无冒号则返回原字符串
* @param {string} str - 输入的字符串
* @returns {string} 最后一个冒号后的内容或原字符串
*/
function getAfterLastColon(str:string) {
//console.log(str)
//
if (typeof str !== 'string') {
//console.warn('');
str = String(str); //
}
//
const lastColonIndex = str.lastIndexOf(':');
// -1
if (lastColonIndex === -1 || lastColonIndex === str.length - 1) {
return str;
}
// +1
return str.slice(lastColonIndex + 1);
}
onMounted(()=>{
lookOrgAndManTreeFinish()
autoAddColumnOne()
if(props.type==1){
if(preFillFlag.value==1){
setTimeout(() => {
if(preFillFlag.value==1&&props.data.control.preFill&&props.data.control.preFill.ids){
let i = 0;
props.data.control.preFill?.ids.forEach((element:any) => {
addColumn()
//console.log(element)
if(i==0){
setTimeout(()=>{
let asfName = getAfterLastColon(props.data.control.preFill.asf)
//console.log(asfName)
tableDataNew.value[i]
tableDataNew.value[i][asfName] = element
i++
},10)
}else{
setTimeout(()=>{
let asfName = getAfterLastColon(props.data.control.preFill.asf)
//console.log(asfName)
tableDataNew.value[i]
tableDataNew.value[i][asfName] = element
i++
},200)
}
});
}
}, 700);
}else{
autoAddColumnOne()
}
}
})
@ -144,6 +234,12 @@ function autoAddColumnOne(){
}
/*
*/
function waitProvideFormPropsModelDo(){
setTimeout(()=>{
if(tableDataNew){
@ -153,7 +249,7 @@ function waitProvideFormPropsModelDo(){
}else{
waitProvideFormPropsModelDo
}
},200)
},400)
}
@ -162,14 +258,14 @@ const addColumn = () => {
console.log("如果编辑页禁用时--------->",tableDataNew.value) */
const temp: any = {}
if (props.data.list) {
console.log(props.data.list)
//console.log(props.data.list)
props.data.list.forEach((item: any) => {
if (item.name) {
temp[item.name] = item.control.modelValue
}
})
//console.log(temp)
//console.log(tableDataNew.value)
tableDataNew.value.push(jsonParseStringify(temp))
//console.log(tableDataNew.value)
addBtnFlag.value = false
@ -177,11 +273,11 @@ const addColumn = () => {
}
const addColumn2 = () => {
/* console.error("addColumn")
console.log("如果编辑页禁用时--------->", tableDataNew.value) */
//console.error("addColumn2")
//console.log("--------->", tableDataNew.value)
const temp: any = {}
if (props.data.list) {
//console.log(props.data.list)
//console.error(props.data.list)
props.data.list.forEach((item: any) => {
if (item.name) {
temp[item.name] = item.control.modelValue
@ -192,13 +288,13 @@ const addColumn2 = () => {
if (tableDataNew.value.length === 0) {
//
tableDataNew.value.push(jsonParseStringify(temp));
//console.log("", tableDataNew.value);
//console.error("", tableDataNew.value);
} else {
//
//console.log("");
//console.error("");
}
console.log(tableDataNew.value)
//console.log(tableDataNew.value)
addBtnFlag.value = false
}
}
@ -410,7 +506,7 @@ const emits = defineEmits<{
function asfValueChanged(val:any){
console.log("tablePage-asfValueChanged",val)
//console.log("tablePage-asfValueChanged",val)
emits("asfValueChanged",val)
}
</script>

8
src/views/formTable/pageInfo.vue

@ -252,10 +252,10 @@ const changeKeyVal = (key: any, val: any, type: any, attribute: any) => {
item.type = 3;
if (type == "checkbox") {
item.isCheckbox = true;
item.answers = val.map(String);
item.answers = val?val.map(String):[];
} else {
item.isCheckbox = false;
item.oneanswer = val.toString();
item.oneanswer = val?val.toString():"";
}
if (notAsA_BasisForJudgment.indexOf(type) === -1) {
isUpdateFlowChart = true;
@ -268,14 +268,14 @@ const changeKeyVal = (key: any, val: any, type: any, attribute: any) => {
factorid: key,
type: 3,
isCheckbox: true,
answers: val.map(String),
answers: val?val.map(String):[],
});
} else {
flowFactor.push({
factorid: key,
type: 3,
isCheckbox: false,
oneanswer: val.toString(),
oneanswer: val?val.toString():"",
});
}
isUpdateFlowChart = true;

Loading…
Cancel
Save