lcl 11 月之前
父节点
当前提交
187abc867f

+ 1 - 1
src/utils/http/index.ts

@@ -366,7 +366,7 @@ class PureHttp {
     const param = { data: {} };
     return this.request(
       "delete",
-      `${url}/${encryptByDES(params)}`,
+      `${url}/${encryptByDES(String(params))}`,
       param,
       config
     );

+ 20 - 19
src/views/Template/ApiGroup/components/add/index.vue

@@ -14,7 +14,6 @@ import Upload from "@iconify-icons/ri/upload-2-fill";
 import Close from "@iconify-icons/ri/close-fill";
 // 获取URLLIST
 import { getGroupUrl } from "@/utils/getUrl/getUrl";
-const UrlList = await getGroupUrl(['KxsConfigServer']);
 
 const props = defineProps<{
   submit: {
@@ -32,9 +31,9 @@ const props = defineProps<{
 }>();
 // 表单数据
 let UpdateForm = ref({
-  GroupName: "", //名称
-  GroupRemark: "", //说明
-  GroupVersion: "", //版本号
+  groupName: "", //名称
+  groupRemark: "", //说明
+  groupVersion: "", //版本号
 
 });
 
@@ -42,20 +41,22 @@ let UpdateForm = ref({
 const activeId = ref('1')
 // 提交函数
 const submit = async () => {
-  const { status, info }: any = http.Request({ method: UrlList.KxsConfigServer.ApiGroupAdd.method, url: UrlList.KxsConfigServer.ApiGroupAdd.url, params: UpdateForm.value});
-  if (status === "1") {
+  const UrlList = await getGroupUrl(['KxsConfigServer']);
+  const { status, msg }: any = await http.Request({ method: UrlList.KxsConfigServer.ApiGroupadd.method, url: UrlList.KxsConfigServer.ApiGroupadd.url, params: UpdateForm.value });
+  if (status === 1) {
     ElMessage({
       message: "新增成功",
       type: "success"
     });
     UpdateForm.value = {
-      GroupName: "", //名称
-      GroupRemark: "", //说明
-      GroupVersion: "", //版本号
+      groupName: "", //名称
+      groupRemark: "", //说明
+      groupVersion: "", //版本号
 
     };
+    closeVisible();
   } else {
-    ElMessageBox.alert(info, "提示", {
+    ElMessageBox.alert(msg, "提示", {
       confirmButtonText: "关闭",
       type: "warning"
     });
@@ -65,9 +66,9 @@ const closeFn: any = inject('closeAddVisible');
 // 关闭弹窗回调函数
 const closeVisible = () => {
   UpdateForm.value = {
-    GroupName: "", //名称
-    GroupRemark: "", //说明
-    GroupVersion: "", //版本号
+    groupName: "", //名称
+    groupRemark: "", //说明
+    groupVersion: "", //版本号
 
   };
   closeFn();
@@ -78,14 +79,14 @@ const closeVisible = () => {
 .main
   el-dialog(v-model='props.addVisible' width="50%" title="新增" @close="closeVisible()")
     el-form(:model='UpdateForm' label-position="right" label-width="100px")
-      el-form-item(label='名称' prop="GroupName")
-        el-input(v-model='UpdateForm.GroupName' autocomplete='off' class="!w-[230px]"
+      el-form-item(label='名称' prop="groupName")
+        el-input(v-model='UpdateForm.groupName' autocomplete='off' class="!w-[230px]"
           placeholder="请输入名称")
-      el-form-item(label='说明' prop="GroupRemark")
-        el-input(v-model='UpdateForm.GroupRemark' autocomplete='off' class="!w-[230px]"
+      el-form-item(label='说明' prop="groupRemark")
+        el-input(v-model='UpdateForm.groupRemark' autocomplete='off' class="!w-[230px]"
           placeholder="请输入说明")
-      el-form-item(label='版本号' prop="GroupVersion")
-        el-input(v-model='UpdateForm.GroupVersion' autocomplete='off' class="!w-[230px]"
+      el-form-item(label='版本号' prop="groupVersion")
+        el-input(v-model='UpdateForm.groupVersion' autocomplete='off' class="!w-[230px]"
           placeholder="请输入版本号")
 
     el-button(

+ 41 - 24
src/views/Template/ApiGroup/components/edit/index.vue

@@ -13,7 +13,6 @@ import Close from "@iconify-icons/ri/close-fill"
 import { http } from "@/utils/http";
 // 获取URLLIST
 import { getGroupUrl } from "@/utils/getUrl/getUrl";
-const UrlList = await getGroupUrl(['KxsConfigServer']);
 
 const props = defineProps<{
   editVisible: {
@@ -31,10 +30,10 @@ const props = defineProps<{
 }>();
 // 表单数据
 let UpdateForm: any = ref({
-  GroupName: "", //名称
-  GroupRemark: "", //说明
-  GroupVersion: "", //版本号
-  Id: "", //ID
+  groupName: "", //名称
+  groupRemark: "", //说明
+  groupVersion: "", //版本号
+  id: "", //ID
 
 });
 
@@ -42,33 +41,51 @@ let UpdateForm: any = ref({
 const activeId = ref('1')
 // 提交函数
 const submit = async () => {
-  const { status, info }: any = http.Request({ method: UrlList.KxsConfigServer.ApiGroupUpdate.method, url: UrlList.KxsConfigServer.ApiGroupUpdate.url, params: UpdateForm.value});
-  if (status === "1") {
+  const UrlList = await getGroupUrl(['KxsConfigServer']);
+  const { status, msg }: any = await http.Request({ method: UrlList.KxsConfigServer.ApiGroupupdate.method, url: UrlList.KxsConfigServer.ApiGroupupdate.url, params: UpdateForm.value });
+  if (status === 1) {
     ElMessage({
       message: "修改成功",
       type: "success"
     });
     UpdateForm.value = {
-      GroupName: "", //名称
-      GroupRemark: "", //说明
-      GroupVersion: "", //版本号
-      Id: "", //ID
+      groupName: "", //名称
+      groupRemark: "", //说明
+      groupVersion: "", //版本号
+      id: "", //ID
 
     };
+    closeVisible();
   } else {
-    ElMessageBox.alert(info, "提示", {
+    ElMessageBox.alert(msg, "提示", {
       confirmButtonText: "关闭",
       type: "warning"
     });
   };
 };
 // 关闭弹窗回调函数
-const closeVisible = inject('closeEditVisible');
+const closeFn: any = inject('closeEditVisible');
 const openVisible = async () => {
   //通过ID获取表格数据
-  const KxsConfigServer = await getGroupUrl(['KxsConfigServer']);
-  const { data }: any = http.Request({method: UrlList.KxsConfigServer.ApiGroupQuery.method, url: UrlList.KxsConfigServer.ApiGroupQuery.url, params: UpdateForm.value});
-  UpdateForm.value = data;
+  const UrlList = await getGroupUrl(['KxsConfigServer']);
+  const { status, data }: any = await http.Request({ method: UrlList.KxsConfigServer.ApiGroupquery.method, url: UrlList.KxsConfigServer.ApiGroupquery.url, params: props.formData });
+  ElMessageBox.alert(JSON.stringify(data), "提示", {
+    confirmButtonText: "关闭",
+    type: "warning"
+  });
+  if (status === 1) {
+    UpdateForm.value = data;
+  }
+};
+// 关闭弹窗回调函数
+const closeVisible = () => {
+  UpdateForm.value = {
+    groupName: "", //名称
+    groupRemark: "", //说明
+    groupVersion: "", //版本号
+
+  };
+  closeFn();
 };
 </script>
 
@@ -76,17 +93,17 @@ const openVisible = async () => {
 .main
   el-dialog(v-model='props.editVisible' width="50%" title="修改" @close="closeVisible()" @open="openVisible")
     el-form(:model='UpdateForm' label-position="right" label-width="100px")
-      el-form-item(label='名称' prop="GroupName")
-        el-input(v-model='UpdateForm.GroupName' autocomplete='off' class="!w-[230px]"
+      el-form-item(label='名称' prop="groupName")
+        el-input(v-model='UpdateForm.groupName' autocomplete='off' class="!w-[230px]"
           placeholder="请输入名称")
-      el-form-item(label='说明' prop="GroupRemark")
-        el-input(v-model='UpdateForm.GroupRemark' autocomplete='off' class="!w-[230px]"
+      el-form-item(label='说明' prop="groupRemark")
+        el-input(v-model='UpdateForm.groupRemark' autocomplete='off' class="!w-[230px]"
           placeholder="请输入说明")
-      el-form-item(label='版本号' prop="GroupVersion")
-        el-input(v-model='UpdateForm.GroupVersion' autocomplete='off' class="!w-[230px]"
+      el-form-item(label='版本号' prop="groupVersion")
+        el-input(v-model='UpdateForm.groupVersion' autocomplete='off' class="!w-[230px]"
           placeholder="请输入版本号")
-      el-form-item(label='ID' prop="Id")
-        el-input-number(v-model='UpdateForm.Id' :min="1" :max="1000"
+      el-form-item(label='ID' prop="id")
+        el-input-number(v-model='UpdateForm.id' :min="1" :max="1000"
           placeholder="请输入ID")
 
     el-button(

+ 10 - 9
src/views/Template/ApiGroup/hook.tsx

@@ -10,7 +10,7 @@ const UrlList = await getGroupUrl(['KxsConfigServer']);
 
 export function useApiGroup() {
   let form = reactive({
-    GroupName: "", //名称
+      groupName:"", //名称
 
   });
   const dataList = ref([]);
@@ -66,7 +66,8 @@ export function useApiGroup() {
   // 搜索列表
   async function onSearch(type = 'search') {
     if (type === 'all') {
-      form.GroupName = "";
+         form.groupName = "";
+
     }
     // if (type == 'search' && !Object.values(form).some(item => !!item)) {
     //   return ElMessage({
@@ -75,7 +76,7 @@ export function useApiGroup() {
     //   });
     // };
     loading.value = true;
-    const { status, msg, data }: any = await http.Request({ method: UrlList.KxsConfigServer.ApiGrouplist.method, url: UrlList.KxsConfigServer.ApiGrouplist.url, params: { ...form, PageSize: pagination.pageSize, PageNum: pagination.currentPage } });
+    const { status, msg, data }: any = await http.Request({ method: UrlList.KxsConfigServer.ApiGrouplist.method, url: UrlList.KxsConfigServer.ApiGrouplist.url, params: { ...form, PageSize: pagination.pageSize, PageNum: pagination.currentPage }});
     if (status === 1) {
       dataList.value = data.result;
       pagination.total = data.totalNum;
@@ -104,18 +105,18 @@ export function useApiGroup() {
         type: "warning"
       }
     ).then(async () => {
-      const { status, info }: any = await http.Request({ method: UrlList.KxsConfigServer.ApiGroupdelete.method, url: UrlList.KxsConfigServer.ApiGroupdelete.url, params: { Id: row.Id } });
-      if (status === "1") {
+      const { status, msg }: any = await http.Request({ method: UrlList.KxsConfigServer.ApiGroupdelete.method, url: UrlList.KxsConfigServer.ApiGroupdelete.url, params: row.id });
+      if (status === 1) {
         ElMessage({
           message: "删除成功",
           type: "success"
         });
         onSearch();
       } else {
-        ElMessageBox.alert(info, "提示", {
-          confirmButtonText: "关闭",
-          type: "warning"
-        });
+        ElMessageBox.alert(msg, "提示", {
+        confirmButtonText: "关闭",
+        type: "warning"
+      });
       };
     })
   }

+ 2 - 4
src/views/Template/ApiGroup/index.vue

@@ -63,8 +63,8 @@ provide('closeEditVisible', closeEditVisible)
       :rules="rules",
       class="w-[99/100]"
     )
-      el-form-item(label='名称' prop="GroupName")
-        el-input(v-model='form.GroupName' autocomplete='off' class="!w-[230px]"
+      el-form-item(label='名称' prop="groupName")
+        el-input(v-model='form.groupName' autocomplete='off' class="!w-[230px]"
           placeholder="请输入名称")
 
       el-form-item
@@ -118,7 +118,6 @@ provide('closeEditVisible', closeEditVisible)
                         :size="size"
                         @click="handleUpdate(row)"
                         :icon="useRenderIcon(EditPen)"
-                        v-if="hasAuth(['edit'])"
                       ) 编辑
                     el-button.reset-margin(
                       link
@@ -126,7 +125,6 @@ provide('closeEditVisible', closeEditVisible)
                       :size="size"
                       @click="handleDelete(row)"
                       :icon="useRenderIcon(Delete)"
-                      v-if="hasAuth(['delete'])"
                     ) 删除
 
     Add(:addVisible="addVisible")