Browse Source

Merge branch 'qin_v2'

lwx_v4
超级管理员 1 year ago
parent
commit
23e31fe1d5
  1. 7
      src/components/DesignForm/app/formPage.vue
  2. 2
      src/components/DesignForm/public/form/form.vue
  3. 11
      src/components/DesignForm/public/form/formGroup.vue
  4. 112
      src/components/DesignForm/public/form/formItem.vue
  5. 9
      src/components/workflow/drwer/promoterDrawer.vue
  6. 4
      src/views/sysworkflow/lowcodepage/appPage/appPageForm/pageForm.vue
  7. 3
      src/views/sysworkflow/lowcodepage/index.vue
  8. 2
      src/views/sysworkflow/lowcodepage/pageFlow/appTableFlow.vue

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

@ -179,6 +179,7 @@ const getFlowInitSwps = () => {
nextStep.value = data.nextStep
currentProgress.value = data.Step
gainFlowChart.id = props.flowkey
nodeKey.value = data.nodeKey
flowLoading.value = false;
})
}
@ -1049,7 +1050,7 @@ function optionsValue3Get2(data: any,fieldName: string){
<el-container v-if="props.isWorkFlow==1">
<el-main class="formMainBox">
<el-form
v-bind="formData.form"
ref="ruleForm"
@ -1061,8 +1062,8 @@ function optionsValue3Get2(data: any,fieldName: string){
'detail-form': type === 3 || type === 4 || type === 1
}"
>
<FormGroup :tableinfo="formData.form" :numrun="numrun" :data="formData.list" />
<FormGroup :tableinfo="formData.form" :numrun="numrun" :data="formData.list" :purview="formData.powerstr" :node-key="nodeKey" />
<slot></slot>
</el-form>

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

@ -1619,7 +1619,7 @@ defineExpose({
</script>
<template>
<div v-loading="loading">
<el-form
v-bind="formData.form"
ref="ruleForm"

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

@ -26,7 +26,8 @@ const props = withDefaults(
data: FormList[]
tableinfo:formTableInfo
numrun?:number
nodeKey?:string
purview?:any[]
}>(),
{
data: () => {
@ -365,12 +366,13 @@ const clickBtn = (control: any) => {
}
}
onUnmounted(() => {
// console.log('formGroup onUnmounted')
dataList.value = {}
store.setActiveKey('')
store.setControlAttr({})
})
onMounted(()=>{
console.log('非设计模式才触发事件',props.nodeKey,"---------------->",props.purview)
// console.log('formGroup onMounted',props.data,dataList.value,props.tableinfo)
})
@ -418,6 +420,7 @@ function optionsValue3Get1(data: any,fieldName: string){
>
<!-- {{element}} -->
<!--选项卡组件-->
<template v-if="element.type === 'tabs'">
<div class="form-tabs">
@ -585,7 +588,9 @@ function optionsValue3Get1(data: any,fieldName: string){
<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" @optionsValue3Get1="optionsValue3Get1"/>
<FormItem v-else :data="element" @optionsValue3Get1="optionsValue3Get1" :purview="props.purview" :node-key="props.nodeKey"/>
<!--组件设计外功能框架-->
<template v-if="type === 5">
<div class="drag-control">

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

@ -41,9 +41,11 @@ import request from '@/utils/request';
const props = withDefaults(
defineProps<{
data: FormList
modelValue?: any //
tProp?: string // form-itemprop
data: FormList
modelValue?: any //
tProp?: string // form-itemprop
nodeKey?:string
purview?:any[]
}>(),
{}
)
@ -175,6 +177,7 @@ const editDisabled = computed(() => {
if (type.value === 2 && config.value.editDisabled) {
return true //
}
// return judgeIsDisabled(key)
return control.value.disabled
})
// item
@ -521,10 +524,89 @@ const getFormItemInputStyle = (ele: any,sty:number) => {
}
}
const imgUploadApiUrl = import.meta.env.VITE_APP_BASE_API+"/api/upordown"
/**
@ 作者: 秦东
@ 时间: 2024-07-27 14:17:16
@ 功能: 判断此组件是否可见
*/
const judgeIsShow = (key:string) => {
console.log("判断此组件是否可见---->",props.nodeKey,props.purview)
if(props.nodeKey != undefined && props.purview != undefined && props.purview != null && props.purview != null && props.purview != "" && props.purview != "") {
if(props.purview.length < 1){
return true;
}else{
let isShow = false;
props.purview.forEach((item)=>{
if(item.nodeKey == props.nodeKey){
if(item.powerAry && item.powerAry.length > 0){
item.powerAry.forEach((itm)=>{
if(itm.id == key){
console.log("判断此组件是否可见",itm,itm.id == key,"--------->",itm.isLook)
isShow = itm.isLook
}
})
}
}
})
return isShow
}
}else{
return true;
}
}
/**
@ 作者: 秦东
@ 时间: 2024-07-27 15:11:42
@ 功能: 判断是否禁用
*/
const judgeIsDisabled = (key:string) => {
if (type.value === 3) {
return true //
}
if (type.value === 1 && config.value.addDisabled) {
return true
}
if (type.value === 2 && config.value.editDisabled) {
return true //
}
if(props.nodeKey != undefined && props.purview != undefined && props.purview != null && props.purview != null && props.purview != "" && props.purview != "") {
if(props.purview.length < 1){
return false;
}else{
let isShow = true;
props.purview.forEach((item)=>{
if(item.nodeKey == props.nodeKey){
if(item.powerAry && item.powerAry.length > 0){
item.powerAry.forEach((itm)=>{
if(itm.id == key){
console.log("判断此组件是否禁用",itm,itm.id == key,"--------->",itm.isLook)
isShow = !itm.isEdit
}
})
}
}
})
return isShow
}
}else{
return false;
}
}
</script>
<template>
<el-form-item
v-bind="data.item"
v-if="judgeIsShow(data.name)"
:disabled="judgeIsDisabled(data.name)"
:prop="tProp || data.name"
:class="config.className"
:rules="itemRules as any"
@ -537,24 +619,26 @@ const imgUploadApiUrl = import.meta.env.VITE_APP_BASE_API+"/api/upordown"
</template>
<template #label v-else>
<span :style="getFormItemLableStyle(configStyle)" >{{ getLabel(data.item) }}</span>
{{editDisabled}}
</template>
<div class="form-value" v-if="type === 4" v-html="value"></div>
<template v-else>
<el-input
v-bind="control"
v-model="value"
:disabled="editDisabled"
:disabled="judgeIsDisabled(data.name)"
:type="data.type === 'password' ? 'password' : 'text'"
:style="getFormItemInputStyle(configStyle,2)"
:input-style="getFormItemInputStyle(configStyle,3)"
v-if="['input', 'password'].includes(data.type)"
:placeholder="data.control.placeholder?data.control.placeholder:'请输入'+getLabel(data.item)"
>
<template #prepend v-if="config.prepend">
<div v-if="getInputSlot('p')">
<AKSelect
:data="getInputSlot('p')"
:disabled="editDisabled"
:disabled="judgeIsDisabled(data.name)"
:transform-option="transformOption"
@change="inputSlotChange"
type="slot"
@ -566,7 +650,7 @@ const imgUploadApiUrl = import.meta.env.VITE_APP_BASE_API+"/api/upordown"
<div v-if="getInputSlot()">
<AKSelect
:data="getInputSlot()"
:disabled="editDisabled"
:disabled="judgeIsDisabled(data.name)"
:transform-option="transformOption"
type="slot"
@change="inputSlotChange"
@ -578,7 +662,7 @@ const imgUploadApiUrl = import.meta.env.VITE_APP_BASE_API+"/api/upordown"
<el-input
v-bind="control"
v-model="value"
:disabled="editDisabled"
:disabled="judgeIsDisabled(data.name)"
type="textarea"
:placeholder="data.control.placeholder?data.control.placeholder:'请输入'+getLabel(data.item)"
:style="getFormItemInputStyle(configStyle,2)"
@ -587,7 +671,7 @@ const imgUploadApiUrl = import.meta.env.VITE_APP_BASE_API+"/api/upordown"
/>
<el-radio-group
v-bind="control"
:disabled="editDisabled"
:disabled="judgeIsDisabled(data.name)"
v-model="value"
v-if="data.type === 'radio'"
:style="getFormItemInputStyle(configStyle,4)"
@ -603,7 +687,7 @@ const imgUploadApiUrl = import.meta.env.VITE_APP_BASE_API+"/api/upordown"
</el-radio-group>
<el-checkbox-group
v-bind="control"
:disabled="editDisabled"
:disabled="judgeIsDisabled(data.name)"
v-model="value"
v-if="data.type === 'checkbox'"
:style="getFormItemInputStyle(configStyle,4)"
@ -621,7 +705,7 @@ const imgUploadApiUrl = import.meta.env.VITE_APP_BASE_API+"/api/upordown"
data.type === 'select' || (type === 5 && data.type === 'inputSlot')
"
:data="data"
:disabled="editDisabled"
:disabled="judgeIsDisabled(data.name)"
v-model="value"
:options="props.data.options"
:remote-method="getAxiosOptions"
@ -634,7 +718,7 @@ const imgUploadApiUrl = import.meta.env.VITE_APP_BASE_API+"/api/upordown"
:action="uploadUrl"
v-bind="control"
:name="control.file || 'file'"
:disabled="editDisabled"
:disabled="judgeIsDisabled(data.name)"
:file-list="fileList as any"
:class="{limit: control.limit <= fileList.length}"
:on-error="uploadError"
@ -655,7 +739,7 @@ const imgUploadApiUrl = import.meta.env.VITE_APP_BASE_API+"/api/upordown"
v-if="['cascader', 'treeSelect'].includes(data.type)"
:is="currentComponent"
v-bind="control"
:disabled="editDisabled"
:disabled="judgeIsDisabled(data.name)"
:options="options"
v-model="value"
/>
@ -676,7 +760,7 @@ const imgUploadApiUrl = import.meta.env.VITE_APP_BASE_API+"/api/upordown"
"
:is="currentComponent"
v-bind="control"
:disabled="editDisabled"
:disabled="judgeIsDisabled(data.name)"
:placeholder="data.control.placeholder?data.control.placeholder:'请选择'+getLabel(data.item)"
v-model="value"
/>
@ -688,7 +772,7 @@ const imgUploadApiUrl = import.meta.env.VITE_APP_BASE_API+"/api/upordown"
<tinymce-edit
v-bind="control"
:config="config"
:disabled="editDisabled"
:disabled="judgeIsDisabled(data.name)"
v-model="value"
v-if="[1, 2, 3].includes(type as number)"
/>

9
src/components/workflow/drwer/promoterDrawer.vue

@ -142,7 +142,7 @@ const savePromoter = () => {
// console.log("formKey--->",props.formKey.toString());
// console.log("formVersion--->",props.formVersion.toString());
// console.log("value--->",formData.value);
// console.log("purview--->",formData.value.purview);
console.log("purview--->",formData.value.purview);
let sendInfo: any = {
formKey:props.formKey.toString(),
@ -150,7 +150,7 @@ const savePromoter = () => {
formData:JSON.stringify(formData.value),
formPower:JSON.stringify(formData.value.purview)
}
// console.log("sendInfo",sendInfo)
console.log("sendInfo",sendInfo)
setFlowFormKeyPower(sendInfo)
// console.log("formDataAll",formData)
// console.log("formData",formData.value.purview)
@ -175,7 +175,8 @@ const powerUnitAry = ref<any>({
@ 功能: 解析表单
*/
const jieForm = () => {
analysisForm({nodeKey:"begin",nodeJson:JSON.stringify(formData.value)})
// console.log("nodeConfig",props.nodeConfig)
analysisForm({nodeKey:props.nodeConfig.nodeNumber,nodeJson:JSON.stringify(formData.value)})
.then((data)=>{
if(data.code == 0){
powerUnitAry.value = data.data
@ -287,7 +288,7 @@ const oneEditSet = (val: any) => {
<template>
<el-drawer v-model="visible" :append-to-body="true" title="发起人" class="set_promoter" :show-close="false" :size="550" :before-close="closeDrawer">
<div class="demo-drawer__content">
<!-- {{powerUnitAry.recUnitAry.masterUnitList}} -->
<div class="promoter_content drawer_content">
<el-tabs v-model="nodeSetUp" class="demo-tabs">
<el-tab-pane name="first">

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

@ -369,11 +369,13 @@ const saveAppFormData = () => {
createAppForm(sendData)
.then((data:any) => {
state.value.loading = false
// console.log("App--->",data)
console.log("写入自建应用App表单--->",data)
// appPageKey.value = data.data.customerFormCont.id
// appPageKey.set(data.data.customerFormCont.id.toString())
versionId.value = data.data.formVersion.id.toString()
emits('update:formVersion', data.data.formVersion.id.toString())
emits('update:appPageKey', data.data.customerFormCont.id.toString())
// emits('update:formVersion', data.data.version.toString())
// console.log("App-11111-->",data.data.customerFormCont.id)
// console.log("App-2222-->",props.appPageKey)
// emits('update:appPageKey', data.data.customerFormCont.id.toString())

3
src/views/sysworkflow/lowcodepage/index.vue

@ -275,6 +275,9 @@ const eidtGroupStatus = (id: string, state: number) => {
.app-container {
height: calc(100% - 125px);
width: calc(100% - 40px);
overflow: hidden;
overflow-y: auto;
padding-bottom:10px;
}
.tab-box{

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

@ -445,7 +445,7 @@ const initLoadData = () => {
// appFormTitle.value = props.pickAppMenu.label
gainAppPageInfo({id:props.pickAppMenu.id})
.then((data)=>{
console.log("获取初始化表单数据",data)
// console.log("",data)
appInitData.value = data.data
// console.log("---!",appInitData.value)
mastesformjson.value = data.data.appForm.mastesformjson

Loading…
Cancel
Save