Browse Source

修复一些问题

main
likunming 3 weeks ago
parent
commit
e52ddb86cf
  1. 2
      io.sc.platform.core.frontend/src/platform/components-ext/formater/DatetimeFormater.ts
  2. 2
      io.sc.platform.core.frontend/src/platform/components/date/WDateRange.vue
  3. 36
      io.sc.platform.core.frontend/src/platform/components/dialog/WLoadingDialog.vue
  4. 8
      io.sc.platform.core.frontend/src/platform/components/form/FormField.ts
  5. 11
      io.sc.platform.core.frontend/src/platform/components/grid/WGrid.vue
  6. 3
      io.sc.platform.core.frontend/src/platform/components/index.ts
  7. 30
      io.sc.platform.core.frontend/src/platform/components/workflow/WWorkflowAction.vue
  8. 1
      io.sc.platform.core.frontend/src/platform/index.ts
  9. 12
      io.sc.platform.core.frontend/src/platform/layout/sub-layout/AsyncTaskDialog.vue
  10. 4
      io.sc.platform.system/src/main/java/io/sc/platform/system/task/jpa/repository/TaskRepository.java

2
io.sc.platform.core.frontend/src/platform/components-ext/formater/DatetimeFormater.ts

@ -7,7 +7,7 @@ import { DateTools } from '@/platform/utils';
*/
const dateOnlyFormater = (value) => {
if (value) {
return '<span title="' + value + '">' + DateTools.format(value, 'YYYY-MM-DD') + '</span>';
return DateTools.format(value, 'YYYY-MM-DD');
}
return '';
};

2
io.sc.platform.core.frontend/src/platform/components/date/WDateRange.vue

