|
@@ -2,6 +2,7 @@
|
|
|
<el-drawer
|
|
|
v-model="commonS.isShowSelectModule"
|
|
|
:append-to-body="true"
|
|
|
+ :close-on-click-modal="false"
|
|
|
:destroy-on-close="true"
|
|
|
:show-close="false"
|
|
|
size="50%"
|
|
@@ -47,7 +48,7 @@ const singleTableRef = ref<InstanceType<typeof ElTable>>();
|
|
|
const setCurrent = (row?: ScreenComponent) => {
|
|
|
singleTableRef.value && singleTableRef.value.setCurrentRow(row);
|
|
|
};
|
|
|
-const handleCurrentChange = (val) => {
|
|
|
+const handleCurrentChange = (val: ScreenComponent) => {
|
|
|
currentRow.value = val;
|
|
|
};
|
|
|
const tableData = ref<ScreenComponent[]>([]);
|
|
@@ -64,7 +65,13 @@ onMounted(() => {
|
|
|
|
|
|
const handleSubmit = () => {
|
|
|
if (currentRow.value && currentRow.value.key) {
|
|
|
- commonS[commonS.moduleKey as string] = currentRow.value.key;
|
|
|
+ let key = commonS.moduleKey as string;
|
|
|
+ if (key in commonS) {
|
|
|
+ commonS[key] = currentRow.value.key;
|
|
|
+ } else {
|
|
|
+ ElMessage.error("请选择正确的组件, 组件的key不存在");
|
|
|
+ }
|
|
|
+
|
|
|
commonS.isShowSelectModule = false;
|
|
|
}
|
|
|
};
|
|
@@ -74,4 +81,9 @@ const closeDialog = () => {
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
-<style lang="scss" scoped></style>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.dialog-footer {
|
|
|
+ display: flex;
|
|
|
+ justify-content: start;
|
|
|
+}
|
|
|
+</style>
|