|
@@ -37,7 +37,7 @@
|
|
</template>
|
|
</template>
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<template v-if="detailType === 'detail'">
|
|
<template v-if="detailType === 'detail'">
|
|
- {{ tableFormData[scope.$index][cindex].value }}
|
|
|
|
|
|
+ {{ detailGetValue(tableFormData[scope.$index][cindex],head) }}
|
|
</template>
|
|
</template>
|
|
<template v-else>
|
|
<template v-else>
|
|
<!-- 单选框组 多选框组 都替换成下拉 并添加options -->
|
|
<!-- 单选框组 多选框组 都替换成下拉 并添加options -->
|
|
@@ -95,14 +95,18 @@
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
import relationTable from "@/components/Generator/components/RelationTable/index.vue";
|
|
import relationTable from "@/components/Generator/components/RelationTable/index.vue";
|
|
-import { dyOptionsList } from '@/components/Generator/generator/comConfig'
|
|
|
|
-import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
|
|
|
-import { previewDataInterface } from '@/api/systemData/dataInterface'
|
|
|
|
-import { deteleChildrenModel, deteleModel, getChildrenBrowserData, getChildrenConfigData, NewAddModel, NewupdateModel } from '@/api/onlineDev/visualDev'
|
|
|
|
|
|
+import {dyOptionsList} from '@/components/Generator/generator/comConfig'
|
|
|
|
+import {
|
|
|
|
+ deteleChildrenModel,
|
|
|
|
+ getChildrenBrowserData,
|
|
|
|
+ getChildrenConfigData,
|
|
|
|
+ NewupdateModel
|
|
|
|
+} from '@/api/onlineDev/visualDev'
|
|
import {deepClone, numberChinese} from '@/utils'
|
|
import {deepClone, numberChinese} from '@/utils'
|
|
import moment from 'moment/moment'
|
|
import moment from 'moment/moment'
|
|
-import { getAPIData, getTabelAPIData } from '@/components/Dataset-filter/util'
|
|
|
|
|
|
+import {getAPIData, getTabelAPIData} from '@/components/Dataset-filter/util'
|
|
import {dictDetail} from "@/api/newbi/dict";
|
|
import {dictDetail} from "@/api/newbi/dict";
|
|
|
|
+
|
|
export default {
|
|
export default {
|
|
name: 'input-table',
|
|
name: 'input-table',
|
|
components: {relationTable},
|
|
components: {relationTable},
|
|
@@ -566,6 +570,10 @@ export default {
|
|
additionalType.propsUrl = t.__config__.propsUrl
|
|
additionalType.propsUrl = t.__config__.propsUrl
|
|
additionalType.apiProps = t.__config__.apiProps
|
|
additionalType.apiProps = t.__config__.apiProps
|
|
}
|
|
}
|
|
|
|
+ if (t.__config__.jnpfKey === 'date'){
|
|
|
|
+ additionalType.defaultDay = t.defaultDay
|
|
|
|
+ additionalType.editChange = t.editChange
|
|
|
|
+ }
|
|
let res = {
|
|
let res = {
|
|
tag: t.__config__.tag,
|
|
tag: t.__config__.tag,
|
|
formId: t.__config__.formId,
|
|
formId: t.__config__.formId,
|
|
@@ -585,6 +593,13 @@ export default {
|
|
res.value = val ? val[relationColumn.primaryId] : null
|
|
res.value = val ? val[relationColumn.primaryId] : null
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ //默认当前时间
|
|
|
|
+ if (t.__config__.jnpfKey === 'date' && res.defaultDay) {
|
|
|
|
+ //添加默认时间 当前没有值时添加数据 允许编辑时更新 重新赋值
|
|
|
|
+ if (!res.value || res.editChange) {
|
|
|
|
+ res.value = moment().valueOf()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
// if (t.tag === 'el-upload') this.$set(res, 'value', t.defaultValue)
|
|
// if (t.tag === 'el-upload') this.$set(res, 'value', t.defaultValue)
|
|
return res
|
|
return res
|
|
})
|
|
})
|
|
@@ -711,6 +726,61 @@ export default {
|
|
});
|
|
});
|
|
this.$refs.relationTable.visible = false
|
|
this.$refs.relationTable.visible = false
|
|
},
|
|
},
|
|
|
|
+ // 子表详情展示数据过滤
|
|
|
|
+ detailGetValue(data,scheme){
|
|
|
|
+ // 日期选择器
|
|
|
|
+ if (data.tag === 'el-date-picker'){
|
|
|
|
+ let filterVal = data.value
|
|
|
|
+ if (filterVal && g.getLen(String(filterVal)) === 10) {
|
|
|
|
+ try {
|
|
|
|
+ filterVal = filterVal * 1000
|
|
|
|
+ } catch (e) {}
|
|
|
|
+ }
|
|
|
|
+ return filterVal
|
|
|
|
+ ? XEUtils.toDateString(filterVal,scheme.format) !== 'Invalid Date'
|
|
|
|
+ ? XEUtils.toDateString(filterVal,scheme.format)
|
|
|
|
+ : filterVal
|
|
|
|
+ : ''
|
|
|
|
+ }
|
|
|
|
+ // 时间选择器
|
|
|
|
+ if (data.tag === 'el-time-picker') {
|
|
|
|
+ let filterVal = data.value
|
|
|
|
+ try {
|
|
|
|
+ return filterVal
|
|
|
|
+ ? moment(Number(filterVal)).format(scheme.format) !== 'Invalid Date'
|
|
|
|
+ ? moment(Number(filterVal)).format(scheme.format)
|
|
|
|
+ : filterVal
|
|
|
|
+ : ''
|
|
|
|
+ } catch (e) {}
|
|
|
|
+ }
|
|
|
|
+ // 开关
|
|
|
|
+ if (data.tag === 'el-switch') {
|
|
|
|
+ if (data.value == scheme['active-value']) {
|
|
|
|
+ return scheme['active-text'] || '是'
|
|
|
|
+ } else {
|
|
|
|
+ return scheme['inactive-text'] || '否'
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // 下拉 多选 单选
|
|
|
|
+ if (['select', 'checkbox', 'radio'].includes(scheme.__config__.jnpfKey)){
|
|
|
|
+ if (data.ApiReturn && data.ApiReturn.length){
|
|
|
|
+ let activeObj = data.options.find(i=> i[data.apiProps.value] === data.value)
|
|
|
|
+ if (activeObj){
|
|
|
|
+ return activeObj[data.apiProps.label]
|
|
|
|
+ }else {
|
|
|
|
+ return data.value
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ let activeObj = data.options.find(i=> i[scheme.__config__.props.value] === data.value)
|
|
|
|
+ if (activeObj){
|
|
|
|
+ return activeObj[scheme.__config__.props.label]
|
|
|
|
+ }else {
|
|
|
|
+ return data.value
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return data.value
|
|
|
|
+ },
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|