@ -11,6 +11,7 @@
name: 'from',
type: 'w-date',
autoClose: false,
clearable: true,
options: (date) => {
if (dateRangeRef) {
const toValue = dateRangeRef.getFieldValue('to');
@ -27,6 +28,7 @@
name: 'to',
type: 'w-date',
autoClose: false,
clearable: true,
options: (date) => {
if (dateRangeRef) {
const fromValue = dateRangeRef.getFieldValue('from');

36
io.sc.platform.core.frontend/src/platform/components/dialog/WLoadingDialog.vue

@ -0,0 +1,36 @@
<template>
<q-dialog v-model="alert" no-esc-dismiss no-backdrop-dismiss>
<q-card style="width: 300px; height: 200px">
<q-card-section class="w-full h-full">
<div style="display: flex; justify-content: center; align-items: center; height: 100%; flex-direction: column">
<div>
<q-spinner-gears color="primary" size="5.5em" />
</div>
<div>
{{ msg }}
</div>
</div>
</q-card-section>
</q-card>
</q-dialog>
</template>
<script setup lang="ts">
import { ref } from 'vue';
const alert = ref(false);
const msg = ref('');
const show = (msg_: string = '正在处理,请稍等...') => {
msg.value = msg_;
alert.value = true;
};
const hide = () => {
alert.value = false;
};
defineExpose({
show,
hide,
});
</script>

8
io.sc.platform.core.frontend/src/platform/components/form/FormField.ts

@ -104,7 +104,7 @@ export abstract class FormFieldMethods {
if (typeof props_.requiredIf === 'boolean') {
return props_.requiredIf;
} else if (typeof props_.requiredIf === 'function') {
return props_.requiredIf({ value: value_, form: props_.form }) || false;
return props_.requiredIf({ value: value_, form: props_.form, name: props_.name }) || false;
}
}
return false;
@ -120,7 +120,7 @@ export abstract class FormFieldMethods {
if (typeof props_.showIf === 'boolean') {
return props_.showIf;
} else if (typeof props_.showIf === 'function') {
return props_.showIf({ value: value_, form: props_.form }) || false;
return props_.showIf({ value: value_, form: props_.form, name: props_.name }) || false;
}
}
return true;
@ -139,7 +139,7 @@ export abstract class FormFieldMethods {
if (typeof props_.readOnlyIf === 'boolean') {
return props_.readOnlyIf;
} else if (typeof props_.readOnlyIf === 'function') {
return props_.readOnlyIf({ value: value_, form: props_.form }) || false;
return props_.readOnlyIf({ value: value_, form: props_.form, name: props_.name }) || false;
}
}
return false;
@ -155,7 +155,7 @@ export abstract class FormFieldMethods {
if (typeof props_.disableIf === 'boolean') {
return props_.disableIf;
} else if (typeof props_.disableIf === 'function') {
return props_.disableIf({ value: value_, form: props_.form }) || false;
return props_.disableIf({ value: value_, form: props_.form, name: props_.name }) || false;
}
}
return false;

11
io.sc.platform.core.frontend/src/platform/components/grid/WGrid.vue

@ -76,7 +76,7 @@
</template>
<script setup lang="ts">
import { getCurrentInstance, nextTick, onMounted, provide, ref, useAttrs, watch, watchEffect, onActivated } from 'vue';
import { getCurrentInstance, nextTick, onMounted, provide, ref, useAttrs, watch, watchEffect, onActivated, onUnmounted } from 'vue';
import { $t, Tools, VueTools, eventBus } from '@/platform';
import Body from './Body.vue';
import Editor from './extra/Editor.vue';
@ -170,6 +170,11 @@ watchEffect(() => {
tools.opFM.resetStyleVariableValue(10);
}
});
const handleGlobalEnter = (e) => {
if (e.key === 'Enter' && tools.props.queryFormFields && tools.props.queryFormFields.length > 0) {
tools.apiFM.button.query();
}
};
//
onMounted(async () => {
@ -186,6 +191,10 @@ onMounted(async () => {
tools.opFM.resetStyleVariableValue();
}
tools.opFM.setStripe();
window.addEventListener('keydown', handleGlobalEnter);
});
onUnmounted(() => {
window.removeEventListener('keydown', handleGlobalEnter);
});
//
onActivated(() => {

3
io.sc.platform.core.frontend/src/platform/components/index.ts

@ -3,6 +3,7 @@ import type { App } from 'vue';
import WPlatformPage from './app/WPlatformPage.vue';
import WDialog from './dialog/WDialog.vue';
import WLoadingDialog from './dialog/WLoadingDialog.vue';
import WDrawer from './drawer/WDrawer.vue';
@ -74,6 +75,7 @@ export default {
app.component('WPlatformPage', WPlatformPage);
app.component('WDialog', WDialog);
app.component('WLoadingDialog', WLoadingDialog);
app.component('WDrawer', WDrawer);
@ -144,6 +146,7 @@ export default {
export {
WPlatformPage,
WDialog,
WLoadingDialog,
WDrawer,
WForm,
WCodeMirror,

30
io.sc.platform.core.frontend/src/platform/components/workflow/WWorkflowAction.vue

@ -3,6 +3,7 @@
<q-btn v-for="action in actionsRef" :key="action.name" :label="action.title" color="primary" @click="buttonClick(action)"></q-btn>
</div>
<WSelectAssigneeDialog ref="selectAssigneeDialogRef" @assignee-selected="assigneeSelected"></WSelectAssigneeDialog>
<w-loading-dialog ref="loadingDialogRef"></w-loading-dialog>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue';
@ -66,6 +67,7 @@ const { t } = useI18n();
const actionsRef = ref([]);
const selectAssigneeDialogRef = ref();
const currentActionRef = ref(null);
const loadingDialogRef = ref();
const buildActions = (taskId: string) => {
axios.get(Environment.apiContextPath(props.gobackActionUrl + '/' + taskId)).then((data) => {
@ -122,11 +124,18 @@ const buildButtons = (gobacks) => {
};
const buttonClick = (action) => {
emit('beforeSubmit', action, (value) => {
emit('beforeSubmit', action, (value, message_) => {
if (value) {
DialogManager.confirm(t('lcdp.bpm.completeTask.action.tip', { action: action.title }), () => {
let msg = t('lcdp.bpm.completeTask.action.tip', { action: action.title });
if (message_) {
msg = message_;
}
DialogManager.confirm(msg, () => {
loadingDialogRef.value.show();
currentActionRef.value = action;
axios.post(props.actionUrl + '/' + props.taskId, getSubmitData(action)).then((response) => {
axios
.post(props.actionUrl + '/' + props.taskId, getSubmitData(action))
.then((response) => {
if (response.data.code === 0) {
//
emit('afterSubmit');
@ -134,6 +143,11 @@ const buttonClick = (action) => {
//
selectAssigneeDialogRef.value.open(response.data);
}
})
.finally(() => {
if (loadingDialogRef.value) {
loadingDialogRef.value.hide();
}
});
});
}
@ -141,12 +155,20 @@ const buttonClick = (action) => {
};
const assigneeSelected = (assignee) => {
axios.post(props.actionUrl + '/' + props.taskId, getSubmitData(currentActionRef.value, assignee)).then((response) => {
loadingDialogRef.value.show();
axios
.post(props.actionUrl + '/' + props.taskId, getSubmitData(currentActionRef.value, assignee))
.then((response) => {
const rawData = response.data;
if (rawData.code === 0) {
//
emit('afterSubmit');
}
})
.finally(() => {
if (loadingDialogRef.value) {
loadingDialogRef.value.hide();
}
});
};

1
io.sc.platform.core.frontend/src/platform/index.ts

@ -134,6 +134,7 @@ export { AuditorEntityManager, CorporationAuditorEntityManager } from './compone
export {
WPlatformPage,
WDialog,
WLoadingDialog,
WDrawer,
WForm,
WCodeMirror,

12
io.sc.platform.core.frontend/src/platform/layout/sub-layout/AsyncTaskDialog.vue

@ -71,12 +71,13 @@
<script setup lang="ts">
import { ref } from 'vue';
import { useInterval } from 'quasar';
import { $t, axios, Environment, DialogManager, Downloader } from '@/platform';
import { $t, axios, Environment, DialogManager, Downloader, SessionManager } from '@/platform';
const { registerInterval, removeInterval } = useInterval();
const seamlessDialogRef = ref();
const show = ref(false);
const tasksRef = ref([]);
const user = SessionManager.getUser();
const open = () => {
show.value = true;
@ -120,7 +121,14 @@ const remove = (task) => {
};
const refresh = () => {
axios.get(Environment.apiContextPath('/api/system/task?page=1&size=10&pageable=true&sortBy=-createDate')).then((response) => {
const urlSearchParams = new URLSearchParams();
const criteria = {
fieldName: 'creator',
operator: 'equals',
value: user['loginName'],
};
urlSearchParams.append('criteria', JSON.stringify(criteria));
axios.get(Environment.apiContextPath('/api/system/task?page=1&size=10&pageable=true&sortBy=-createDate'), { params: urlSearchParams }).then((response) => {
tasksRef.value = response.data.content;
});
};

4
io.sc.platform.system/src/main/java/io/sc/platform/system/task/jpa/repository/TaskRepository.java

@ -4,7 +4,9 @@ import io.sc.platform.orm.repository.DaoRepository;
import io.sc.platform.system.task.jpa.entity.TaskEntity;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository("io.sc.platform.system.task.jpa.repository.TaskRepository")
public interface TaskRepository extends DaoRepository<TaskEntity,String> {
List<TaskEntity> findByCreator(String creator);
}

Loading…
Cancel
Save