mirror of
https://gitee.com/orangeform/orange-admin.git
synced 2026-01-17 10:36:31 +08:00
修复bug
This commit is contained in:
@@ -49,19 +49,14 @@ module.exports = {
|
|||||||
'vue/comment-directive': 'off',
|
'vue/comment-directive': 'off',
|
||||||
'vue/multi-word-component-names': 'off',
|
'vue/multi-word-component-names': 'off',
|
||||||
'@typescript-eslint/no-unused-vars': 'off',
|
'@typescript-eslint/no-unused-vars': 'off',
|
||||||
'import/extensions': [
|
'import/extensions': 'off',
|
||||||
'error',
|
|
||||||
'ignorePackages',
|
|
||||||
{
|
|
||||||
ts: 'never',
|
|
||||||
tsx: 'never',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
'import/order': [
|
'import/order': [
|
||||||
'error',
|
'error',
|
||||||
{
|
{
|
||||||
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object'],
|
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object'],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
'import/named': 'off',
|
||||||
|
'import/no-unresolved': 'off',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
1
OrangeFormsOpen-VUE3/components.d.ts
vendored
1
OrangeFormsOpen-VUE3/components.d.ts
vendored
@@ -77,6 +77,7 @@ declare module 'vue' {
|
|||||||
InputNumberRange: typeof import('./src/components/InputNumberRange/index.vue')['default']
|
InputNumberRange: typeof import('./src/components/InputNumberRange/index.vue')['default']
|
||||||
Layout: typeof import('./src/components/layout/index.vue')['default']
|
Layout: typeof import('./src/components/layout/index.vue')['default']
|
||||||
LayoutComponentsBreadCrumb: typeof import('./src/components/layout/components/BreadCrumb.vue')['default']
|
LayoutComponentsBreadCrumb: typeof import('./src/components/layout/components/BreadCrumb.vue')['default']
|
||||||
|
LayoutComponentsFormModifyPassword: typeof import('./src/components/layout/components/formModifyPassword/index.vue')['default']
|
||||||
LayoutComponentsMultiColumn: typeof import('./src/components/layout/components/multi-column.vue')['default']
|
LayoutComponentsMultiColumn: typeof import('./src/components/layout/components/multi-column.vue')['default']
|
||||||
LayoutComponentsMultiColumnMenu: typeof import('./src/components/layout/components/multi-column-menu.vue')['default']
|
LayoutComponentsMultiColumnMenu: typeof import('./src/components/layout/components/multi-column-menu.vue')['default']
|
||||||
LayoutComponentsSidebar: typeof import('./src/components/layout/components/Sidebar.vue')['default']
|
LayoutComponentsSidebar: typeof import('./src/components/layout/components/Sidebar.vue')['default']
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
|
import { API_CONTEXT } from '../config';
|
||||||
import { loginParam, LoginUserInfo } from '@/types/upms/login';
|
import { loginParam, LoginUserInfo } from '@/types/upms/login';
|
||||||
import { UserInfo } from '@/types/upms/user';
|
import { UserInfo } from '@/types/upms/user';
|
||||||
import { BaseController } from '@/api/BaseController';
|
import { BaseController } from '@/api/BaseController';
|
||||||
import { API_CONTEXT } from '../config';
|
import { RequestOption, TableData } from '@/common/http/types';
|
||||||
|
import { ANY_OBJECT } from '@/types/generic';
|
||||||
|
|
||||||
export default class LoginController extends BaseController {
|
export default class LoginController extends BaseController {
|
||||||
static login(params: loginParam) {
|
static login(params: loginParam) {
|
||||||
@@ -11,4 +13,8 @@ export default class LoginController extends BaseController {
|
|||||||
static logout() {
|
static logout() {
|
||||||
return super.post(API_CONTEXT + '/upms/login/doLogout', {});
|
return super.post(API_CONTEXT + '/upms/login/doLogout', {});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static changePassword(params: ANY_OBJECT, httpOptions?: RequestOption) {
|
||||||
|
return super.post(API_CONTEXT + '/upms/login/changePassword', params, httpOptions);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,121 @@
|
|||||||
|
<template>
|
||||||
|
<div class="form-single-fragment" style="position: relative">
|
||||||
|
<el-form
|
||||||
|
ref="formModifyPassword"
|
||||||
|
:model="formData"
|
||||||
|
class="full-width-input"
|
||||||
|
:rules="rules"
|
||||||
|
style="width: 100%"
|
||||||
|
label-width="120px"
|
||||||
|
:size="defaultFormItemSize"
|
||||||
|
label-position="right"
|
||||||
|
@submit.prevent
|
||||||
|
>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="旧密码" prop="oldPassword">
|
||||||
|
<el-input
|
||||||
|
class="input-item"
|
||||||
|
v-model.trim="formData.oldPassword"
|
||||||
|
type="password"
|
||||||
|
show-password
|
||||||
|
:clearable="true"
|
||||||
|
placeholder="旧密码"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="新密码" prop="password">
|
||||||
|
<el-input
|
||||||
|
class="input-item"
|
||||||
|
v-model.trim="formData.password"
|
||||||
|
type="password"
|
||||||
|
show-password
|
||||||
|
:clearable="true"
|
||||||
|
placeholder="新密码"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="新密码确认" prop="repeatPassword">
|
||||||
|
<el-input
|
||||||
|
class="input-item"
|
||||||
|
v-model.trim="formData.repeatPassword"
|
||||||
|
type="password"
|
||||||
|
show-password
|
||||||
|
:clearable="true"
|
||||||
|
placeholder="新密码确认"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-row class="no-scroll flex-box" type="flex" justify="end">
|
||||||
|
<el-button :size="defaultFormItemSize" :plain="true" @click="onCancel(false)">
|
||||||
|
取消
|
||||||
|
</el-button>
|
||||||
|
<el-button type="primary" :size="defaultFormItemSize" @click="onSave()">
|
||||||
|
保存
|
||||||
|
</el-button>
|
||||||
|
</el-row>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ElMessage } from 'element-plus';
|
||||||
|
import { encrypt } from '@/common/utils';
|
||||||
|
import LoginController from '@/api/system/LoginController';
|
||||||
|
import { DialogProp } from '@/components/Dialog/types';
|
||||||
|
import { ANY_OBJECT } from '@/types/generic';
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
dialog?: DialogProp<ANY_OBJECT>;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const formModifyPassword = ref();
|
||||||
|
const formData = reactive({
|
||||||
|
oldPassword: undefined,
|
||||||
|
password: undefined,
|
||||||
|
repeatPassword: undefined,
|
||||||
|
});
|
||||||
|
|
||||||
|
const rules = ref({
|
||||||
|
oldPassword: [{ required: true, message: '请输入旧密码', trigger: 'blur' }],
|
||||||
|
password: [{ required: true, message: '请输入新密码', trigger: 'blur' }],
|
||||||
|
repeatPassword: [{ required: true, message: '请输入新密码', trigger: 'blur' }],
|
||||||
|
});
|
||||||
|
|
||||||
|
const onCancel = () => {
|
||||||
|
if (props.dialog) {
|
||||||
|
props.dialog.cancel();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const onSave = () => {
|
||||||
|
formModifyPassword.value.validate(valid => {
|
||||||
|
if (!valid) return;
|
||||||
|
if (formData.password !== formData.repeatPassword) {
|
||||||
|
ElMessage.error('两次密码输入不一致,请核对!');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let params = {
|
||||||
|
oldPass: encrypt(formData.oldPassword),
|
||||||
|
newPass: encrypt(formData.password),
|
||||||
|
};
|
||||||
|
|
||||||
|
LoginController.changePassword(params)
|
||||||
|
.then(res => {
|
||||||
|
ElMessage.success('密码修改成功');
|
||||||
|
if (props.dialog) {
|
||||||
|
props.dialog.submit(res);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(e => {
|
||||||
|
console.error(e);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style></style>
|
||||||
@@ -138,7 +138,10 @@ import { useUpload } from '@/common/hooks/useUpload';
|
|||||||
import Sidebar from './components/Sidebar.vue';
|
import Sidebar from './components/Sidebar.vue';
|
||||||
import BreadCrumb from './components/BreadCrumb.vue';
|
import BreadCrumb from './components/BreadCrumb.vue';
|
||||||
import TagPanel from './components/TagPanel.vue';
|
import TagPanel from './components/TagPanel.vue';
|
||||||
|
import { useCommon } from '@/common/hooks/useCommon';
|
||||||
|
import FormModifyPassword from './components/formModifyPassword/index.vue';
|
||||||
|
|
||||||
|
const { Dialog } = useCommon();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const layoutStore = useLayoutStore();
|
const layoutStore = useLayoutStore();
|
||||||
@@ -331,13 +334,12 @@ const handleCommand = (command: string) => {
|
|||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
ElMessage({
|
console.log('取消退出');
|
||||||
type: 'info',
|
|
||||||
message: '取消退出',
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
case 'modifyPassword':
|
||||||
|
Dialog.show('修改密码', FormModifyPassword, { area: '500px' }, {});
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
ElMessage.warning(`click on item ${command}`);
|
ElMessage.warning(`click on item ${command}`);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import 'element-plus/theme-chalk/el-cascader-panel.css';
|
|||||||
import 'element-plus/theme-chalk/el-tree.css';
|
import 'element-plus/theme-chalk/el-tree.css';
|
||||||
import 'element-plus/theme-chalk/el-date-picker.css';
|
import 'element-plus/theme-chalk/el-date-picker.css';
|
||||||
import 'element-plus/theme-chalk/el-input-number.css';
|
import 'element-plus/theme-chalk/el-input-number.css';
|
||||||
|
import 'element-plus/theme-chalk/el-switch.css';
|
||||||
|
|
||||||
// 其它样式
|
// 其它样式
|
||||||
import '@/assets/online-icon/iconfont.css';
|
import '@/assets/online-icon/iconfont.css';
|
||||||
|
|||||||
@@ -244,7 +244,7 @@ const props = withDefaults(
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
const table = ref<ANY_OBJECT>();
|
const table = ref();
|
||||||
const form = inject('form', () => {
|
const form = inject('form', () => {
|
||||||
console.error('OnlineCustomTable: form not injected');
|
console.error('OnlineCustomTable: form not injected');
|
||||||
return { isEdit: false } as ANY_OBJECT;
|
return { isEdit: false } as ANY_OBJECT;
|
||||||
@@ -403,10 +403,12 @@ const onRadioSelectChange = () => {
|
|||||||
props.onRadioChange(selectRow);
|
props.onRadioChange(selectRow);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// const setSelectedRow = (rowNum: number) => {
|
const setSelectedRow = (rowNum: number) => {
|
||||||
// table.value.getTableImpl().setRadioRow(props.dataList[rowNum]);
|
nextTick(() => {
|
||||||
// nextTick(onRadioSelectChange);
|
table.value.getTableImpl().setRadioRow(props.dataList[rowNum]);
|
||||||
// };
|
onRadioSelectChange();
|
||||||
|
});
|
||||||
|
};
|
||||||
// 取消行内编辑
|
// 取消行内编辑
|
||||||
// const cancelRowEvent = (row: ANY_OBJECT) => {
|
// const cancelRowEvent = (row: ANY_OBJECT) => {
|
||||||
// if (form().isEdit) return;
|
// if (form().isEdit) return;
|
||||||
@@ -554,6 +556,10 @@ watch(
|
|||||||
refreshColumn();
|
refreshColumn();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
setSelectedRow,
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
@@ -170,13 +170,10 @@ const uploadWidgetImpl = reactive(
|
|||||||
|
|
||||||
const getDisabledStatus = () => {
|
const getDisabledStatus = () => {
|
||||||
if (form().isEdit) return true;
|
if (form().isEdit) return true;
|
||||||
let formWidgetAuth: ANY_OBJECT | null = null;
|
const formWidgetAuth: ANY_OBJECT | null = form().formAuth && form().formAuth() && form().formAuth().pc
|
||||||
if (form().formAuth) {
|
? form().formAuth().pc[pps.widget.variableName]
|
||||||
formWidgetAuth = form().formAuth();
|
: null;
|
||||||
if (formWidgetAuth != null) {
|
if (formWidgetAuth && formWidgetAuth.disabled) return true;
|
||||||
formWidgetAuth = formWidgetAuth.pc[pps.widget.variableName];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return props.widget.props.disabled;
|
return props.widget.props.disabled;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -355,13 +355,9 @@ const getWidgetProps = computed(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const getDisabledStatus = () => {
|
const getDisabledStatus = () => {
|
||||||
let formWidgetAuth: ANY_OBJECT | null = null;
|
const formWidgetAuth: ANY_OBJECT | null = form().formAuth && form().formAuth() && form().formAuth().pc
|
||||||
if (form().formAuth) {
|
? form().formAuth().pc[pps.widget.variableName]
|
||||||
formWidgetAuth = form().formAuth();
|
: null;
|
||||||
if (formWidgetAuth != null) {
|
|
||||||
formWidgetAuth = formWidgetAuth.pc[pps.widget.variableName];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (formWidgetAuth && formWidgetAuth.disabled) return true;
|
if (formWidgetAuth && formWidgetAuth.disabled) return true;
|
||||||
return pps.widget.props.disabled;
|
return pps.widget.props.disabled;
|
||||||
};
|
};
|
||||||
@@ -400,6 +396,8 @@ const onValueInput = (val: ANY_OBJECT | undefined) => {
|
|||||||
if (multiSelect.value && Array.isArray(tempValue) /*&& tempValue.length > 0*/) {
|
if (multiSelect.value && Array.isArray(tempValue) /*&& tempValue.length > 0*/) {
|
||||||
tempValue = tempValue.join(',') + ',';
|
tempValue = tempValue.join(',') + ',';
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
tempValue = val;
|
||||||
}
|
}
|
||||||
console.log('widget update:value', tempValue);
|
console.log('widget update:value', tempValue);
|
||||||
emit('update:value', tempValue);
|
emit('update:value', tempValue);
|
||||||
@@ -413,10 +411,9 @@ const onValueChange = (
|
|||||||
) => {
|
) => {
|
||||||
let tempVal: ValueType | undefined = undefined;
|
let tempVal: ValueType | undefined = undefined;
|
||||||
let dictData = null;
|
let dictData = null;
|
||||||
|
tempVal = parseValue(val);
|
||||||
console.log('widget onValueChange >>>', val);
|
console.log('widget onValueChange >>>', val);
|
||||||
if (val) {
|
if (val != null) {
|
||||||
tempVal = parseValue(val);
|
|
||||||
if (multiSelect.value) {
|
if (multiSelect.value) {
|
||||||
dictData = val
|
dictData = val
|
||||||
.map((item: string) => {
|
.map((item: string) => {
|
||||||
@@ -442,8 +439,6 @@ const onValueChange = (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 这个似乎没有起到什么作用
|
|
||||||
emit('change', tempVal, {
|
emit('change', tempVal, {
|
||||||
dictData: dictData,
|
dictData: dictData,
|
||||||
selectRow: selectRow,
|
selectRow: selectRow,
|
||||||
|
|||||||
@@ -314,6 +314,7 @@ import { useLayoutStore } from '@/store';
|
|||||||
import OnlineFilterBox from '../OnlineQueryForm/OnlineFilterBox.vue';
|
import OnlineFilterBox from '../OnlineQueryForm/OnlineFilterBox.vue';
|
||||||
import { useDict } from '../../hooks/useDict';
|
import { useDict } from '../../hooks/useDict';
|
||||||
import { useForm } from '../hooks/useForm';
|
import { useForm } from '../hooks/useForm';
|
||||||
|
import { useFormExpose } from '../hooks/useFormExpose';
|
||||||
|
|
||||||
const { fetchUpload } = useUpload();
|
const { fetchUpload } = useUpload();
|
||||||
|
|
||||||
@@ -411,6 +412,7 @@ provide('form', () => {
|
|||||||
filter: {
|
filter: {
|
||||||
name: leftFilter.value,
|
name: leftFilter.value,
|
||||||
},
|
},
|
||||||
|
instanceData: () => useFormExpose(formData),
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -775,7 +777,7 @@ const onOperationClick = (operation: ANY_OBJECT | null, row: ANY_OBJECT | null =
|
|||||||
} else if (operation.type === SysCustomWidgetOperationType.EXPORT) {
|
} else if (operation.type === SysCustomWidgetOperationType.EXPORT) {
|
||||||
onExport(operation);
|
onExport(operation);
|
||||||
} else if (operation.type === SysCustomWidgetOperationType.PRINT) {
|
} else if (operation.type === SysCustomWidgetOperationType.PRINT) {
|
||||||
onPrint(operation, row, queryTable.value.showName + '.pdf');
|
onPrint(operation, row, selectRows.value, queryTable.value.showName + '.pdf');
|
||||||
} else if (operation.type === SysCustomWidgetOperationType.START_FLOW) {
|
} else if (operation.type === SysCustomWidgetOperationType.START_FLOW) {
|
||||||
onStartFlow(operation, row);
|
onStartFlow(operation, row);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -284,6 +284,7 @@ provide('form', () => {
|
|||||||
return props.currentWidget === widget;
|
return props.currentWidget === widget;
|
||||||
},
|
},
|
||||||
getWidgetObject: widgetData.getWidgetObject,
|
getWidgetObject: widgetData.getWidgetObject,
|
||||||
|
instanceData: () => useFormExpose(formData),
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -301,7 +302,7 @@ const onOperationClick = (operation: ANY_OBJECT) => {
|
|||||||
} else {
|
} else {
|
||||||
keyName = masterTable.value.relation.variableName;
|
keyName = masterTable.value.relation.variableName;
|
||||||
}
|
}
|
||||||
onPrint(operation, formData[keyName], form.value.formName + '.pdf');
|
onPrint(operation, formData[keyName], null, form.value.formName + '.pdf');
|
||||||
};
|
};
|
||||||
|
|
||||||
const onCancel = () => {
|
const onCancel = () => {
|
||||||
|
|||||||
@@ -169,6 +169,7 @@ provide('form', () => {
|
|||||||
return props.currentWidget === widget;
|
return props.currentWidget === widget;
|
||||||
},
|
},
|
||||||
getWidgetObject: widgetData.getWidgetObject,
|
getWidgetObject: widgetData.getWidgetObject,
|
||||||
|
instanceData: () => useFormExpose(formData),
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -495,7 +496,7 @@ const onOperationClick = (operation: ANY_OBJECT, row: ANY_OBJECT | null) => {
|
|||||||
} else if (operation.type === SysCustomWidgetOperationType.EXPORT) {
|
} else if (operation.type === SysCustomWidgetOperationType.EXPORT) {
|
||||||
onExport(operation);
|
onExport(operation);
|
||||||
} else if (operation.type === SysCustomWidgetOperationType.PRINT) {
|
} else if (operation.type === SysCustomWidgetOperationType.PRINT) {
|
||||||
if (row) onPrint(operation, row, queryTable.value.showName + '.pdf');
|
if (row) onPrint(operation, row, null, queryTable.value.showName + '.pdf');
|
||||||
} else {
|
} else {
|
||||||
handlerOperation(operation, {
|
handlerOperation(operation, {
|
||||||
isEdit: dialogParams.value.isEdit,
|
isEdit: dialogParams.value.isEdit,
|
||||||
|
|||||||
@@ -239,7 +239,6 @@ const {
|
|||||||
} = useForm(props);
|
} = useForm(props);
|
||||||
|
|
||||||
provide('form', () => {
|
provide('form', () => {
|
||||||
console.log('provide form5', props, form);
|
|
||||||
return {
|
return {
|
||||||
...form.value,
|
...form.value,
|
||||||
mode: props.mode || 'pc',
|
mode: props.mode || 'pc',
|
||||||
@@ -263,6 +262,7 @@ provide('form', () => {
|
|||||||
return props.currentWidget === widget;
|
return props.currentWidget === widget;
|
||||||
},
|
},
|
||||||
getWidgetObject: widgetData.getWidgetObject,
|
getWidgetObject: widgetData.getWidgetObject,
|
||||||
|
instanceData: () => useFormExpose(formData),
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -582,7 +582,7 @@ const onOperationClick = (operation: ANY_OBJECT, row: ANY_OBJECT | null) => {
|
|||||||
} else if (operation.type === SysCustomWidgetOperationType.EXPORT) {
|
} else if (operation.type === SysCustomWidgetOperationType.EXPORT) {
|
||||||
onExport(operation);
|
onExport(operation);
|
||||||
} else if (operation.type === SysCustomWidgetOperationType.PRINT) {
|
} else if (operation.type === SysCustomWidgetOperationType.PRINT) {
|
||||||
onPrint(operation, row, queryTable.value.showName + '.pdf');
|
onPrint(operation, row, selectRows.value, queryTable.value.showName + '.pdf');
|
||||||
} else if (operation.type === SysCustomWidgetOperationType.START_FLOW) {
|
} else if (operation.type === SysCustomWidgetOperationType.START_FLOW) {
|
||||||
console.log('启动流程');
|
console.log('启动流程');
|
||||||
onStartFlow(operation, row);
|
onStartFlow(operation, row);
|
||||||
|
|||||||
@@ -134,6 +134,7 @@ provide('form', () => {
|
|||||||
return props.currentWidget === widget;
|
return props.currentWidget === widget;
|
||||||
},
|
},
|
||||||
getWidgetObject: widgetData.getWidgetObject,
|
getWidgetObject: widgetData.getWidgetObject,
|
||||||
|
instanceData: () => useFormExpose(formData),
|
||||||
formAuth: () => {
|
formAuth: () => {
|
||||||
return formAuth.value;
|
return formAuth.value;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -128,6 +128,7 @@ import { FlowEntryController, FlowOperationController } from '@/api/flow';
|
|||||||
import widgetData from '@/online/config/index';
|
import widgetData from '@/online/config/index';
|
||||||
import { useLayoutStore } from '@/store';
|
import { useLayoutStore } from '@/store';
|
||||||
import { useForm } from '../hooks/useForm';
|
import { useForm } from '../hooks/useForm';
|
||||||
|
import { useFormExpose } from '../hooks/useFormExpose';
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
tableClick: [ANY_OBJECT];
|
tableClick: [ANY_OBJECT];
|
||||||
@@ -160,6 +161,7 @@ const {
|
|||||||
isReady,
|
isReady,
|
||||||
dialogParams,
|
dialogParams,
|
||||||
form,
|
form,
|
||||||
|
formData,
|
||||||
checkOperationPermCode,
|
checkOperationPermCode,
|
||||||
checkOperationDisabled,
|
checkOperationDisabled,
|
||||||
checkOperationVisible,
|
checkOperationVisible,
|
||||||
@@ -180,6 +182,7 @@ provide('form', () => {
|
|||||||
return props.currentWidget === widget;
|
return props.currentWidget === widget;
|
||||||
},
|
},
|
||||||
getWidgetObject: widgetData.getWidgetObject,
|
getWidgetObject: widgetData.getWidgetObject,
|
||||||
|
instanceData: () => useFormExpose(formData),
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -25,9 +25,10 @@ import { useFormConfig } from '@/pages/online/hooks/useFormConfig';
|
|||||||
import widgetData from '@/online/config/index';
|
import widgetData from '@/online/config/index';
|
||||||
import combinedDict from '@/common/staticDict/combined';
|
import combinedDict from '@/common/staticDict/combined';
|
||||||
import { pattern } from '@/common/utils/validate';
|
import { pattern } from '@/common/utils/validate';
|
||||||
import { post } from '@/common/http/request';
|
import { post, downloadBlob } from '@/common/http/request';
|
||||||
//import { API_CONTEXT } from '@/api/config';
|
import { API_CONTEXT } from '@/api/config';
|
||||||
import { useThirdParty } from '@/components/thirdParty/hooks';
|
import { useThirdParty } from '@/components/thirdParty/hooks';
|
||||||
|
import { useFormExpose } from './useFormExpose';
|
||||||
|
|
||||||
const StaticDict = { ...combinedDict };
|
const StaticDict = { ...combinedDict };
|
||||||
|
|
||||||
@@ -143,8 +144,9 @@ export const useForm = (props: ANY_OBJECT, formRef: Ref<FormInstance> | null = n
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
const getWidgetVisible = widget => {
|
const getWidgetVisible = widget => {
|
||||||
const formWidgetAuth: ANY_OBJECT | null =
|
const formWidgetAuth: ANY_OBJECT | null = formAuth.value && formAuth.value.pc
|
||||||
formAuth.value && formAuth.value.pc ? formAuth.value.pc[widget.variableName] : null;
|
? formAuth.value.pc[widget.variableName]
|
||||||
|
: null;
|
||||||
if (formWidgetAuth && formWidgetAuth.hide) return false;
|
if (formWidgetAuth && formWidgetAuth.hide) return false;
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
@@ -815,50 +817,79 @@ export const useForm = (props: ANY_OBJECT, formRef: Ref<FormInstance> | null = n
|
|||||||
// });
|
// });
|
||||||
// });
|
// });
|
||||||
};
|
};
|
||||||
|
const getPrintParamItem = (row, printParamList) => {
|
||||||
|
let param;
|
||||||
|
if (Array.isArray(printParamList)) {
|
||||||
|
param = printParamList
|
||||||
|
.map(item => {
|
||||||
|
const columnId = item.paramValue;
|
||||||
|
if (columnId != null) {
|
||||||
|
const column = dialogParams.value.formConfig.columnMap.get(columnId);
|
||||||
|
const value = row ? (row || {})[column.columnName] : getWidgetValueByColumn(column);
|
||||||
|
if (item.paramName != null && value != null) {
|
||||||
|
return {
|
||||||
|
paramName: item.paramName,
|
||||||
|
paramValue: value,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
})
|
||||||
|
.filter(item => item != null);
|
||||||
|
}
|
||||||
|
|
||||||
|
return param;
|
||||||
|
};
|
||||||
|
|
||||||
// TODO onPrint
|
// TODO onPrint
|
||||||
const onPrint = (operation: ANY_OBJECT, row: ANY_OBJECT | null, fileName: string) => {
|
const onPrint = (
|
||||||
|
operation: ANY_OBJECT,
|
||||||
|
row: ANY_OBJECT | null,
|
||||||
|
selectRows: ANY_OBJECT[] | undefined | null,
|
||||||
|
fileName: string,
|
||||||
|
) => {
|
||||||
console.log('onPrint', operation, row, fileName);
|
console.log('onPrint', operation, row, fileName);
|
||||||
if (operation == null) return;
|
if (operation == null) return;
|
||||||
// let printParam
|
let printParam;
|
||||||
// if (row != null) {
|
if (row != null) {
|
||||||
// let temp = getPrintParamItem(row, operation.printParamList)
|
const temp = getPrintParamItem(row, operation.printParamList);
|
||||||
// printParam = temp ? [temp] : []
|
printParam = temp ? [temp] : [];
|
||||||
// } else {
|
} else {
|
||||||
// if (this.selectRows.length <= 0) {
|
if (selectRows == null || selectRows?.length <= 0) {
|
||||||
// ElMessage.error('请选择要打印的数据!')
|
ElMessage.error('请选择要打印的数据!');
|
||||||
// return
|
return;
|
||||||
// }
|
}
|
||||||
// printParam = this.selectRows
|
printParam = selectRows
|
||||||
// .map((row) => {
|
.map(row => {
|
||||||
// return this.getPrintParamItem(row, operation.printParamList)
|
return getPrintParamItem(row, operation.printParamList);
|
||||||
// })
|
})
|
||||||
// .filter((item) => item != null)
|
.filter(item => item != null);
|
||||||
// }
|
}
|
||||||
// let params = {
|
const params = {
|
||||||
// datasourceId: masterTable.value.datasource.datasourceId,
|
datasourceId: masterTable.value.datasource.datasourceId,
|
||||||
// printId: operation.printTemplateId,
|
printId: operation.printTemplateId,
|
||||||
// printParams: printParam,
|
printParams: printParam,
|
||||||
// }
|
};
|
||||||
// post(
|
post(
|
||||||
// API_CONTEXT + '/online/onlineOperation/print/' +
|
API_CONTEXT + '/online/onlineOperation/print/' + masterTable.value.datasource.variableName,
|
||||||
// masterTable.value.datasource.variableName,
|
params,
|
||||||
// params
|
)
|
||||||
// )
|
.then(res => {
|
||||||
// .then((res) => {
|
const downloadUrl = res.data;
|
||||||
// let downloadUrl = res.data
|
console.log('downloadUrl', downloadUrl);
|
||||||
// ajax
|
downloadBlob(downloadUrl as string, {}, 'get')
|
||||||
// .fetchDownloadBlob(downloadUrl, {}, fileName, 'get')
|
.then(blobData => {
|
||||||
// .then((blobData) => {
|
const pdfUrl = window.URL.createObjectURL(blobData as Blob);
|
||||||
// let pdfUrl = window.URL.createObjectURL(blobData)
|
window.open('./lib/pdfjs/web/viewer.html?file=' + pdfUrl);
|
||||||
// window.open('./lib/pdfjs/web/viewer.html?file=' + pdfUrl)
|
})
|
||||||
// })
|
.catch(e => {
|
||||||
// .catch((e) => {
|
console.log(e);
|
||||||
// console.log(e)
|
ElMessage.error(e);
|
||||||
// ElMessage.error(e)
|
});
|
||||||
// })
|
})
|
||||||
// })
|
.catch(e => {
|
||||||
// .catch((e) => {})
|
console.log(e);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const masterTablePrimaryKey = computed(() => {
|
const masterTablePrimaryKey = computed(() => {
|
||||||
|
|||||||
@@ -28,7 +28,6 @@
|
|||||||
:value="item.id"
|
:value="item.id"
|
||||||
:label="item.name"
|
:label="item.name"
|
||||||
/>
|
/>
|
||||||
:key="item.id" :value="item.id" :label="item.name" />
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
@@ -37,8 +36,8 @@
|
|||||||
key="express"
|
key="express"
|
||||||
>
|
>
|
||||||
<el-input
|
<el-input
|
||||||
:value="flowConditionForm.body"
|
:model-value="flowConditionForm.body"
|
||||||
@input="onExpressionBodyChange"
|
@update:modelValue="onExpressionBodyChange"
|
||||||
clearable
|
clearable
|
||||||
type="textarea"
|
type="textarea"
|
||||||
:disabled="flowConditionForm.type === 'operation'"
|
:disabled="flowConditionForm.type === 'operation'"
|
||||||
|
|||||||
@@ -80,10 +80,6 @@
|
|||||||
<vxe-column title="按钮名称" min-width="100px">
|
<vxe-column title="按钮名称" min-width="100px">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<span style="font-size: 12px">{{ scope.row.label }}</span>
|
<span style="font-size: 12px">{{ scope.row.label }}</span>
|
||||||
<!-- <el-button class="table-btn" link style="text-decoration: underline;"
|
|
||||||
@click="onEditOperation(scope.row)">
|
|
||||||
{{scope.row.label}}
|
|
||||||
</el-button> -->
|
|
||||||
</template>
|
</template>
|
||||||
</vxe-column>
|
</vxe-column>
|
||||||
<vxe-column title="按钮类型" min-width="100px">
|
<vxe-column title="按钮类型" min-width="100px">
|
||||||
@@ -237,7 +233,9 @@ const onSetOnlineFormAuth = () => {
|
|||||||
formWidgetConfig.mobile.widgetList.length > 0
|
formWidgetConfig.mobile.widgetList.length > 0
|
||||||
) {
|
) {
|
||||||
tempConfig.mobile = {
|
tempConfig.mobile = {
|
||||||
widgetList: formWidgetConfig.mobile.widgetList.map(subWidget => formatOnlineFormInfo(subWidget))
|
widgetList: formWidgetConfig.mobile.widgetList.map(subWidget =>
|
||||||
|
formatOnlineFormInfo(subWidget),
|
||||||
|
),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -246,12 +244,12 @@ const onSetOnlineFormAuth = () => {
|
|||||||
'设置表单权限',
|
'设置表单权限',
|
||||||
FormSetOnlineFormAuth,
|
FormSetOnlineFormAuth,
|
||||||
{
|
{
|
||||||
area: ['1000px', '700px']
|
area: ['1000px', '700px'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
formAuth: formData.value.formAuth || {},
|
formAuth: formData.value.formAuth || {},
|
||||||
formWidgetConfig: tempConfig,
|
formWidgetConfig: tempConfig,
|
||||||
path: 'thirdSetOnlineFormAuth'
|
path: 'thirdSetOnlineFormAuth',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
width: '1000px',
|
width: '1000px',
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ const buildWidgetAuthInfo = (widget, authData) => {
|
|||||||
const onSubmit = () => {
|
const onSubmit = () => {
|
||||||
let authData = {
|
let authData = {
|
||||||
pc: {},
|
pc: {},
|
||||||
mobile: {}
|
mobile: {},
|
||||||
};
|
};
|
||||||
pcFormWidgetList.value.forEach(item => {
|
pcFormWidgetList.value.forEach(item => {
|
||||||
buildWidgetAuthInfo(item, authData.pc);
|
buildWidgetAuthInfo(item, authData.pc);
|
||||||
@@ -124,7 +124,7 @@ const setParentStatus = (widget, fieldName, val) => {
|
|||||||
activeTableData.value,
|
activeTableData.value,
|
||||||
widget.formId,
|
widget.formId,
|
||||||
'formId',
|
'formId',
|
||||||
'children'
|
'children',
|
||||||
);
|
);
|
||||||
if (Array.isArray(parentPath)) {
|
if (Array.isArray(parentPath)) {
|
||||||
parentPath.forEach(parent => {
|
parentPath.forEach(parent => {
|
||||||
@@ -146,9 +146,7 @@ const setChildStatus = (widget, fieldName, val) => {
|
|||||||
|
|
||||||
const onWidgetDisableChange = (widget, val) => {
|
const onWidgetDisableChange = (widget, val) => {
|
||||||
// 当val为true时,当前组件的所有子组件都禁用,当val为false时,当前组件的父组件都启用
|
// 当val为true时,当前组件的所有子组件都禁用,当val为false时,当前组件的父组件都启用
|
||||||
val
|
val ? setChildStatus(widget, 'disabled', val) : setParentStatus(widget, 'disabled', val);
|
||||||
? setChildStatus(widget, 'disabled', val)
|
|
||||||
: setParentStatus(widget, 'disabled', val);
|
|
||||||
if (activeName.value === 'pc') {
|
if (activeName.value === 'pc') {
|
||||||
pcFormWidgetList.value = [...pcFormWidgetList.value];
|
pcFormWidgetList.value = [...pcFormWidgetList.value];
|
||||||
} else {
|
} else {
|
||||||
@@ -158,9 +156,7 @@ const onWidgetDisableChange = (widget, val) => {
|
|||||||
|
|
||||||
const onWidgetHideChange = (widget, val) => {
|
const onWidgetHideChange = (widget, val) => {
|
||||||
// 当val为true时,当前组件的所有子组件都隐藏,当val为false时,当前组件的父组件都显示
|
// 当val为true时,当前组件的所有子组件都隐藏,当val为false时,当前组件的父组件都显示
|
||||||
val
|
val ? setChildStatus(widget, 'hidden', val) : setParentStatus(widget, 'hidden', val);
|
||||||
? setChildStatus(widget, 'hidden', val)
|
|
||||||
: setParentStatus(widget, 'hidden', val);
|
|
||||||
if (activeName.value === 'pc') {
|
if (activeName.value === 'pc') {
|
||||||
pcFormWidgetList.value = [...pcFormWidgetList.value];
|
pcFormWidgetList.value = [...pcFormWidgetList.value];
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user