Browse Source

修改时间显示规则

lwx_v4
超级管理员 1 year ago
parent
commit
bc0480e61b
  1. 138
      src/components/DesignForm/app/calendar/selectSearch.vue
  2. 67
      src/components/DesignForm/app/index.vue
  3. 2
      src/components/DesignForm/public/form/select.vue
  4. 64
      src/components/DesignForm/tableListPage/index.vue
  5. 16
      src/views/sysworkflow/lowcodepage/appPage/appPageForm/pageList.vue
  6. 1
      src/views/sysworkflow/lowcodepage/runApp/runAppForm.vue

138
src/components/DesignForm/app/calendar/selectSearch.vue

@ -0,0 +1,138 @@
<!--
@ 作者: 秦东
@ 时间: 2023-07-14 16:43:37
@ 备注:
-->
<script lang='ts' setup>
import { reactive, computed, watch, inject, ref } from 'vue'
import {
constFormProps,
constSetFormOptions,
objectToArray
} from '@/api/DesignForm/utils'
import { FormList } from '@/api/DesignForm/types'
const props = withDefaults(
defineProps<{
data: FormList
modelValue?: null
disabled?: boolean
transformOption: Function
options?: any
type?: string
isCheckbox?: boolean
remoteMethod?: Function
}>(),
{
options: () => {
return []
}
}
)
const emits = defineEmits<{
(e: 'change', val: string | number, name: string): void
(e: 'update:modelValue', val: any): void
}>()
const setOptionsList = ref()
const formProps = inject(constFormProps, {}) as any
const optionsList = computed(() => {
// 使setOptions使setOption
if (setOptionsList.value) {
return setOptionsList.value
}
if (props.type === 'slot') {
// input使
// formItemslotformItemgetAxiosOptions
const dictVal = formProps.value.dict
if (dictVal && props.data.config?.optionsType === 2) {
const opt = dictVal[props.data.config?.optionsFun]
if (opt !== undefined) {
return objectToArray(opt)
}
}
return props.data.options
} else {
return props.data.options
}
})
const formOptions = inject(constSetFormOptions, {}) as any
watch(
() => formOptions.value,
(val: any) => {
const opt = val[props.data.name]
if (val && opt !== undefined) {
setOptionsList.value = objectToArray(opt)
}
}
)
const value = computed({
get() {
if (props.type === 'slot') {
return formProps.value.model[props.data.name]
} else {
return props.modelValue
}
},
set(newVal: any) {
if (props.type === 'slot') {
emits('change', newVal, props.data.name)
} else {
emits('update:modelValue', newVal)
}
}
})
const state = reactive({
loading: false //
})
watch(
() => props.data.options,
() => {
state.loading = false
}
)
//
const isRemote = computed(() => {
return !!(
props.data.control?.remote &&
props.data.control?.filterable &&
props.data.config?.optionsType === 1 &&
props.data.config?.optionsFun
)
})
//
const remoteMethod = (name: string) => {
if (isRemote.value) {
state.loading = true
// 使config.queryName
const queryName = props.data.config?.queryName || 'name'
props.remoteMethod && props.remoteMethod({ [queryName]: name })
if (props.data.control.remoteMethod) {
props.data.control.remoteMethod(name)
}
}
}
</script>
<template>
<el-select
v-bind="data.control"
:disabled="disabled"
v-model="value"
clearable
:multiple ="props.isCheckbox"
:loading="state.loading"
:remoteMethod="remoteMethod"
class="selectWidth"
>
<el-option v-if="data.config?.addAll" value="" label="全部" />
<el-option
v-for="item in optionsList"
:key="item.value"
:label="item.label"
:value="transformOption(item.value, data.config?.transformData)"
/>
</el-select>
</template>
<style lang='scss' scoped>
.selectWidth{
min-width: 120px;
}
</style>

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

