提交 21a26adb 编写于 作者: ibizdev's avatar ibizdev

lxm1993 发布系统代码 [TrainSys,网页端]

上级 2baa2efd
......@@ -8,7 +8,7 @@
<link type="text/css" href="/assets/fontawesome/css/fontawesome.min.css" rel="stylesheet" />
<link type="text/css" href="/assets/fontawesome/css/solid.min.css" rel="stylesheet" />
<link type="text/css" href="/extras/css/iview.css" rel="stylesheet" />
<script src="/extras/js/system.min.js"></script>
<script src="/extras/js/system/6.13.0/system.min.js"></script>
<script type="systemjs-importmap" src="/extras/json/system-import.json" crossorigin="anonymous"></script>
<script src="/environments/environment.js"></script>
<script type="module" src="/assets/ionicons/ionicons/ionicons.esm.js"></script>
......@@ -29,4 +29,4 @@
</div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
</html>
\ No newline at end of file
......@@ -26,7 +26,10 @@ export default defineComponent({
watch(
() => props.value,
(newVal, oldVal) => {
if (newVal && newVal !== oldVal) {
if (newVal !== oldVal) {
if (!newVal) {
text.value = '';
}
if (c.valueFormat) {
text.value = dayjs(newVal).format(c.valueFormat);
} else {
......@@ -37,6 +40,9 @@ export default defineComponent({
}
}
},
{
immediate: true,
},
);
return {
......
......@@ -30,6 +30,27 @@ export const FormItem = defineComponent({
return null;
}
const data = computed(() => this.controller.data);
// 编辑器内容
let editor = null;
if (this.c.form.isLoaded) {
if (this.controller.editorProvider) {
editor = h(this.controller.editorProvider.formEditor, {
props: {
value: this.value,
data,
controller: this.controller.editor,
disable: this.controller.disabled,
},
on: {
change: this.onValueChange,
},
});
} else {
editor = <not-supported-editor modelData={this.modelData.editor} />;
}
}
return (
<form-item-container
class={[this.ns.b(), this.ns.m(this.modelData.modelClass)]}
......@@ -39,21 +60,7 @@ export const FormItem = defineComponent({
label-pos={this.c.model.labelPos}
label-width={this.c.model.labelWidth}
>
{this.c.form.isLoaded && this.controller.editorProvider ? (
h(this.controller.editorProvider.formEditor, {
props: {
value: this.value,
data,
controller: this.controller.editor,
disable: this.controller.disabled,
},
on: {
change: this.onValueChange,
},
})
) : (
<not-supported-editor modelData={this.modelData.editor} />
)}
{editor}
</form-item-container>
);
},
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册