Browse Source

BUG修复完成

qin_s6
herenshan112 4 days ago
parent
commit
c9206eda18
  1. 6
      src/components/DesignForm/assembly/index.ts
  2. 23
      src/components/DesignForm/public/expand/rangedUserTree.vue
  3. 46
      src/components/DesignForm/public/form/form.vue
  4. 6
      src/components/DesignForm/public/form/formGroup.vue
  5. 6
      src/components/DesignForm/public/form/newForm.vue
  6. 13
      src/components/workflow/dialog/formWord.vue
  7. 12
      src/utils/request.ts
  8. 16
      src/views/sysworkflow/lowcodepage/pageFlow/newTableFlow.vue

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

@ -409,7 +409,11 @@ export default [
config: {}, config: {},
styles: { styles: {
divStyle: { divStyle: {
marginBot: "15" marginBot: "15",
paddingTop: "10",
paddingBot: "10",
paddingRight: "10",
paddingLeft: "10"
}, },
labelStyle: { labelStyle: {
//paddingLeft: "7", //paddingLeft: "7",

23
src/components/DesignForm/public/expand/rangedUserTree.vue

@ -20,12 +20,12 @@ const emits = defineEmits<{
(e: 'update:modelValue', value: string): void (e: 'update:modelValue', value: string): void
}>() }>()
const value = ref([]) const value = ref<any[]>([])
const treeData = ref([]) // const treeData = ref<any[]>([]) //
const isDataLoaded = ref(false) // const isDataLoaded = ref(false) //
const loading = ref(false) // const loading = ref(false) //
const treeSelectRef = ref() // const treeSelectRef = ref() //
// const { location, updateLocation } = inject('location') const { updateLocation } = inject('location')
// //
const lastSelectedValue = ref(null) const lastSelectedValue = ref(null)
@ -34,7 +34,7 @@ const lastSelectedValue = ref(null)
const isMounted = ref(false) const isMounted = ref(false)
// //
const handleValueChange = (newValue) => { const handleValueChange = (newValue: any[]) => {
if (!multiSelect.value) { if (!multiSelect.value) {
// //
if (newValue.length === 0) { if (newValue.length === 0) {
@ -48,7 +48,7 @@ const handleValueChange = (newValue) => {
lastSelectedValue.value = currentValue; lastSelectedValue.value = currentValue;
} else { } else {
// //
const newSelections = newValue.filter(item => item !== lastSelectedValue.value); const newSelections = newValue.filter((item: null) => item !== lastSelectedValue.value);
if (newSelections.length > 0) { if (newSelections.length > 0) {
// //
const latestSelection = newSelections[newSelections.length - 1]; const latestSelection = newSelections[newSelections.length - 1];
@ -195,7 +195,7 @@ const loadFullData = async () => {
const result = await checkorgAndManTree1(); const result = await checkorgAndManTree1();
// children // children
const cleanedData = sanitizeTreeData(result); const cleanedData = sanitizeTreeData(result as any[]);
const processedData = !multiSelect.value ? processTreeData(cleanedData) : cleanedData; const processedData = !multiSelect.value ? processTreeData(cleanedData) : cleanedData;
// //
@ -240,7 +240,7 @@ function checkorgAndManTree1() {
resolve([]); resolve([]);
return; return;
} }
let result = [] let result: unknown = []
let i = 0 let i = 0
props.orgAndManTree.forEach((element: any) => { props.orgAndManTree.forEach((element: any) => {
if (element.hasOwnProperty('tree') && hasNodesInTree(element.tree)) { if (element.hasOwnProperty('tree') && hasNodesInTree(element.tree)) {
@ -266,12 +266,12 @@ function checkorgAndManTree1() {
/** /**
* 判断树形结构是否存在节点 * 判断树形结构是否存在节点
*/ */
function hasNodesInTree(tree) { function hasNodesInTree(tree: any) {
if (!Array.isArray(tree)) { if (!Array.isArray(tree)) {
return false; return false;
} }
function checkNode(node) { function checkNode(node: null) {
if (node == null) { if (node == null) {
return false; return false;
} }
@ -313,9 +313,8 @@ function hasNodesInTree(tree) {
> >
<!-- 自定义空状态 --> <!-- 自定义空状态 -->
<template #empty> <template #empty>
<div class="custom-empty"> <div v-if="loading" v-loading="loading" class="custom-empty"></div>
{{ loading ? '正在加载' : '无数据' }} <div v-else class="custom-empty">无数据</div>
</div>
</template> </template>
</el-tree-select> </el-tree-select>
</div> </div>

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

@ -67,7 +67,7 @@ const props = withDefaults(
{ {
type: 1, // 123 4 5 type: 1, // 123 4 5
numrun: 2, numrun: 2,
formData: () => { formDataEs: () => {
return { return {
list: [], list: [],
form: {}, form: {},
@ -575,7 +575,7 @@ provide(constControlChange, ({ key, value, data, tProp, type, attribute }: any)
// console.log("----------6--------->", attribute); // console.log("----------6--------->", attribute);
// console.log("----------11--------->", model.value); // console.log("----------11--------->", model.value);
let fieldVal = {}; const fieldVal: any = {};
for (let i in model.value) { for (let i in model.value) {
if (i == key) { if (i == key) {
fieldVal[i] = typeof value == "number" ? value.toString() : value; fieldVal[i] = typeof value == "number" ? value.toString() : value;
@ -682,7 +682,7 @@ let mustBeHidden: any = [];
let newModelKeyArr: string[] = []; let newModelKeyArr: string[] = [];
// //
function isEmptyPlainObject(obj) { function isEmptyPlainObject(obj: {}) {
// 0 // 0
return Object.prototype.toString.call(obj) === '[object Object]' return Object.prototype.toString.call(obj) === '[object Object]'
&& Object.keys(obj).length === 0; && Object.keys(obj).length === 0;
@ -927,7 +927,7 @@ function showOrHide(data: any,currentDataNameValue?:any) {
const radioSelectArr2: any[] = []; const radioSelectArr2: any[] = [];
const radioSelectZdtcszConfigArr = []; const radioSelectZdtcszConfigArr: any[] = [];
//20240815 liwenxuan start //20240815 liwenxuan start
//console.log(props.formData.list) newModelKeyArr //console.log(props.formData.list) newModelKeyArr
@ -1362,7 +1362,7 @@ console.log("设置了标题行和索引列====2===>",model.value)
* @param {string} str - 待处理的原始字符串 * @param {string} str - 待处理的原始字符串
* @returns {string} 最后一个冒号后的子串无冒号/冒号在末尾时返回空字符串 * @returns {string} 最后一个冒号后的子串无冒号/冒号在末尾时返回空字符串
*/ */
function getLastColonAfterString(str) { function getLastColonAfterString(str: string | string[]) {
// 1. // 1.
if (typeof str !== 'string') { if (typeof str !== 'string') {
//console.warn(''); //console.warn('');
@ -1395,7 +1395,7 @@ function getLastColonAfterString(str) {
* @param {String|Number} columnValue - 列标识 * @param {String|Number} columnValue - 列标识
* @returns {String|undefined} - 返回对应的单元格值如果未找到则返回undefined * @returns {String|undefined} - 返回对应的单元格值如果未找到则返回undefined
*/ */
function getTableCellValueV3(tableData, rowValue, columnValue) { function getTableCellValueV3(tableData: { [x: string]: any; default: { [x: string]: any; }; }, rowValue: null, columnValue: null) {
try { try {
// //
if (!tableData || typeof tableData !== 'object' || Array.isArray(tableData)) { if (!tableData || typeof tableData !== 'object' || Array.isArray(tableData)) {
@ -1475,7 +1475,7 @@ function getTableCellValueV3(tableData, rowValue, columnValue) {
* 增强版自动检测tableData结构并获取值 * 增强版自动检测tableData结构并获取值
* 支持动态结构检测 * 支持动态结构检测
*/ */
function getTableCellValueEnhanced(tableData, rowValue, columnValue) { function getTableCellValueEnhanced(tableData: { [x: string]: any; default?: { [x: string]: any; } | { [x: string]: any; } | { [x: string]: any; }; }, rowValue: string | null, columnValue: string | null) {
try { try {
if (!tableData || typeof tableData !== 'object') { if (!tableData || typeof tableData !== 'object') {
return undefined; return undefined;
@ -1530,7 +1530,7 @@ function getTableCellValueEnhanced(tableData, rowValue, columnValue) {
* 检测tableData的结构 * 检测tableData的结构
* @returns {string} - 结构类型'standard', 'singleRow', 'singleColumn', 'mixed', 'unknown' * @returns {string} - 结构类型'standard', 'singleRow', 'singleColumn', 'mixed', 'unknown'
*/ */
function detectTableStructure(tableData) { function detectTableStructure(tableData: { [x: string]: any; default: { [x: string]: any; }; }) {
if (!tableData || typeof tableData !== 'object') { if (!tableData || typeof tableData !== 'object') {
return 'unknown'; return 'unknown';
} }
@ -1613,14 +1613,14 @@ function detectTableStructure(tableData) {
/** /**
* 从仅一行结构中获取值 * 从仅一行结构中获取值
*/ */
function getFromSingleRowStructure(tableData, columnStr) { function getFromSingleRowStructure(tableData: { default: { [x: string]: any; }; }, columnStr: string) {
return tableData.default?.[columnStr]; return tableData.default?.[columnStr];
} }
/** /**
* 从仅一列结构中获取值 * 从仅一列结构中获取值
*/ */
function getFromSingleColumnStructure(tableData, columnStr) { function getFromSingleColumnStructure(tableData: { [x: string]: any; }, columnStr: string) {
const colData = tableData[columnStr]; const colData = tableData[columnStr];
if (colData && typeof colData === 'object') { if (colData && typeof colData === 'object') {
// default // default
@ -1632,7 +1632,7 @@ function getFromSingleColumnStructure(tableData, columnStr) {
/** /**
* 从混合结构中获取值 * 从混合结构中获取值
*/ */
function getFromMixedStructure(tableData, rowStr, columnStr) { function getFromMixedStructure(tableData: { [x: string]: any; default: { [x: string]: any; }; }, rowStr: string, columnStr: string) {
// //
// 1. // 1.
@ -1675,7 +1675,7 @@ function getFromMixedStructure(tableData, rowStr, columnStr) {
/** /**
* 统一方法推荐使用这个 * 统一方法推荐使用这个
*/ */
function getTableCellValue(tableData, rowValue, columnValue) { function getTableCellValue(tableData: any, rowValue: string, columnValue: string) {
return getTableCellValueEnhanced(tableData, rowValue, columnValue); return getTableCellValueEnhanced(tableData, rowValue, columnValue);
} }
@ -2375,7 +2375,7 @@ function getAfterLastColon(str:string) {
function modifyTreeData(treeData, idList) { function modifyTreeData(treeData: any, idList: any) {
//console.log("modifyTreeDataMinimal "); //console.log("modifyTreeDataMinimal ");
let gkFlag = true let gkFlag = true
const idArray = Array.isArray(idList) ? idList : [idList]; const idArray = Array.isArray(idList) ? idList : [idList];
@ -2460,7 +2460,7 @@ function modifyTreeData(treeData, idList) {
} }
// //
function findTargetNode(treeData) { function findTargetNode(treeData: any) {
if (!treeData) return null; if (!treeData) return null;
const stack = Array.isArray(treeData) ? [...treeData] : [treeData]; const stack = Array.isArray(treeData) ? [...treeData] : [treeData];
@ -2483,11 +2483,13 @@ function findTargetNode(treeData) {
} }
// //
function buildNodeTree(node, keepIds, idArray, processedIds) { function buildNodeTree(node: { id: any; label: any; value: any; children: string | any[]; }, keepIds: Set<unknown>, idArray: string | any[], processedIds: Set<unknown>) {
const newNode = { const newNode = {
id: node.id, id: node.id,
label: node.label, label: node.label,
value: node.value value: node.value,
number: node.label,
children: node.children,
}; };
// //
@ -2516,7 +2518,7 @@ function buildNodeTree(node, keepIds, idArray, processedIds) {
} }
// idList 使 // idList 使
function processTreeWithAllNodes(treeData) { function processTreeWithAllNodes(treeData: any) {
if (!treeData) { if (!treeData) {
return Array.isArray(treeData) ? [] : null; return Array.isArray(treeData) ? [] : null;
} }
@ -2548,7 +2550,7 @@ function processTreeWithAllNodes(treeData) {
} }
// //
function formatAllNodes(node, processedIds) { function formatAllNodes(node: { id: string | any[]; children: string | any[]; label: any; value: null | undefined; }, processedIds: Set<unknown>) {
// ID5 // ID5
const isOrganization = node.id && node.id.length < 5; const isOrganization = node.id && node.id.length < 5;
@ -2577,7 +2579,9 @@ function formatAllNodes(node, processedIds) {
const newNode = { const newNode = {
id: node.id, id: node.id,
label: node.label, label: node.label,
value: node.value value: node.value,
number: node.label,
children: node.children,
}; };
// //
@ -2594,12 +2598,12 @@ function formatAllNodes(node, processedIds) {
return newNode; return newNode;
} }
function groupExpandUserConfigs(configs) { function groupExpandUserConfigs(configs: { control: { queryBy: string; orgRange: any; roleRange: any; }; name: any; }[]) {
// Map // Map
// keyvaluenameskeys // keyvaluenameskeys
const groupMap = new Map(); const groupMap = new Map();
configs.forEach(config => { configs.forEach((config: { control: { queryBy: string; orgRange: any; roleRange: any; }; name: any; }) => {
// queryBy使 // queryBy使
let range, rangeType; let range, rangeType;
if (config.control.queryBy === 'org') { if (config.control.queryBy === 'org') {

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

@ -357,7 +357,7 @@ const linksIf = (obj: FormList) => {
// //
const injectBtnEvent: any = inject(constFormBtnEvent); const injectBtnEvent: any = inject(constFormBtnEvent);
const clickBtn = (control: any) => { const clickBtn = (control: any) => {
console.log(type.value,"------->",control) console.log("按钮点击事件----->",type.value,"------->",control)
// 0: '', // 0: '',
// 1: '', // 1: '',
// 2: '', // 2: '',
@ -900,7 +900,7 @@ const judgaButClass = (btnClass:string):string => {
<template v-else-if="element.type === 'txt' && judgeIsShow(element.name)"> <template v-else-if="element.type === 'txt' && judgeIsShow(element.name)">
<div <div
v-bind="element.control" v-bind="element.control"
:class="[element.config.className]" :class="['txtBox',element.config.className]"
v-html="element.control.modelValue" v-html="element.control.modelValue"
></div> ></div>
</template> </template>
@ -989,7 +989,7 @@ const judgaButClass = (btnClass:string):string => {
<!-- <form-group :data="element.list" data-type="not-nested" :org-and-man-tree="orgAndManTree" /> --> <!-- <form-group :data="element.list" data-type="not-nested" :org-and-man-tree="orgAndManTree" /> -->
<template v-for="(item,index) in element.list" :key="index"> <template v-for="(item,index) in element.list" :key="index">
<button v-bind="item.control" @click="clickBtn(item.control)" type="submit" :class="['btn',judgaButClass(item.control?.key)]"> <button v-bind="item.control" @click="clickBtn(item.control)" type="button" :class="['btn',judgaButClass(item.control?.key)]">
<SvgIcon v-if="item.control?.key=='submit'" icon-class="fbsk" /> <SvgIcon v-if="item.control?.key=='submit'" icon-class="fbsk" />
<SvgIcon v-if="item.control?.key=='saveDraft'" icon-class="caogaoxiang" /> <SvgIcon v-if="item.control?.key=='saveDraft'" icon-class="caogaoxiang" />
<SvgIcon v-if="item.control?.key=='draftSubmit'" icon-class="fbsk" /> <SvgIcon v-if="item.control?.key=='draftSubmit'" icon-class="fbsk" />

6
src/components/DesignForm/public/form/newForm.vue

@ -249,9 +249,9 @@ interface hideFieldConditionArritem {
conditions: any[]; conditions: any[];
} }
function funWait(trueValue,conditionFieldValueArr,x,hideFieldsFromCheckbox,toshow){ function funWait(trueValue: string | any[],conditionFieldValueArr: any[],x: number,hideFieldsFromCheckbox: any[],toshow: string){
if(trueValue){ if(trueValue){
if (trueValue.length > 0 && arrayEqual(trueValue, conditionFieldValueArr)) { if (trueValue.length > 0 && arrayEqual(trueValue as string[], conditionFieldValueArr)) {
//,conditionField.,x. //,conditionField.,x.
//alert("") //alert("")
/* console.log(conditionField) /* console.log(conditionField)
@ -1865,6 +1865,7 @@ provide(constFormBtnEvent, (obj: any) => {
if ([3, 4, 5].includes(props.type)) { if ([3, 4, 5].includes(props.type)) {
return ElMessage.error("当前模式不能提交表单"); return ElMessage.error("当前模式不能提交表单");
} }
switch (obj.key) { switch (obj.key) {
case "submit": case "submit":
submit(); // submit(); //
@ -3280,6 +3281,7 @@ const closeFaterPage = () => {
</div> </div>
</template> </template>
<el-scrollbar class="scroBox"> <el-scrollbar class="scroBox">
<el-form <el-form
v-bind="formData.form" v-bind="formData.form"
ref="ruleForm" ref="ruleForm"

13
src/components/workflow/dialog/formWord.vue

@ -11,6 +11,7 @@ import '@/styles/workflowcss/dialog.scss'
// //
import selectBox from '@/components/workflow/selectBoxs.vue' import selectBox from '@/components/workflow/selectBoxs.vue'
import selectResult from '@/components/workflow/selectResult.vue' import selectResult from '@/components/workflow/selectResult.vue'
import { ElStep } from 'element-plus'
let props = defineProps({ let props = defineProps({
visible: { visible: {
@ -30,7 +31,7 @@ let props = defineProps({
default:1 default:1
} }
}); });
let checkedFormList = ref([]) let checkedFormList = ref<any>([])
let emits = defineEmits(['update:visible', 'change']) let emits = defineEmits(['update:visible', 'change'])
let list = computed(() => { let list = computed(() => {
if(props.formtype == 1){ if(props.formtype == 1){
@ -41,7 +42,15 @@ let list = computed(() => {
isActive: (item:any) => $func.toggleClass(checkedFormList.value, item, 'id'), isActive: (item:any) => $func.toggleClass(checkedFormList.value, item, 'id'),
change: (item:any) => { change: (item:any) => {
checkedFormList.value = [item] console.log("------>",item)
if(checkedFormList.value.length == 0){
checkedFormList.value.push(item)
}else{
if(checkedFormList.value.some((a:any) => a.id != item.id)){
checkedFormList.value.push(item)
}
}
// checkedFormList.value = [item]
} }
}] }]
}else{ }else{

12
src/utils/request.ts

@ -58,11 +58,11 @@ service.interceptors.request.use(
data: sm4EncryptMethod(JSON.stringify(data), randomString) data: sm4EncryptMethod(JSON.stringify(data), randomString)
} }
} }
console.log('请求拦截---------->', randomString) // console.log('请求拦截---------->', randomString)
console.log('请求拦截----headers------>', headers) // console.log('请求拦截----headers------>', headers)
console.log('请求拦截----config---url--->', config.url) // console.log('请求拦截----config---url--->', config.url)
console.log('请求拦截----data------>', data) // console.log('请求拦截----data------>', data)
console.log('请求拦截----config------>', config) // console.log('请求拦截----config------>', config)
// console.log('请求拦截----content-type------>', config.headers['Content-Type']) // console.log('请求拦截----content-type------>', config.headers['Content-Type'])
// console.log('请求拦截----config------>', config.headers) // console.log('请求拦截----config------>', config.headers)
@ -88,7 +88,7 @@ service.interceptors.response.use(
let jsonData = sm4DecryptMethod(data.data, authKey) let jsonData = sm4DecryptMethod(data.data, authKey)
response.data.data = JSON.parse(jsonData) response.data.data = JSON.parse(jsonData)
} }
console.log('行营结果----解密结构------>', response.data) // console.log('行营结果----解密结构------>', response.data)
const { code, msg } = response.data; const { code, msg } = response.data;
if (code === 0 || code === 200 || code === 10001) { if (code === 0 || code === 200 || code === 10001) {
return response.data; return response.data;

16
src/views/sysworkflow/lowcodepage/pageFlow/newTableFlow.vue

@ -409,16 +409,20 @@ const afterSubmit = (type: string, val?: any) => {
}; };
startRunFlow(sendInfo).then((data: any) => { startRunFlow(sendInfo).then((data: any) => {
console.log("流程提交成功--------1---------->",data) console.log("流程提交成功--------1---------->",data)
emits("searchquery"); // emits("searchquery");
closeAppSubmit()
}); });
}else{ }else{
emits("searchquery"); // emits("searchquery");
closeAppSubmit()
} }
}else{ }else{
emits("searchquery"); // emits("searchquery");
closeAppSubmit()
} }
}else{ }else{
emits("searchquery"); // emits("searchquery");
closeAppSubmit()
} }
} }
closeAppSubmit(); closeAppSubmit();
@ -430,7 +434,7 @@ const afterSubmit = (type: string, val?: any) => {
*/ */
const saveDraftPage = (type: string, val?: any) => { const saveDraftPage = (type: string, val?: any) => {
if (type === "success") { if (type === "success") {
emits("searchquery"); // emits("searchquery");
if (isFlowTable.value) { if (isFlowTable.value) {
if (val.code == 0) { if (val.code == 0) {
let sendInfo = { let sendInfo = {
@ -807,7 +811,7 @@ provide('currentNodeKey', nodeKey)
ref="aiassistRef" ref="aiassistRef"
:agent="currentAgent" :agent="currentAgent"
/> />
<AppForm <AppForm
ref="formEl" ref="formEl"
:drawTitle="drawTitle" :drawTitle="drawTitle"

Loading…
Cancel
Save