Browse Source

update

main
wangshaoping 6 months ago
parent
commit
a7725c7e71
  1. 1
      build.gradle
  2. 2
      erm.frontend/package.json
  3. 2
      gradle.properties
  4. 2
      io.sc.engine.mv.frontend/package.json
  5. 2
      io.sc.engine.rule.frontend/package.json
  6. 2
      io.sc.engine.st.frontend/package.json
  7. 2
      io.sc.platform.core.frontend/package.json
  8. 185
      io.sc.platform.core.frontend/src/platform/components/code-mirror/WCodeMirror.vue
  9. 8
      io.sc.platform.core.frontend/src/views/testcase/code-mirror/code-mirror.vue
  10. 4
      io.sc.platform.core.frontend/template-project/package.json
  11. 8
      io.sc.platform.core.frontend/template-project/src/views/testcase/code-mirror/code-mirror.vue
  12. 2
      io.sc.platform.developer.frontend/package.json
  13. 2
      io.sc.platform.lcdp.frontend/package.json
  14. 2
      io.sc.platform.mvc.frontend/package.json
  15. 2
      io.sc.platform.scheduler.manager.frontend/package.json
  16. 2
      io.sc.platform.system.frontend/package.json
  17. 2
      io.sc.standard.frontend/package.json

1
build.gradle

@ -699,6 +699,7 @@ subprojects {
idea { idea {
module { module {
excludeDirs += file('node_modules') excludeDirs += file('node_modules')
excludeDirs += file('dist')
} }
} }
} }

2
erm.frontend/package.json

@ -92,7 +92,7 @@
"luckyexcel": "1.0.1", "luckyexcel": "1.0.1",
"mockjs": "1.1.0", "mockjs": "1.1.0",
"pinia": "2.2.2", "pinia": "2.2.2",
"platform-core": "8.1.334", "platform-core": "8.1.335",
"quasar": "2.16.11", "quasar": "2.16.11",
"tailwindcss": "3.4.10", "tailwindcss": "3.4.10",
"vue": "3.5.4", "vue": "3.5.4",

2
gradle.properties

@ -38,7 +38,7 @@ application_version=1.0.0
platform_group=io.sc platform_group=io.sc
platform_version=8.1.48 platform_version=8.1.48
platform_plugin_version=8.1.48 platform_plugin_version=8.1.48
platform_core_frontend_version=8.1.334 platform_core_frontend_version=8.1.335
########################################################### ###########################################################
# dependencies version # dependencies version

2
io.sc.engine.mv.frontend/package.json

@ -92,7 +92,7 @@
"luckyexcel": "1.0.1", "luckyexcel": "1.0.1",
"mockjs": "1.1.0", "mockjs": "1.1.0",
"pinia": "2.2.2", "pinia": "2.2.2",
"platform-core": "8.1.334", "platform-core": "8.1.335",
"quasar": "2.16.11", "quasar": "2.16.11",
"tailwindcss": "3.4.10", "tailwindcss": "3.4.10",
"vue": "3.5.4", "vue": "3.5.4",

2
io.sc.engine.rule.frontend/package.json

@ -92,7 +92,7 @@
"luckyexcel": "1.0.1", "luckyexcel": "1.0.1",
"mockjs": "1.1.0", "mockjs": "1.1.0",
"pinia": "2.2.2", "pinia": "2.2.2",
"platform-core": "8.1.334", "platform-core": "8.1.335",
"quasar": "2.16.11", "quasar": "2.16.11",
"tailwindcss": "3.4.10", "tailwindcss": "3.4.10",
"vue": "3.5.4", "vue": "3.5.4",

2
io.sc.engine.st.frontend/package.json

@ -92,7 +92,7 @@
"luckyexcel": "1.0.1", "luckyexcel": "1.0.1",
"mockjs": "1.1.0", "mockjs": "1.1.0",
"pinia": "2.2.2", "pinia": "2.2.2",
"platform-core": "8.1.334", "platform-core": "8.1.335",
"quasar": "2.16.11", "quasar": "2.16.11",
"tailwindcss": "3.4.10", "tailwindcss": "3.4.10",
"vue": "3.5.4", "vue": "3.5.4",

2
io.sc.platform.core.frontend/package.json

