|
@@ -11,6 +11,7 @@ let UrlList = reactive(null)
|
|
|
// 获取当前板块接口列表
|
|
|
onMounted(async () => {
|
|
|
UrlList = await getGroupUrl(["prizeSet"]);
|
|
|
+ databaseIdQuery();
|
|
|
|
|
|
})
|
|
|
const props = defineProps<{
|
|
@@ -30,6 +31,7 @@ const props = defineProps<{
|
|
|
}>();
|
|
|
// 表单数据
|
|
|
const UpdateForm: any = ref({
|
|
|
+ databaseId: null, //查询数据库
|
|
|
tableEnName: "", //查询表
|
|
|
id: null, //ID
|
|
|
|
|
@@ -62,8 +64,9 @@ const submit = async (formEl) => {
|
|
|
type: "success"
|
|
|
});
|
|
|
UpdateForm.value = {
|
|
|
- tableEnName: "", //查询表
|
|
|
- id: null, //ID
|
|
|
+ databaseId: null, //查询数据库
|
|
|
+ tableEnName: "", //查询表
|
|
|
+ id: null, //ID
|
|
|
|
|
|
};
|
|
|
// 关闭修改弹窗;
|
|
@@ -85,7 +88,14 @@ const submit = async (formEl) => {
|
|
|
})
|
|
|
};
|
|
|
|
|
|
-
|
|
|
+//获取查询库数据
|
|
|
+const databaseIdOptionList = ref([]);
|
|
|
+const databaseIdQuery = async () => {
|
|
|
+ const { status, data }: any = await http.Request({ method: UrlList.prizeSet.prigetPriDatabaseSetDic.method, url: UrlList.prizeSet.prigetPriDatabaseSetDic.url, params: {} });
|
|
|
+ if (status === 1) {
|
|
|
+ databaseIdOptionList.value = data.records;
|
|
|
+ }
|
|
|
+};
|
|
|
|
|
|
|
|
|
// 表单校验规则
|
|
@@ -99,7 +109,7 @@ const rules = reactive({
|
|
|
const closeFn: any = inject('closeEditUpdatePriRecursionEndTableVisible');
|
|
|
const openVisible = async () => {
|
|
|
//通过ID获取表格数据
|
|
|
- const { status, data }: any = await http.Request({ method: UrlList.prizeSet.prigetPriRecursionEndTableQuery.method, url: UrlList.prizeSet.prigetPriRecursionEndTableQuery.url, params: { id: props.formData.id }});
|
|
|
+ const { status, data }: any = await http.Request({ method: UrlList.prizeSet.prigetPriRecursionEndTableQuery.method, url: UrlList.prizeSet.prigetPriRecursionEndTableQuery.url, params: { id: props.formData.id } });
|
|
|
if (status === 1) {
|
|
|
UpdateForm.value = data;
|
|
|
|
|
@@ -108,6 +118,7 @@ const openVisible = async () => {
|
|
|
// 关闭弹窗回调函数
|
|
|
const closeUpdatePriRecursionEndTableVisible = () => {
|
|
|
UpdateForm.value = {
|
|
|
+ databaseId: null, //查询数据库
|
|
|
tableEnName: "", //查询表
|
|
|
id: null, //ID
|
|
|
|
|
@@ -123,6 +134,13 @@ const isFullscreen = ref(false)
|
|
|
.main
|
|
|
el-dialog(v-model='props.editVisible' draggable width="50%" :fullscreen="isFullscreen" title="修改" @close="closeUpdatePriRecursionEndTableVisible" @open="openVisible")
|
|
|
el-form(:model='UpdateForm' label-position="right" ref="ruleFormRef" :rules="rules" label-width="100px")
|
|
|
+ el-form-item(label="数据库", prop="databaseId")
|
|
|
+ el-select(
|
|
|
+ v-model="UpdateForm.databaseId",
|
|
|
+ placeholder="请选择数据库",
|
|
|
+ clearable,
|
|
|
+ )
|
|
|
+ el-option(:label="item.title", :value="item.id" v-for="(item,index) in databaseIdOptionList")
|
|
|
el-form-item(label='查询表' prop="tableEnName")
|
|
|
el-input(v-model='UpdateForm.tableEnName' autocomplete='off'
|
|
|
placeholder="请输入查询表")
|