|
@@ -9,12 +9,11 @@
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="文物编号:">
|
|
|
- {{ data.unicode }}
|
|
|
<el-input
|
|
|
- v-model="data.unicode"
|
|
|
+ v-model.trim="data.unicode"
|
|
|
style="width: 100%"
|
|
|
:maxlength="500"
|
|
|
- placeholder="请输入字母或数字组合"
|
|
|
+ placeholder="请输入"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="文物级别:">
|
|
@@ -52,7 +51,7 @@
|
|
|
import { QuiskExpose } from "@/helper/mount";
|
|
|
import { Relics, relicsLevelDesc, relicsTypeDesc } from "@/store/relics";
|
|
|
import { ElMessage } from "element-plus";
|
|
|
-import { computed, ref, watch } from "vue";
|
|
|
+import { computed, ref } from "vue";
|
|
|
|
|
|
const props = defineProps<{
|
|
|
relics?: Relics;
|
|
@@ -60,16 +59,16 @@ const props = defineProps<{
|
|
|
}>();
|
|
|
const data = ref<Relics>(props.relics ? { ...props.relics } : { name: "", relicsId: -1 });
|
|
|
|
|
|
-watch(
|
|
|
- () => data.value.unicode,
|
|
|
- (newv) => {
|
|
|
- if (newv && !/^[a-zA-Z0-9]+$/.test(newv)) {
|
|
|
- const reg = newv.replace(/[^a-zA-Z0-9]+/gi, "");
|
|
|
- Promise.resolve().then(() => (data.value.unicode = reg));
|
|
|
- ElMessage.error("文物编号仅支持字母或数字组合");
|
|
|
- }
|
|
|
- }
|
|
|
-);
|
|
|
+// watch(
|
|
|
+// () => data.value.unicode,
|
|
|
+// (newv) => {
|
|
|
+// if (newv && !/^[a-zA-Z0-9]+$/.test(newv)) {
|
|
|
+// const reg = newv.replace(/[^a-zA-Z0-9]+/gi, "");
|
|
|
+// Promise.resolve().then(() => (data.value.unicode = reg));
|
|
|
+// ElMessage.error("文物编号仅支持字母或数字组合");
|
|
|
+// }
|
|
|
+// }
|
|
|
+// );
|
|
|
|
|
|
defineExpose<QuiskExpose>({
|
|
|
title: computed(() => `${props.relics ? "修改" : "添加"}文物`),
|