@ -15,7 +15,9 @@ import { Picture,InfoFilled,QuestionFilled } from '@element-plus/icons-vue'
import request from '@/utils/request'; import request from '@/utils/request';
import { softDeletion,retractRunWorkFlow } from '@/api/taskapi/management' import { softDeletion,retractRunWorkFlow } from '@/api/taskapi/management'
import {
formatNumber
} from '@/api/DesignForm/utils'
// //
@ -26,7 +28,8 @@ import CardPage from '@/components/DesignForm/app/cardPage.vue'
import GanttPageIng from '@/components/DesignForm/app/gannttPage.vue' import GanttPageIng from '@/components/DesignForm/app/gannttPage.vue'
import MapPage from '@/components/DesignForm/app/mapPage.vue' import MapPage from '@/components/DesignForm/app/mapPage.vue'
import CalendarPage from '@/components/DesignForm/app/calendar/calendar1/calendarPage.vue' import CalendarPage from '@/components/DesignForm/app/calendar/calendar1/calendarPage.vue'
import SearchSelect from '@/components/DesignForm/app/calendar/selectSearch.vue'
import AKSelect from '@/components/DesignForm/public/form/select.vue'
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
@ -166,9 +169,13 @@ const unitIsShow = (val:tableButton,unitName:string) => {
return checkboxUnit.includes(unitName); return checkboxUnit.includes(unitName);
break; break;
default: default:
return inputUnit.includes(unitName); if(val.fieldClass != "datePicker" && val.fieldClass != "timePicker"){
return inputUnit.includes(unitName);
}
break; break;
} }
return false;
} }
/** /**
@ -849,7 +856,11 @@ const judgeListTitle = (val:any,viewConfig:any) => {
} }
return false return false
} }
//
const transformOption = (val: string | number, type?: string) => {
return formatNumber(val)
}
</script> </script>
<template> <template>
<div ref="container" v-loading="state.loading" class="table-list-comm"> <div ref="container" v-loading="state.loading" class="table-list-comm">
@ -872,19 +883,13 @@ const judgeListTitle = (val:any,viewConfig:any) => {
:shortcuts="shortcuts" :shortcuts="shortcuts"
v-if="unitIsShow(item,'time')" v-if="unitIsShow(item,'time')"
/> />
<el-select <SearchSelect
v-model="item.value"
clearable
:placeholder="'请选择'+item.label"
v-if="unitIsShow(item,'radio')" v-if="unitIsShow(item,'radio')"
> :data="item"
<el-option :disabled="false"
v-for="itemOpt in item.options" :transform-option="transformOption"
:key="itemOpt.value" v-model:model-value="item.value"
:label="itemOpt.label" />
:value="itemOpt.value"
/>
</el-select>
<el-select <el-select
v-model="item.value" v-model="item.value"
clearable clearable
@ -902,20 +907,28 @@ const judgeListTitle = (val:any,viewConfig:any) => {
:value="item.inactiveValue" :value="item.inactiveValue"
/> />
</el-select> </el-select>
<el-select <SearchSelect
v-if="unitIsShow(item,'checkbox')"
:data="item"
:disabled="false"
:is-checkbox="true"
:transform-option="transformOption"
v-model:model-value="item.value"
/>
<el-date-picker
v-if="item.fieldClass == 'datePicker'"
v-model="item.value" v-model="item.value"
multiple :type="item.auxiliary"
clearable
:placeholder="'请选择'+item.label" :placeholder="'请选择'+item.label"
v-if="unitIsShow(item,'checkbox')" value-format="x"
> />
<el-option <el-time-picker
v-for="itemOpt in item.options" v-if="item.fieldClass == 'timePicker'"
:key="itemOpt.value" v-model="item.value"
:label="itemOpt.label" arrow-control
:value="itemOpt.value" :placeholder="'请选择'+item.label"
/> value-format="x"
</el-select> />
<el-select <el-select
v-model="item.value" v-model="item.value"
clearable clearable

2
src/components/DesignForm/public/form/select.vue

@ -50,7 +50,7 @@ const optionsList = computed(() => {
} }
return props.data.options return props.data.options
} else { } else {
return props.options return props.data.options
} }
}) })
const formOptions = inject(constSetFormOptions, {}) as any const formOptions = inject(constSetFormOptions, {}) as any

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

@ -15,7 +15,9 @@ import { Picture,InfoFilled,QuestionFilled } from '@element-plus/icons-vue'
import request from '@/utils/request'; import request from '@/utils/request';
import { softDeletion,retractRunWorkFlow } from '@/api/taskapi/management' import { softDeletion,retractRunWorkFlow } from '@/api/taskapi/management'
import {
formatNumber
} from '@/api/DesignForm/utils'
// //
import FormPageCont from '@/components/DesignForm/tableListPage/formPageCont.vue' import FormPageCont from '@/components/DesignForm/tableListPage/formPageCont.vue'
import TableFlow from '@/views/sysworkflow/lowcodepage/pageFlow/tableFlow.vue' import TableFlow from '@/views/sysworkflow/lowcodepage/pageFlow/tableFlow.vue'
@ -24,6 +26,7 @@ import CardPage from '@/components/DesignForm/app/cardPage.vue'
import GanttPage from '@/components/DesignForm/app/gannttPage.vue' import GanttPage from '@/components/DesignForm/app/gannttPage.vue'
import MapPage from '@/components/DesignForm/app/mapPage.vue' import MapPage from '@/components/DesignForm/app/mapPage.vue'
import CalendarPage from '@/components/DesignForm/app/calendar/calendar1/calendarPage.vue' import CalendarPage from '@/components/DesignForm/app/calendar/calendar1/calendarPage.vue'
import SearchSelect from '@/components/DesignForm/app/calendar/selectSearch.vue'
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
@ -161,7 +164,9 @@ const unitIsShow = (val:tableButton,unitName:string) => {
return checkboxUnit.includes(unitName); return checkboxUnit.includes(unitName);
break; break;
default: default:
return inputUnit.includes(unitName); if(val.fieldClass != "datePicker" && val.fieldClass != "timePicker"){
return inputUnit.includes(unitName);
}
break; break;
} }
} }
@ -839,6 +844,11 @@ const judgeListTitle = (val:any,viewConfig:any) => {
} }
return false return false
} }
//
const transformOption = (val: string | number, type?: string) => {
return formatNumber(val)
}
</script> </script>
<template> <template>
<div ref="container" v-loading="state.loading" class="table-list-comm"> <div ref="container" v-loading="state.loading" class="table-list-comm">
@ -862,19 +872,13 @@ const judgeListTitle = (val:any,viewConfig:any) => {
:shortcuts="shortcuts" :shortcuts="shortcuts"
v-if="unitIsShow(item,'time')" v-if="unitIsShow(item,'time')"
/> />
<el-select <SearchSelect
v-model="item.value"
clearable
:placeholder="'请选择'+item.label"
v-if="unitIsShow(item,'radio')" v-if="unitIsShow(item,'radio')"
> :data="item"
<el-option :disabled="false"
v-for="itemOpt in item.options" :transform-option="transformOption"
:key="itemOpt.value" v-model:model-value="item.value"
:label="itemOpt.label" />
:value="itemOpt.value"
/>
</el-select>
<el-select <el-select
v-model="item.value" v-model="item.value"
clearable clearable
@ -892,20 +896,28 @@ const judgeListTitle = (val:any,viewConfig:any) => {
:value="item.inactiveValue" :value="item.inactiveValue"
/> />
</el-select> </el-select>
<el-select <SearchSelect
v-if="unitIsShow(item,'checkbox')"
:data="item"
:disabled="false"
:is-checkbox="true"
:transform-option="transformOption"
v-model:model-value="item.value"
/>
<el-date-picker
v-if="item.fieldClass == 'datePicker'"
v-model="item.value" v-model="item.value"
multiple :type="item.auxiliary"
clearable
:placeholder="'请选择'+item.label" :placeholder="'请选择'+item.label"
v-if="unitIsShow(item,'checkbox')" value-format="x"
> />
<el-option <el-time-picker
v-for="itemOpt in item.options" v-if="item.fieldClass == 'timePicker'"
:key="itemOpt.value" v-model="item.value"
:label="itemOpt.label" arrow-control
:value="itemOpt.value" :placeholder="'请选择'+item.label"
/> value-format="x"
</el-select> />
<el-select <el-select
v-model="item.value" v-model="item.value"
clearable clearable

16
src/views/sysworkflow/lowcodepage/appPage/appPageForm/pageList.vue

@ -271,7 +271,7 @@ const jieForm = () => {
if(props.appPageKey != ""){ if(props.appPageKey != ""){
gainFormTableField({id:props.appPageKey.toString()}) gainFormTableField({id:props.appPageKey.toString()})
.then((data)=>{ .then((data)=>{
// console.log('--->',data) console.log('解析表单--->',data)
formTableField.masterTable=data.data.masterTable formTableField.masterTable=data.data.masterTable
formTableField.sunTable=data.data.sunTable formTableField.sunTable=data.data.sunTable
}) })
@ -408,14 +408,14 @@ const getListInfo = () => {
zhuDaunIsTrue.value = false zhuDaunIsTrue.value = false
console.log("========>",state.tableData)
if(state.tableData && state.tableData.columns && state.tableData.columns.length > 0) { if(state.searchData && state.searchData.length>0) {
if(formTableField.masterTable && formTableField.masterTable.length > 0){ if(formTableField.masterTable && formTableField.masterTable.length > 0){
state.tableData.columns.forEach((itemCol:any)=>{ state.searchData.forEach((itemCol:any)=>{
formTableField.masterTable.forEach((item:any)=>{ formTableField.masterTable.forEach((item:any)=>{
if(itemCol.id == item.id){ if(itemCol.id == item.id){
// console.log("========>",item) // console.log("====111====>",itemCol)
// console.log("====222====>",item)
item.isSearch = true item.isSearch = true
tableFieldList.value!.toggleRowSelection(item, true) tableFieldList.value!.toggleRowSelection(item, true)
} }
@ -543,7 +543,7 @@ const readerColumn = (column:any) => {
@ 功能: 列表字段处理 @ 功能: 列表字段处理
*/ */
const tableListFieldClick = (val:any[]) => { const tableListFieldClick = (val:any[]) => {
// console.log("-->",val) // console.log("-->",state.tableData)
// zhuDaunIsTrue.value = true // zhuDaunIsTrue.value = true
if(zhuDaunIsTrue.value == true){ if(zhuDaunIsTrue.value == true){
if(val.length > 0){ if(val.length > 0){
@ -990,7 +990,7 @@ const showCollapse = () => {
</template> </template>
</el-table-column> </el-table-column>
<el-table-column fixed="right" label="查询" width="55" align="center"> <el-table-column fixed="right" label="查询" width="55" align="center">
<template #default="scope"> <template #default="scope">{{scope.row.isSearch}}
<el-switch <el-switch
v-model="scope.row.isSearch" v-model="scope.row.isSearch"
:active-action-icon="View" :active-action-icon="View"

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

@ -193,6 +193,7 @@ const initLoadData = () => {
versionTitle.value = data.data.appForm.name versionTitle.value = data.data.appForm.name
if(data.data.pageList){ if(data.data.pageList){
let stateData = string2json(data.data.appForm.listjson) let stateData = string2json(data.data.appForm.listjson)
// console.log("",stateData)
let holeControlAndConfigStateData = string2json(data.data.appForm.mastesformjson) let holeControlAndConfigStateData = string2json(data.data.appForm.mastesformjson)
if(stateData.tableData.columns.length>0){ if(stateData.tableData.columns.length>0){
for(let i = 0;i<stateData.tableData.columns.length;i++){ for(let i = 0;i<stateData.tableData.columns.length;i++){

Loading…
Cancel
Save