Browse Source

Merge branch 'v4'

v5
超级管理员 2 years ago
parent
commit
fbf2ca0106
  1. 18
      src/components/DesignForm/assembly/index.ts
  2. 10
      src/components/DesignForm/formControlAttr.vue
  3. 162
      src/components/DesignForm/math/matchFunction.ts
  4. 2
      src/components/DesignForm/math/mathFormula.vue
  5. 77
      src/components/DesignForm/public/form/form.vue
  6. 1
      src/utils/workflow/const.ts
  7. 10
      src/views/taskplatform/taskmanagement/taskcustomerformnew.vue

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

@ -247,15 +247,6 @@ const selectOption: any = [
},
config: {}
},
{
type: 'orgCentent',
label: '行政组织',
icon: 'sliders',
iconFont: 'fa-sliders',
control: {
},
config: {}
},
{
type: 'colorPicker',
label: '取色器',
@ -409,6 +400,15 @@ const selectOption: any = [
modelValue: ''
},
config: {} // 其他配置信息
},
{
type: 'orgCentent',
label: '行政组织',
icon: 'sliders',
iconFont: 'fa-sliders',
control: {
},
config: {}
}
]
}

10
src/components/DesignForm/formControlAttr.vue

@ -1267,9 +1267,13 @@ const updataDigit = (key:sring,val:any) => {
// console.log("-1-->",props.formList)
// console.log("-2-->",props.formConfig)
// console.log("--3->",props.formOtherData)
// console.log("--4->",formAttr)
formConfig.value[key] = val.mathsFormula
// console.log("--->",key,val)
console.log("默认值处理--4->",val)
formConfig.value[key] = {
mathsFormula:val.mathsFormula,
takingMethod:val.takingMethod,
digit:val.digit
}
console.log("返回值处理--->",formConfig.value)
attrList.value.forEach((item:any)=>{
// console.log("--1->",item)
if(item.type == "digitpage"){

162
src/components/DesignForm/math/matchFunction.ts

@ -4,7 +4,7 @@ export const funcList = [
name: "函数列表",
children: [
{
id: "11",
id: "1",
name: "SUM",
type:'func',
dataType: "number",
@ -22,16 +22,16 @@ export const funcList = [
`,
},
{
id: "14",
name: "AVG",
id: "2",
name: "AVERAGE",
type:'func',
dataType: "number",
dataTypeName: "数字",
desc: `
<ul>
<li style="font-weight:700; color: #4A538A; padding: 5px 0 ;"> AVG(1,2)=1.5</li>
<li style="font-weight:700; color: #4A538A; padding: 5px 0 ;"> AVERAGE(1,2)=1.5</li>
<li style="font-weight: 700; padding: 5px 0 ;">
<span style="color: #871ab3;">AVG(<span style=" background: #1e87b6; color: #fff; padding: 3px 5px; border-radius: 3px; margin: 0px 5px;">1</span>,<span style=" background: #1e87b6; color: #fff; padding: 3px 5px; border-radius: 3px; margin: 0px 5px;">...</span>)</span>
<span style="color: #871ab3;">AVERAGE(<span style=" background: #1e87b6; color: #fff; padding: 3px 5px; border-radius: 3px; margin: 0px 5px;">1</span>,<span style=" background: #1e87b6; color: #fff; padding: 3px 5px; border-radius: 3px; margin: 0px 5px;">...</span>)</span>
</li>
<li style="font-weight: 700; padding: 5px 0 ;">
<span style="color: #871ab3;">SUM(<span style=" background: #1e87b6; color: #fff; padding: 3px 5px; border-radius: 3px; margin: 0px 5px;"></span>,<span style=" background: #1e87b6; color: #fff; padding: 3px 5px; border-radius: 3px; margin: 0px 5px;"></span>,<span style=" background: #1e87b6; color: #fff; padding: 3px 5px; border-radius: 3px; margin: 0px 5px;"></span>)</span>
@ -40,22 +40,25 @@ export const funcList = [
`,
},
{
id: "12",
id: "3",
name: "MIN",
type:'func',
dataType: "number",
dataTypeName: "数字",
desc: `
<ul>
<li style="font-weight:700; color: #4A538A, padding: 5px 0 ;"> SUM(1,2)=1</li>
<li style="font-weight:700; color: #4A538A; padding: 5px 0 ;"> SUM(1,2)=1</li>
<li style="font-weight: 700; padding: 5px 0 ;">
<span style="color: #871ab3;">MIN(<span style=" background: #1e87b6; color: #fff; padding: 3px 5px; border-radius: 3px; margin: 0px 5px;">1</span>,<span style=" background: #1e87b6; color: #fff; padding: 3px 5px; border-radius: 3px; margin: 0px 5px;">...</span>)</span>
</li>
<li style="font-weight: 700; padding: 5px 0 ;">
<span style="color: #871ab3;">MIN(2,3,1,5,6)</span>
</li>
</ul>
`,
},
{
id: "13",
id: "4",
name: "MAX",
type:'func',
dataType: "number",
@ -64,11 +67,152 @@ export const funcList = [
<ul>
<li style="font-weight:700; color: #4A538A; padding: 5px 0 ;"> SUM(1,2)=2</li>
<li style="font-weight: 700; padding: 5px 0 ;">
<span style="color: #871ab3;">MAX(<span style=" background: #1e87b6; color: #fff; padding: 3px 5px; border-radius: 3px; margin: 0px 5px;">1</span>,<span style=" background: #1e87b6; color: #fff; padding: 3px 5px; border-radius: 3px; margin: 0px 5px;">...</span>)</span>
<span style="color: #871ab3;">MAX(<span style=" background: #1e87b6; color: #fff; padding: 3px 5px; border-radius: 3px; margin: 0px 5px;">1</span>,<span style=" background: #1e87b6; color: #fff; padding: 3px 5px; border-radius: 3px; margin: 0px 5px;">...</span>)</span>
</li>
<li style="font-weight: 700; padding: 5px 0 ;">
<span style="color: #871ab3;">MAX(2,3,1,5,6)</span>
</li>
</ul>
`,
},
{
id: "5",
name: "ABS",
type:'func',
dataType: "number",
dataTypeName: "数字",
desc: `
<ul>
<li style="font-weight:700; color: #4A538A; padding: 5px 0 ;"> ABS(-1)=1</li>
<li style="font-weight: 700; padding: 5px 0 ;">
<span style="color: #871ab3;">ABS(<span style=" background: #1e87b6; color: #fff; padding: 3px 5px; border-radius: 3px; margin: 0px 5px;"></span>)</span>
</li>
<li style="font-weight: 700; padding: 5px 0 ;">
<span style="color: #871ab3;">ABS(-1)</span>1
</li>
</ul>
`,
},
{
id: "6",
name: "SQRT",
type:'func',
dataType: "number",
dataTypeName: "数字",
desc: `
<ul>
<li style="font-weight:700; color: #4A538A; padding: 5px 0 ;"> SQRT(4)=2</li>
<li style="font-weight: 700; padding: 5px 0 ;">
<span style="color: #871ab3;">SQRT(<span style=" background: #1e87b6; color: #fff; padding: 3px 5px; border-radius: 3px; margin: 0px 5px;"></span>)</span>
</li>
</ul>
`,
},
{
id: "7",
name: "CBRT",
type:'func',
dataType: "number",
dataTypeName: "数字",
desc: `
<ul>
<li style="font-weight:700; color: #4A538A; padding: 5px 0 ;"> CBRT(9)=3</li>
<li style="font-weight: 700; padding: 5px 0 ;">
<span style="color: #871ab3;">CBRT(<span style=" background: #1e87b6; color: #fff; padding: 3px 5px; border-radius: 3px; margin: 0px 5px;"></span>)</span>
</li>
</ul>
`,
},
{
id: "8",
name: "SIN",
type:'func',
dataType: "number",
dataTypeName: "数字",
desc: `
<ul>
<li style="font-weight:700; color: #4A538A; padding: 5px 0 ;"> SIN(π/2)=1</li>
<li style="font-weight: 700; padding: 5px 0 ;">
<span style="color: #871ab3;">SIN(<span style=" background: #1e87b6; color: #fff; padding: 3px 5px; border-radius: 3px; margin: 0px 5px;"></span>)</span>
</li>
</ul>
`,
},
{
id: "9",
name: "COS",
type:'func',
dataType: "number",
dataTypeName: "数字",
desc: `
<ul>
<li style="font-weight:700; color: #4A538A; padding: 5px 0 ;"> COS(0)=1</li>
<li style="font-weight: 700; padding: 5px 0 ;">
<span style="color: #871ab3;">COS(<span style=" background: #1e87b6; color: #fff; padding: 3px 5px; border-radius: 3px; margin: 0px 5px;"></span>)</span>
</li>
</ul>
`,
},
{
id: "10",
name: "TAN",
type:'func',
dataType: "number",
dataTypeName: "数字",
desc: `
<ul>
<li style="font-weight:700; color: #4A538A; padding: 5px 0 ;"> TAN(π/4)=1</li>
<li style="font-weight: 700; padding: 5px 0 ;">
<span style="color: #871ab3;">TAN(<span style=" background: #1e87b6; color: #fff; padding: 3px 5px; border-radius: 3px; margin: 0px 5px;"></span>)</span>
</li>
</ul>
`,
},
{
id: "11",
name: "COT",
type:'func',
dataType: "number",
dataTypeName: "数字",
desc: `
<ul>
<li style="font-weight:700; color: #4A538A; padding: 5px 0 ;"> COT(π/4)=1</li>
<li style="font-weight: 700; padding: 5px 0 ;">
<span style="color: #871ab3;">COT(<span style=" background: #1e87b6; color: #fff; padding: 3px 5px; border-radius: 3px; margin: 0px 5px;"></span>)</span>
</li>
</ul>
`,
},
{
id: "11",
name: "SEC",
type:'func',
dataType: "number",
dataTypeName: "数字",
desc: `
<ul>
<li style="font-weight:700; color: #4A538A; padding: 5px 0 ;"> SEC(0)=1</li>
<li style="font-weight: 700; padding: 5px 0 ;">
<span style="color: #871ab3;">SEC(<span style=" background: #1e87b6; color: #fff; padding: 3px 5px; border-radius: 3px; margin: 0px 5px;"></span>)</span>
</li>
</ul>
`,
},
{
id: "12",
name: "CSC",
type:'func',
dataType: "number",
dataTypeName: "数字",
desc: `
<ul>
<li style="font-weight:700; color: #4A538A; padding: 5px 0 ;"> CSC(π/2)=1</li>
<li style="font-weight: 700; padding: 5px 0 ;">
<span style="color: #871ab3;">CSC(<span style=" background: #1e87b6; color: #fff; padding: 3px 5px; border-radius: 3px; margin: 0px 5px;"></span>)</span>
</li>
</ul>
`,
}
],
},

2
src/components/DesignForm/math/mathFormula.vue

@ -195,7 +195,7 @@ const sendDigitFunc = () => {
// console.log("tinymceBox--3--->",tinymceBox.value);
let fsdf = tinymceBox.value.innerHTML.match(pattern);
// console.log("tinymceBox--4--->",fsdf,fsdf[2]);
// console.log("tinymceBox--5--->",tinymceBox.value.childNodes);
let formulaOne = [];
let formulaTwo = [];

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

@ -164,7 +164,68 @@ const forEachGetFormModel = (list: FormList[], obj: any) => {
// tProp
provide(constControlChange, ({ key, value, data, tProp, type, attribute }: any) => {
// console.log("--constControlChange-->",key, value, data, tProp,type,attribute)
console.log("表单组件值改变事件----------1--------->",key)
console.log("表单组件值改变事件----------2--------->",value)
console.log("表单组件值改变事件----------3--------->",data)
console.log("表单组件值改变事件----------4--------->",tProp)
console.log("表单组件值改变事件----------5--------->",type)
console.log("表单组件值改变事件----------6--------->",attribute)
// console.log("----------1--------->",key, value, data, tProp, type, attribute)
let fieldVal = {}
validate((valid: boolean, fields: any) => {
// console.log("--constControlChange----------1--------->",valid,fields,type)
for(let i in fields){
fieldVal[i]=fields[i].toString()
}
//
if(type == "digitpage"){
let sendInfo = {
"fieldKey":key,
"mathsFornula":props.formData.config,
"keyVal":fieldVal
}
console.log("sendInfoe-->",sendInfo)
currencyFormApiSubmit("/systemapi/maths/mathematicalCalculations",sendInfo)
.then((data:any)=>{
// console.log("-->",data)
let formatRes: any = data.data
//
const afterResponse = props.formData.events?.afterResponse
if (typeof afterResponse === 'string' && afterResponse) {
formatRes = formatResult(result, afterResponse)
} else if (typeof afterResponse === 'function') {
formatRes = afterResponse(result) ?? result
}
// vue
if (typeof props.afterResponse === 'string' && props.afterResponse) {
formatRes = formatResult(result, props.afterResponse)
} else if (typeof props.afterResponse === 'function') {
formatRes = props.afterResponse(result) ?? result
}
if (formatRes === false) {
return
}
// console.log("--->",formatRes)
setValue(formatRes.result || formatRes)
nextTick(() => {
// dictoptions
if (formatRes.dict && Object.keys(formatRes.dict).length) {
resultDict.value = formatRes.dict
}
})
})
}
})
// console.log("-1-constControlChange-->",props.formData)
// console.log("-2-constControlChange-->",key)
// console.log("-3-constControlChange-->", value)
// console.log("-4-constControlChange-->",data)
// console.log("-5-constControlChange-->",type)
// console.log("-6-constControlChange-->",attribute)
if (typeof props.changeKeyVal === 'function') {
props.changeKeyVal(key, value,type,attribute)
}
@ -188,6 +249,8 @@ provide(constControlChange, ({ key, value, data, tProp, type, attribute }: any)
// tProps
emits('change', { key, value, model: model.value, data, tProp })
}
})
const dictForm = computed(() => {
const storage = window.localStorage.getItem('akFormDict')
@ -514,9 +577,9 @@ const submit = (params = {}) => {
if (valid) {
const formatParams = Object.assign({}, fields, params)
// console.log("params--->",params)
// console.log("fields--->",fields)
// console.log("formatParams-Object-->",formatParams)
console.log("params--->",params)
console.log("fields--->",fields)
console.log("formatParams-Object-->",formatParams)
let submitParams
const beforeSubmit = props.formData.events?.beforeSubmit
@ -535,14 +598,16 @@ const submit = (params = {}) => {
if (submitParams === false) {
return
}
// console.log("beforeSubmit--->",beforeSubmit)
// console.log("props.beforeSubmit--->",props.beforeSubmit)
console.log("beforeSubmit--->",beforeSubmit)
console.log("props.beforeSubmit--->",props.beforeSubmit)
// console.log("props.beforeSubmit--->",props.beforeSubmit)
// loading.value = true
console.log("apiUrl--->",apiUrl)
console.log("submitParams--->",submitParams)
console.log("formatParams--->",formatParams)
debugger
//
currencyFormApiSubmit(apiUrl, submitParams ?? formatParams)
.then((res: any) => {

1
src/utils/workflow/const.ts

@ -66,6 +66,7 @@ export let notAsA_BasisForJudgment = [
"upload",
"tinymce",
"button",
"digitpage"
]
//作为审批节点操作人控件
export let asAnApprovalActionControl = ["expand-user"]

10
src/views/taskplatform/taskmanagement/taskcustomerformnew.vue

@ -214,6 +214,11 @@ const changeKeyVal = (key:any,val:any,type:any,attribute:any) => {
// console.log("--attribute--->",attribute)
// console.log("--type-1-true->",notAsA_BasisForJudgment.indexOf(type))
// console.log("--flowFactor--->",flowFactor)
// if(notAsA_BasisForJudgment.indexOf(type) != -1){
// console.log("--type--true->",notAsA_BasisForJudgment.indexOf(type))
// }
@ -225,7 +230,7 @@ const changeKeyVal = (key:any,val:any,type:any,attribute:any) => {
flowFactor.forEach((item:any)=>{
if(item.factorid == key){
isWrite = false
isUpdateFlowChart = true
item.type=3
if(type == "checkbox"){
item.isCheckbox = true
@ -234,6 +239,9 @@ const changeKeyVal = (key:any,val:any,type:any,attribute:any) => {
item.isCheckbox = false
item.oneanswer = val.toString()
}
if(notAsA_BasisForJudgment.indexOf(type) === -1){
isUpdateFlowChart = true
}
}
})
if(isWrite){

Loading…
Cancel
Save