wangshaoping 3 weeks ago
parent
commit
e237a25d61
  1. 6
      io.sc.platform.core.frontend/src/platform/components/dialog/WDialog.vue
  2. 11
      io.sc.platform.core.frontend/src/platform/components/form/WForm.vue
  3. 12
      io.sc.platform.core.frontend/src/platform/components/grid/Top.vue
  4. 4
      io.sc.platform.core.frontend/src/platform/components/grid/WGrid.vue
  5. 6
      io.sc.platform.core.frontend/src/platform/components/radio/WExtRadio.vue

6
io.sc.platform.core.frontend/src/platform/components/dialog/WDialog.vue

@ -17,12 +17,14 @@
> >
<q-card :style="generateDialogStyle"> <q-card :style="generateDialogStyle">
<q-card-section style="height: 59px"> <q-card-section style="height: 59px">
<div class="flex justify-between"> <div class="flex">
<div class="flex-1">
<div v-if="title" class="text-h6">{{ titleRef }}</div> <div v-if="title" class="text-h6">{{ titleRef }}</div>
<template v-else> <template v-else>
<slot name="title"></slot> <slot name="title"></slot>
</template> </template>
<div class="flex justify-end gap-4"> </div>
<div class="flex-none flex gap-4">
<template v-if="buttons && buttons.length > 0"> <template v-if="buttons && buttons.length > 0">
<template v-for="(btn, index) in buttons as any" :key="index"> <template v-for="(btn, index) in buttons as any" :key="index">
<q-btn <q-btn

11
io.sc.platform.core.frontend/src/platform/components/form/WForm.vue

@ -1,12 +1,14 @@
<template> <template>
<div> <div>
<q-form ref="formRef" :autofocus="false" :greedy="true" v-bind="attrs"> <q-form ref="formRef" :autofocus="false" :greedy="true" v-bind="attrs" @submit.prevent="handleSubmit">
<div v-if="form.fieldArray.value.length > 0" class="grid" :style="form.cm.formLayoutStyleComputed.value"> <div v-if="form.fieldArray.value.length > 0" class="grid" :style="form.cm.formLayoutStyleComputed.value">
<template v-for="(field, index) in form.fieldArray.value as any" :key="String(index)"> <template v-for="(field, index) in form.fieldArray.value as any" :key="String(index)">
<FormElement :field="field"></FormElement> <FormElement :field="field"></FormElement>
</template> </template>
</div> </div>
<slot></slot> <slot></slot>
<!-- 隐藏的提交按钮用于捕获回车事件 -->
<button type="submit" style="display: none"></button>
</q-form> </q-form>
</div> </div>
</template> </template>
@ -39,10 +41,17 @@ const props = defineProps({
}); });
const emit = defineEmits<{ const emit = defineEmits<{
(e: 'updateValue', args: object): void; (e: 'updateValue', args: object): void;
(e: 'submit', args: object): void;
}>(); }>();
const getFormRef = () => { const getFormRef = () => {
return formRef.value; return formRef.value;
}; };
const handleSubmit = (submitEvent: any) => {
emit('submit', {
form: instance,
value: toRaw(form.data),
});
};
const updateModelValue = (name: string, value: any) => { const updateModelValue = (name: string, value: any) => {
if ( if (
(form.fields[name] && (form.fields[name]['type'] !== 'w-number' || Number.isFinite(value)) && form.fields[name]['type'] !== 'w-integer') || (form.fields[name] && (form.fields[name]['type'] !== 'w-number' || Number.isFinite(value)) && form.fields[name]['type'] !== 'w-integer') ||

12
io.sc.platform.core.frontend/src/platform/components/grid/Top.vue

@ -6,7 +6,13 @@
</template> </template>
<template v-else> <template v-else>
<!-- 普通查询form --> <!-- 普通查询form -->
<w-form ref="formRef" v-bind="tools.props.queryFormAttrs" :fields="queryFormFieldsComputed" :cols-num="tools.props.queryFormColsNum"></w-form> <w-form
ref="formRef"
v-bind="tools.props.queryFormAttrs"
:fields="queryFormFieldsComputed"
:cols-num="tools.props.queryFormColsNum"
@submit="querySubmit"
></w-form>
</template> </template>
<!-- 标题与按钮 --> <!-- 标题与按钮 -->
@ -95,6 +101,10 @@ const queryFormColsNumComputed = computed(() => {
return screenCols[$q.screen.name]; return screenCols[$q.screen.name];
}); });
const querySubmit = () => {
tools.apiFM.button.query();
};
// form // form
const handleQueryFormShowField = () => { const handleQueryFormShowField = () => {
tools.table.queryFormDisplayFields = []; tools.table.queryFormDisplayFields = [];

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

@ -191,10 +191,10 @@ onMounted(async () => {
tools.opFM.resetStyleVariableValue(); tools.opFM.resetStyleVariableValue();
} }
tools.opFM.setStripe(); tools.opFM.setStripe();
window.addEventListener('keydown', handleGlobalEnter); // window.addEventListener('keydown', handleGlobalEnter);
}); });
onUnmounted(() => { onUnmounted(() => {
window.removeEventListener('keydown', handleGlobalEnter); // window.removeEventListener('keydown', handleGlobalEnter);
}); });
// //
onActivated(() => { onActivated(() => {

6
io.sc.platform.core.frontend/src/platform/components/radio/WExtRadio.vue

@ -123,10 +123,10 @@ const expandOptions = () => {
}; };
const lightLabelComputed = computed(() => { const lightLabelComputed = computed(() => {
if (props.lightNotHideOptionsLabel && !props.hideOptions) { //if (props.lightNotHideOptionsLabel && !props.hideOptions) {
// return true;
//}
return true; return true;
}
return false;
}); });
defineExpose({ defineExpose({

Loading…
Cancel
Save