数据源
-
-
+
+
内容设置
@@ -17,10 +17,10 @@
-
+
-
+
@@ -39,6 +39,10 @@
import Dialog from './components/dialog.vue';
import DragIndex from './components/index.vue';
import { cloneDeep } from 'lodash';
+import CustomAPI from '@/api/custom';
+import { DataSourceStore } from '@/store';
+const data_source = DataSourceStore();
+
const props = defineProps({
value: {
type: Object,
@@ -53,12 +57,33 @@ const form = reactive(props.value);
let custom_list = reactive([]);
const center_height = ref(0);
-const options = [
- { id: 1, label: 'Option A', desc: 'Option A - 230506' },
- { id: 2, label: 'Option B', desc: 'Option B - 230506' },
- { id: 3, label: 'Option C', desc: 'Option C - 230506' },
- { id: 4, label: 'Option A', desc: 'Option A - 230507' },
-];
+const options = ref([]);
+interface data_list {
+ name: string;
+ field: string;
+ type: string;
+};
+interface source_list {
+ name: string;
+ data: data_list[];
+ type: string;
+};
+const init = () => {
+ CustomAPI.getCustominit().then((res) => {
+ const { data_source } = res.data;
+ options.value = data_source;
+ data_source.set_data_source(data_source);
+ });
+}
+
+onBeforeMount(() => {
+ if (!data_source.is_data_source_api) {
+ data_source.set_is_data_source_api(true);
+ init();
+ } else {
+ options.value = data_source.data_source_list;
+ }
+});
const diy_data = ref({
key: '',
@@ -96,6 +121,15 @@ const accomplish = () => {
}
form.height = center_height.value;
};
+const model_data_source = ref([])
+const changeDataSource = (key: any) => {
+ const list = options.value.filter(item => item.type == key);
+ if (list.length > 0) {
+ model_data_source.value = list[0].data;
+ } else {
+ model_data_source.value = [];
+ }
+}
diff --git a/src/components/model-shop-tabs/model-shop-tabs-content.vue b/src/components/model-shop-tabs/model-shop-tabs-content.vue
index c3f4b836..60debdb3 100644
--- a/src/components/model-shop-tabs/model-shop-tabs-content.vue
+++ b/src/components/model-shop-tabs/model-shop-tabs-content.vue
@@ -59,12 +59,12 @@
-
+
-
+
@@ -95,6 +95,14 @@