@ -1,6 +1,6 @@
{ {
"name": "platform-core", "name": "platform-core",
"version": "8.1.334", "version": "8.1.335",
"description": "前端核心包,用于快速构建前端的脚手架", "description": "前端核心包,用于快速构建前端的脚手架",
"//main": "库的主文件", "//main": "库的主文件",
"main": "dist/platform-core.js", "main": "dist/platform-core.js",

185
io.sc.platform.core.frontend/src/platform/components/code-mirror/WCodeMirror.vue

@ -1,5 +1,5 @@
<template> <template>
<div v-show="fieldMethodsClass.getShow(props, modelValue)"> <div v-show="fieldMethods.getShow(props, modelValue)">
<q-field <q-field
ref="fieldRef" ref="fieldRef"
v-model="modelValue" v-model="modelValue"
@ -9,23 +9,16 @@
:dense="true" :dense="true"
v-bind="attrs" v-bind="attrs"
style="position: relative" style="position: relative"
:rules="fieldMethodsClass.getRules(props, modelValue, fieldRef, undefined)" :rules="fieldMethods.getRules(props, modelValue, fieldRef, undefined)"
:readonly="fieldMethodsClass.getReadOnly(props, modelValue)" :readonly="fieldMethods.getReadOnly(props, modelValue)"
:disable="fieldMethodsClass.getDisable(props, modelValue)" :disable="fieldMethods.getDisable(props, modelValue)"
@focus.stop.prevent="focus"
@blur.stop.prevent="blur"
> >
<template #label><w-label :required="fieldMethodsClass.getRequired(props, modelValue)" :label="attrs.label"></w-label></template> <template #label><w-label :required="fieldMethods.getRequired(props, modelValue)" :label="attrs.label"></w-label></template>
<template #control> <template #control>
<div v-if="editable && toolbar" class="w-full pt-2 border-b border-b-gray-200"> <div v-if="editable && toolbar" class="w-full pt-2 border-b border-b-gray-200">
<Toolbar :source-code-editor="editorView" :user-defined-functions="userDefinedFunctions"></Toolbar> <Toolbar :source-code-editor="editorView" :user-defined-functions="userDefinedFunctions"></Toolbar>
</div> </div>
<div <div ref="codemirrorContainerRef" :style="`width:100%; padding-top: ${lineNumber ? 4 : 2}px; overflow: auto;`"></div>
ref="codemirrorRef"
:style="`width:100%; padding-top: ${lineNumber ? 4 : 2}px; overflow: auto;`"
@focus.stop.prevent="() => {}"
@click.stop.prevent="() => {}"
></div>
</template> </template>
<template v-if="!Tools.isEmpty(modelValue) && attrs.button" #append> <template v-if="!Tools.isEmpty(modelValue) && attrs.button" #append>
<q-btn <q-btn
@ -57,12 +50,12 @@ import * as search from '@codemirror/search';
import * as autocomplete from '@codemirror/autocomplete'; import * as autocomplete from '@codemirror/autocomplete';
import { LanguageSupport } from '@codemirror/language'; import { LanguageSupport } from '@codemirror/language';
import { html, htmlLanguage } from '@codemirror/lang-html'; import { html } from '@codemirror/lang-html';
import { java, javaLanguage } from '@codemirror/lang-java'; import { java } from '@codemirror/lang-java';
import { javascript, javascriptLanguage } from '@codemirror/lang-javascript'; import { javascript } from '@codemirror/lang-javascript';
import { json, jsonLanguage } from '@codemirror/lang-json'; import { json } from '@codemirror/lang-json';
import { sql } from '@codemirror/lang-sql'; import { sql } from '@codemirror/lang-sql';
import { xml, xmlLanguage } from '@codemirror/lang-xml'; import { xml } from '@codemirror/lang-xml';
import PlaceholderPlugin from './w-code-mirror/PlaceholderPlugin'; import PlaceholderPlugin from './w-code-mirror/PlaceholderPlugin';
import Toolbar from '@/platform/components/math/toolbar/Toolbar.vue'; import Toolbar from '@/platform/components/math/toolbar/Toolbar.vue';
@ -71,9 +64,10 @@ import { FormFieldProps } from '@/platform/components/form/FormField.ts';
import { FormFieldMethods } from '../form/FormField'; import { FormFieldMethods } from '../form/FormField';
const fieldRef = ref(); const fieldRef = ref();
const codemirrorRef = ref(); const codemirrorContainerRef = ref();
const attrs = useAttrs(); const attrs = useAttrs();
const modelValue = defineModel<string>(); const modelValue = defineModel<string>();
let editorView = null;
interface FieldProps extends FormFieldProps { interface FieldProps extends FormFieldProps {
// //
@ -100,8 +94,11 @@ interface FieldProps extends FormFieldProps {
lineBreak?: boolean; lineBreak?: boolean;
// //
placeholder?: boolean; placeholder?: boolean;
//
autoCompletion?: () => void; autoCompletion?: () => void;
//
userDefinedFunctions?: Array<() => void>; userDefinedFunctions?: Array<() => void>;
//
activateOnCompletion?: () => void; activateOnCompletion?: () => void;
} }
const props = withDefaults(defineProps<FieldProps>(), { const props = withDefaults(defineProps<FieldProps>(), {
@ -143,16 +140,14 @@ class FieldMethods extends FormFieldMethods {
return editorView.state.doc.toString(); return editorView.state.doc.toString();
}; };
clearValue = () => { clearValue = () => {
modelValue.value = undefined; modelValue.value = '';
}; };
} }
const fieldMethodsClass = new FieldMethods(); const fieldMethods = new FieldMethods();
const basicSetup = [ const basicSetup = [
EditorState.allowMultipleSelections.of(true), EditorState.allowMultipleSelections.of(true),
//view.lineNumbers(),
//view.highlightActiveLine(),
view.highlightActiveLineGutter(), view.highlightActiveLineGutter(),
view.highlightSpecialChars(), view.highlightSpecialChars(),
view.drawSelection(), view.drawSelection(),
@ -162,13 +157,10 @@ const basicSetup = [
commands.history(), commands.history(),
//language.foldGutter(),
language.indentOnInput(), language.indentOnInput(),
language.syntaxHighlighting(language.defaultHighlightStyle, { fallback: true }), language.syntaxHighlighting(language.defaultHighlightStyle, { fallback: true }),
language.bracketMatching(), language.bracketMatching(),
//search.highlightSelectionMatches(),
view.keymap.of([ view.keymap.of([
...commands.defaultKeymap, ...commands.defaultKeymap,
...commands.historyKeymap, ...commands.historyKeymap,
@ -200,9 +192,14 @@ const getLanguage = (lang: string): LanguageSupport => {
} }
}; };
let editorView; //
let isFocus = false; //
basicSetup.push(EditorView.editable.of(props.editable));
if (props.lineWrap) {
//
basicSetup.push(EditorView.lineWrapping);
}
if (props.lineNumber) { if (props.lineNumber) {
// //
basicSetup.push(view.lineNumbers()); basicSetup.push(view.lineNumbers());
@ -219,87 +216,77 @@ if (props.placeholder) {
basicSetup.push(PlaceholderPlugin); basicSetup.push(PlaceholderPlugin);
} }
if (props.lineWrap) {
basicSetup.push(EditorView.lineWrapping);
}
//
basicSetup.push(EditorView.editable.of(props.editable));
onMounted(() => { onMounted(() => {
if (codemirrorRef.value) { let language = new Compartment();
let language = new Compartment(); let tabSize = new Compartment();
let tabSize = new Compartment(); editorView = new EditorView({
editorView = new EditorView({ extensions: [
extensions: [ //
basicSetup, basicSetup,
language.of(getLanguage(props.lang)), //
tabSize.of(EditorState.tabSize.of(props.tabSize)), language.of(getLanguage(props.lang)),
EditorState.readOnly.of(fieldMethodsClass.getReadOnly(props, modelValue.value)), // tab size
EditorView.theme({ tabSize.of(EditorState.tabSize.of(props.tabSize)),
'&': { //
outline: 'none !important', EditorState.readOnly.of(fieldMethods.getReadOnly(props, modelValue.value)),
width: Tools.px(props.width), //
height: props.height ? Tools.px(props.height) : props.rows * 20 + (props.lineNumber ? 8 : 6) + 'px', EditorView.theme({
}, '&': {
'.cm-content': { outline: 'none !important',
'line-height': props.lineHeight + 'px', width: Tools.px(props.width),
}, height: props.height ? Tools.px(props.height) : props.rows * 20 + (props.lineNumber ? 8 : 6) + 'px',
}), },
'.cm-content': {
'line-height': props.lineHeight + 'px',
},
}),
// , , blur //
EditorView.updateListener.of(function (e) { EditorView.updateListener.of((e) => {
// emits('update:modelValue', e.state.doc.toString()); //
if (e.docChanged) {
let content = e.state.doc.toString(); let content = e.state.doc.toString();
// ,
if (!props.lineBreak) { if (!props.lineBreak) {
content = content?.replace(/[\r\n]/g, ''); content = content?.replace(/[\r\n]/g, '');
} }
if (content !== modelValue.value) { //
fieldMethodsClass.updateValue(content); if (props.placeholder) {
const reg = /\$\{(.+?)\}\.\$\{(.+?)\}/g;
while (reg.test(content)) {
content = content.replace(reg, '${$1.$2}');
}
} }
//updateModelValue(content); //
}), modelValue.value = content;
],
parent: codemirrorRef.value,
doc: modelValue.value,
});
watch(
() => modelValue.value,
() => {
// ,,
if (!isFocus) {
let content = modelValue.value;
if (!props.lineBreak && !Tools.isEmpty(content)) {
content = content.replace(/[\r\n]/g, '');
}
editorView.dispatch({ changes: { from: 0, to: editorView.state.doc.length, insert: content } });
} }
}, }),
); ],
} parent: codemirrorContainerRef.value,
//
doc: modelValue.value,
});
watch(
() => modelValue.value,
() => {
// , , 便
// , ,
if (!editorView.hasFocus) {
let content = modelValue.value;
if (!props.lineBreak && !Tools.isEmpty(content)) {
content = content.replace(/[\r\n]/g, '');
}
editorView.dispatch({ changes: { from: 0, to: editorView.state.doc.length, insert: content } });
}
},
);
}); });
onUnmounted(() => { onUnmounted(() => {
editorView.destroy(); editorView.destroy();
}); });
const focus = () => {
isFocus = true;
};
const blur = () => {
isFocus = false;
let content = editorView.state.doc.toString();
if (Tools.isUndefinedOrNull(content) || content === modelValue.value) {
return;
}
const reg = /\$\{(.+?)\}\.\$\{(.+?)\}/g;
while (reg.test(content)) {
content = content.replace(reg, '${$1.$2}');
}
modelValue.value = content;
};
const configure = (values) => { const configure = (values) => {
editorView.dispatch({ effects: StateEffect.reconfigure.of(values) }); editorView.dispatch({ effects: StateEffect.reconfigure.of(values) });
}; };
@ -314,10 +301,10 @@ const buttonClick = (button) => {
}; };
defineExpose({ defineExpose({
validate: fieldMethodsClass.validate, validate: fieldMethods.validate,
setValue: fieldMethodsClass.setValue, setValue: fieldMethods.setValue,
getValue: fieldMethodsClass.getValue, getValue: fieldMethods.getValue,
clearValue: fieldMethodsClass.clearValue, clearValue: fieldMethods.clearValue,
configure, configure,
}); });
</script> </script>

8
io.sc.platform.core.frontend/src/views/testcase/code-mirror/code-mirror.vue

@ -16,10 +16,10 @@ import { AutoCompletionManager } from './AutoCompletionManager';
import { AutoCompletionManager2 } from './AutoCompletionManager2'; import { AutoCompletionManager2 } from './AutoCompletionManager2';
const autoCompletionManager = new AutoCompletionManager(); const autoCompletionManager = new AutoCompletionManager();
axios.get(Environment.apiContextPath('/api/re/common/listParameterAndValueTypeByIndicatorId/bc8add2e-df95-44f3-96f5-e9d106a48729')).then((response) => { // axios.get(Environment.apiContextPath('/api/re/common/listParameterAndValueTypeByIndicatorId/bc8add2e-df95-44f3-96f5-e9d106a48729')).then((response) => {
autoCompletionManager.setParameters(response.data.parameters); // autoCompletionManager.setParameters(response.data.parameters);
autoCompletionManager.setValueTypes(response.data.valueTypes); // autoCompletionManager.setValueTypes(response.data.valueTypes);
}); // });
const autoCompletion = (context) => { const autoCompletion = (context) => {
return autoCompletionManager.autoCompletion(context); return autoCompletionManager.autoCompletion(context);

4
io.sc.platform.core.frontend/template-project/package.json

@ -1,6 +1,6 @@
{ {
"name": "platform-core", "name": "platform-core",
"version": "8.1.334", "version": "8.1.335",
"description": "前端核心包,用于快速构建前端的脚手架", "description": "前端核心包,用于快速构建前端的脚手架",
"private": false, "private": false,
"keywords": [], "keywords": [],
@ -105,7 +105,7 @@
"luckyexcel": "1.0.1", "luckyexcel": "1.0.1",
"mockjs": "1.1.0", "mockjs": "1.1.0",
"pinia": "2.2.2", "pinia": "2.2.2",
"platform-core": "8.1.334", "platform-core": "8.1.335",
"quasar": "2.16.11", "quasar": "2.16.11",
"svg-path-commander": "2.0.10", "svg-path-commander": "2.0.10",
"tailwindcss": "3.4.10", "tailwindcss": "3.4.10",

8
io.sc.platform.core.frontend/template-project/src/views/testcase/code-mirror/code-mirror.vue

@ -16,10 +16,10 @@ import { AutoCompletionManager } from './AutoCompletionManager';
import { AutoCompletionManager2 } from './AutoCompletionManager2'; import { AutoCompletionManager2 } from './AutoCompletionManager2';
const autoCompletionManager = new AutoCompletionManager(); const autoCompletionManager = new AutoCompletionManager();
axios.get(Environment.apiContextPath('/api/re/common/listParameterAndValueTypeByIndicatorId/bc8add2e-df95-44f3-96f5-e9d106a48729')).then((response) => { // axios.get(Environment.apiContextPath('/api/re/common/listParameterAndValueTypeByIndicatorId/bc8add2e-df95-44f3-96f5-e9d106a48729')).then((response) => {
autoCompletionManager.setParameters(response.data.parameters); // autoCompletionManager.setParameters(response.data.parameters);
autoCompletionManager.setValueTypes(response.data.valueTypes); // autoCompletionManager.setValueTypes(response.data.valueTypes);
}); // });
const autoCompletion = (context) => { const autoCompletion = (context) => {
return autoCompletionManager.autoCompletion(context); return autoCompletionManager.autoCompletion(context);

2
io.sc.platform.developer.frontend/package.json

@ -92,7 +92,7 @@
"luckyexcel": "1.0.1", "luckyexcel": "1.0.1",
"mockjs": "1.1.0", "mockjs": "1.1.0",
"pinia": "2.2.2", "pinia": "2.2.2",
"platform-core": "8.1.334", "platform-core": "8.1.335",
"quasar": "2.16.11", "quasar": "2.16.11",
"svg-path-commander": "2.0.10", "svg-path-commander": "2.0.10",
"tailwindcss": "3.4.10", "tailwindcss": "3.4.10",

2
io.sc.platform.lcdp.frontend/package.json

@ -92,7 +92,7 @@
"luckyexcel": "1.0.1", "luckyexcel": "1.0.1",
"mockjs": "1.1.0", "mockjs": "1.1.0",
"pinia": "2.2.2", "pinia": "2.2.2",
"platform-core": "8.1.334", "platform-core": "8.1.335",
"quasar": "2.16.11", "quasar": "2.16.11",
"tailwindcss": "3.4.10", "tailwindcss": "3.4.10",
"vue": "3.5.4", "vue": "3.5.4",

2
io.sc.platform.mvc.frontend/package.json

@ -92,7 +92,7 @@
"luckyexcel": "1.0.1", "luckyexcel": "1.0.1",
"mockjs": "1.1.0", "mockjs": "1.1.0",
"pinia": "2.2.2", "pinia": "2.2.2",
"platform-core": "8.1.334", "platform-core": "8.1.335",
"quasar": "2.16.11", "quasar": "2.16.11",
"tailwindcss": "3.4.10", "tailwindcss": "3.4.10",
"vue": "3.5.4", "vue": "3.5.4",

2
io.sc.platform.scheduler.manager.frontend/package.json

@ -92,7 +92,7 @@
"luckyexcel": "1.0.1", "luckyexcel": "1.0.1",
"mockjs": "1.1.0", "mockjs": "1.1.0",
"pinia": "2.2.2", "pinia": "2.2.2",
"platform-core": "8.1.334", "platform-core": "8.1.335",
"quasar": "2.16.11", "quasar": "2.16.11",
"tailwindcss": "3.4.10", "tailwindcss": "3.4.10",
"vue": "3.5.4", "vue": "3.5.4",

2
io.sc.platform.system.frontend/package.json

@ -92,7 +92,7 @@
"luckyexcel": "1.0.1", "luckyexcel": "1.0.1",
"mockjs": "1.1.0", "mockjs": "1.1.0",
"pinia": "2.2.2", "pinia": "2.2.2",
"platform-core": "8.1.334", "platform-core": "8.1.335",
"quasar": "2.16.11", "quasar": "2.16.11",
"tailwindcss": "3.4.10", "tailwindcss": "3.4.10",
"vue": "3.5.4", "vue": "3.5.4",

2
io.sc.standard.frontend/package.json

@ -92,7 +92,7 @@
"luckyexcel": "1.0.1", "luckyexcel": "1.0.1",
"mockjs": "1.1.0", "mockjs": "1.1.0",
"pinia": "2.2.2", "pinia": "2.2.2",
"platform-core": "8.1.334", "platform-core": "8.1.335",
"quasar": "2.16.11", "quasar": "2.16.11",
"tailwindcss": "3.4.10", "tailwindcss": "3.4.10",
"vue": "3.5.4", "vue": "3.5.4",

Loading…
Cancel
Save