Merge branch 'master' of http://gitea.zianxin.com/zianxin-tec/biz-pc-cloud
This commit is contained in:
commit
c2c76ec667
16 files changed
+160
-234
No files matched your search
@@ -4,12 +4,7 @@
|
||||
<el-row shadow="hover" v-show="showSearch" class="ml10">
|
||||
<el-form :inline="true" :model="state.queryForm" @keyup.enter="getDataList" ref="queryRef">
|
||||
<el-form-item :label="$t('sysmenu.name')" prop="menuName">
|
||||
<el-input
|
||||
:placeholder="$t('sysmenu.inputNameTip')"
|
||||
clearable
|
||||
style="max-width: 180px"
|
||||
v-model="state.queryForm.menuName"
|
||||
/>
|
||||
<el-input :placeholder="$t('sysmenu.inputNameTip')" clearable style="max-width: 180px" v-model="state.queryForm.menuName" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="query" class="ml10" icon="search" type="primary">
|
||||
@@ -34,24 +29,15 @@
|
||||
</el-row>
|
||||
<el-table
|
||||
ref="tableRef"
|
||||
:data="tableList"
|
||||
lazy
|
||||
:load="load"
|
||||
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
||||
row-key="path"
|
||||
:data="state.dataList"
|
||||
row-key="id"
|
||||
style="width: 100%"
|
||||
v-loading="state.loading"
|
||||
border
|
||||
:header-cell-style="tableStyle?.headerCellStyle"
|
||||
:expand-row-keys="expandRowKeys"
|
||||
>
|
||||
<el-table-column
|
||||
:label="$t('sysmenu.name')"
|
||||
fixed
|
||||
prop="name"
|
||||
align="left"
|
||||
show-overflow-tooltip
|
||||
min-width="200"
|
||||
/>
|
||||
<el-table-column :label="$t('sysmenu.name')" fixed prop="name" align="left" show-overflow-tooltip min-width="200" />
|
||||
<el-table-column :label="$t('sysmenu.sortOrder')" prop="sortOrder" align="center" show-overflow-tooltip />
|
||||
<el-table-column :label="$t('sysmenu.icon')" prop="icon" show-overflow-tooltip align="center">
|
||||
<template #default="scope">
|
||||
@@ -72,38 +58,17 @@
|
||||
<el-tag type="info" v-else>关闭</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:label="$t('sysmenu.permission')"
|
||||
:show-overflow-tooltip="true"
|
||||
prop="permission"
|
||||
align="center"
|
||||
/>
|
||||
<el-table-column :label="$t('sysmenu.permission')" :show-overflow-tooltip="true" prop="permission" align="center" />
|
||||
<el-table-column :label="$t('common.action')" show-overflow-tooltip width="250" align="center">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
icon="folder-add"
|
||||
@click="onOpenAddMenu('add', scope.row)"
|
||||
text
|
||||
type="primary"
|
||||
v-auth="'sys_menu_add'"
|
||||
>
|
||||
<el-button icon="folder-add" @click="onOpenAddMenu('add', scope.row)" text type="primary" v-auth="'sys_menu_add'">
|
||||
{{ $t("common.addBtn") }}
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="edit-pen"
|
||||
@click="onOpenEditMenu('edit', scope.row)"
|
||||
text
|
||||
type="primary"
|
||||
v-auth="'sys_menu_edit'"
|
||||
<el-button icon="edit-pen" @click="onOpenEditMenu('edit', scope.row)" text type="primary" v-auth="'sys_menu_edit'"
|
||||
>{{ $t("common.editBtn") }}
|
||||
</el-button>
|
||||
|
||||
<el-tooltip
|
||||
icon="delete"
|
||||
:content="$t('sysmenu.deleteDisabledTip')"
|
||||
:disabled="!deleteMenuDisabled(scope.row)"
|
||||
placement="top"
|
||||
>
|
||||
<el-tooltip icon="delete" :content="$t('sysmenu.deleteDisabledTip')" :disabled="!deleteMenuDisabled(scope.row)" placement="top">
|
||||
<span style="margin-left: 12px">
|
||||
<el-button
|
||||
icon="delete"
|
||||
@@ -140,9 +105,9 @@ const showSearch = ref(true)
|
||||
const queryRef = ref()
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
createdIsNeed: false,
|
||||
pageList: pageList, // H
|
||||
pageList: pageList,
|
||||
queryForm: {
|
||||
parentId: -1,
|
||||
// parentId: -1,
|
||||
menuName: "",
|
||||
},
|
||||
isPage: false,
|
||||
@@ -154,21 +119,32 @@ onMounted(async () => {
|
||||
getDataList()
|
||||
})
|
||||
|
||||
// 根据类型判断是否有子节点
|
||||
const setHasChildren = (arr: any[]) => {
|
||||
arr.forEach((item) => {
|
||||
// 添加 hasChildren 属性
|
||||
item.hasChildren = item.menuType !== "1"
|
||||
})
|
||||
}
|
||||
const tableList = computed(() => {
|
||||
const expandRowKeys = computed(() => {
|
||||
const list = state.dataList
|
||||
if (Array.isArray(list)) {
|
||||
setHasChildren(list)
|
||||
}
|
||||
return list
|
||||
const arr: any[] = []
|
||||
list?.forEach((item) => {
|
||||
if (item.children && item.children.length) {
|
||||
arr.push(item.id)
|
||||
}
|
||||
})
|
||||
return arr
|
||||
})
|
||||
|
||||
// 根据类型判断是否有子节点
|
||||
// const setHasChildren = (arr: any[]) => {
|
||||
// arr.forEach((item) => {
|
||||
// // 添加 hasChildren 属性
|
||||
// item.hasChildren = item.menuType !== "1"
|
||||
// })
|
||||
// }
|
||||
// const tableList = computed(() => {
|
||||
// const list = state.dataList
|
||||
// // if (Array.isArray(list)) {
|
||||
// // setHasChildren(list)
|
||||
// // }
|
||||
// return list
|
||||
// })
|
||||
|
||||
// 打开新增菜单弹窗
|
||||
const onOpenAddMenu = (type?: string, row?: any) => {
|
||||
menuDialogRef.value.openDialog(type, row)
|
||||
@@ -197,20 +173,20 @@ const resetQuery = () => {
|
||||
getDataList()
|
||||
}
|
||||
|
||||
const load = (row: any, treeNode: unknown, resolve: (date: any[]) => void) => {
|
||||
const param = {
|
||||
parentId: row.id,
|
||||
}
|
||||
pageList(param).then((res) => {
|
||||
const childrenList = res.data
|
||||
if (Array.isArray(childrenList)) {
|
||||
setHasChildren(childrenList)
|
||||
}
|
||||
if (childrenList && childrenList.length) {
|
||||
resolve(childrenList)
|
||||
}
|
||||
})
|
||||
}
|
||||
// const load = (row: any, treeNode: unknown, resolve: (date: any[]) => void) => {
|
||||
// const param = {
|
||||
// parentId: row.id,
|
||||
// }
|
||||
// pageList(param).then((res) => {
|
||||
// const childrenList = res.data
|
||||
// if (Array.isArray(childrenList)) {
|
||||
// setHasChildren(childrenList)
|
||||
// }
|
||||
// if (childrenList && childrenList.length) {
|
||||
// resolve(childrenList)
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = async (row: any) => {
|
||||
@@ -229,11 +205,3 @@ const handleDelete = async (row: any) => {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
:deep() {
|
||||
.el-table .row-expand-cover .cell .el-table__expand-icon {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,80 @@
|
||||
<template>
|
||||
<el-drawer v-model="visible" :title="data.title" size="30%">
|
||||
<div class="w-full">
|
||||
<div
|
||||
class="coding inverse-toggle px-5 pt-4 shadow-lg text-gray-100 text-sm font-mono subpixel-antialiased bg-gray-800 pb-6 pt-4 rounded-lg leading-normal overflow-hidden"
|
||||
>
|
||||
<div class="top mb-2 flex">
|
||||
<div class="h-3 w-3 bg-red-500 rounded-full"></div>
|
||||
<div class="ml-2 h-3 w-3 bg-orange-300 rounded-full"></div>
|
||||
<div class="ml-2 h-3 w-3 bg-green-500 rounded-full"></div>
|
||||
</div>
|
||||
<div class="mt-4 flex">
|
||||
<span class="text-green-400">创建时间: </span>
|
||||
<p class="flex-1 typing items-center pl-2 whitespace-normal overflow-hidden break-all">
|
||||
{{ data.createTime }}
|
||||
<br />
|
||||
</p>
|
||||
</div>
|
||||
<div class="mt-4 flex">
|
||||
<span class="text-green-400">操作人: </span>
|
||||
<p class="flex-1 typing items-center pl-2 whitespace-normal overflow-hidden break-all">
|
||||
{{ data.createBy }}
|
||||
<br />
|
||||
</p>
|
||||
</div>
|
||||
<div class="mt-4 flex">
|
||||
<span class="text-green-400">api名称: </span>
|
||||
<p class="flex-1 typing items-center pl-2 whitespace-normal overflow-hidden break-all">
|
||||
{{ data.error[0] }}
|
||||
<br />
|
||||
</p>
|
||||
</div>
|
||||
<div class="mt-4 flex">
|
||||
<span class="text-green-400">api: </span>
|
||||
<p class="flex-1 typing items-center pl-2 whitespace-normal overflow-hidden break-all">
|
||||
{{ data.error[1] }}
|
||||
<br />
|
||||
</p>
|
||||
</div>
|
||||
<div class="mt-4 flex">
|
||||
<span class="text-green-400">错误: </span>
|
||||
<p class="flex-1 typing items-center pl-2 whitespace-normal overflow-hidden break-all">
|
||||
{{ data.error[2] + "," + data.error[3] }}
|
||||
<br />
|
||||
</p>
|
||||
</div>
|
||||
<div class="mt-4 flex">
|
||||
<span class="text-green-400">请求地址: </span>
|
||||
<p class="flex-1 typing items-center pl-2 whitespace-normal overflow-hidden break-all">
|
||||
{{ data.error[6] }}
|
||||
<br />
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="log-detail">
|
||||
const visible = ref(false)
|
||||
|
||||
const data = reactive({} as any)
|
||||
|
||||
const openDialog = (row: any) => {
|
||||
visible.value = true
|
||||
|
||||
Object.assign(data, {
|
||||
...row,
|
||||
error: row.error
|
||||
.split("stack")[0]
|
||||
.split("|")
|
||||
.filter((item: any) => item),
|
||||
})
|
||||
}
|
||||
|
||||
// 暴露变量
|
||||
defineExpose({
|
||||
openDialog,
|
||||
})
|
||||
</script>
|
||||
@@ -1,137 +0,0 @@
|
||||
<template>
|
||||
<el-dialog :title="form.id ? '编辑' : '新增'" v-model="visible" :close-on-click-modal="false" draggable>
|
||||
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" v-loading="loading">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="同步类型" prop="bizType">
|
||||
<el-input v-model="form.bizType" placeholder="请输入同步类型" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="原始res" prop="orgRes">
|
||||
<el-input v-model="form.orgRes" placeholder="请输入原始res" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="加密res" prop="encipherRes">
|
||||
<el-input v-model="form.encipherRes" placeholder="请输入加密res" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="原始req" prop="orgReq">
|
||||
<el-input v-model="form.orgReq" placeholder="请输入原始req" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="加密req" prop="encipherReq">
|
||||
<el-input v-model="form.encipherReq" placeholder="请输入加密req" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="同步版本格式化为14位字符串,如果是数字不足14位的,前面补0" prop="version">
|
||||
<el-input v-model="form.version" placeholder="请输入同步版本格式化为14位字符串,如果是数字不足14位的,前面补0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="同步版本格式化为14位字符串,如果是数字不足14位的,前面补0" prop="timeConsuming">
|
||||
<el-input v-model="form.timeConsuming" placeholder="请输入同步版本格式化为14位字符串,如果是数字不足14位的,前面补0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="onSubmit" :disabled="loading">确认</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="ThirdZyLogDialog">
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
import { useMessage } from "/@/hooks/message"
|
||||
import { getObj, addObj, putObj } from "/@/api/wallet/third-zy-log"
|
||||
import { rule } from "/@/utils/validate"
|
||||
const emit = defineEmits(["refresh"])
|
||||
|
||||
// 定义变量内容
|
||||
const dataFormRef = ref()
|
||||
const visible = ref(false)
|
||||
const loading = ref(false)
|
||||
// 定义字典
|
||||
|
||||
// 提交表单数据
|
||||
const form = reactive({
|
||||
id: "",
|
||||
bizType: "",
|
||||
orgRes: "",
|
||||
encipherRes: "",
|
||||
orgReq: "",
|
||||
encipherReq: "",
|
||||
version: "",
|
||||
timeConsuming: "",
|
||||
})
|
||||
|
||||
// 定义校验规则
|
||||
const dataRules = ref({})
|
||||
|
||||
// 打开弹窗
|
||||
const openDialog = (id: string) => {
|
||||
visible.value = true
|
||||
form.id = ""
|
||||
|
||||
// 重置表单数据
|
||||
nextTick(() => {
|
||||
dataFormRef.value?.resetFields()
|
||||
})
|
||||
|
||||
// 获取thirdZyLog信息
|
||||
if (id) {
|
||||
form.id = id
|
||||
getthirdZyLogData(id)
|
||||
}
|
||||
}
|
||||
|
||||
// 提交
|
||||
const onSubmit = async () => {
|
||||
const valid = await dataFormRef.value.validate().catch(() => {})
|
||||
if (!valid) return false
|
||||
|
||||
try {
|
||||
loading.value = true
|
||||
form.id ? await putObj(form) : await addObj(form)
|
||||
useMessage().success(form.id ? "修改成功" : "添加成功")
|
||||
visible.value = false
|
||||
emit("refresh")
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg)
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化表单数据
|
||||
const getthirdZyLogData = (id: string) => {
|
||||
// 获取数据
|
||||
loading.value = true
|
||||
getObj(id)
|
||||
.then((res: any) => {
|
||||
Object.assign(form, res.data)
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
// 暴露变量
|
||||
defineExpose({
|
||||
openDialog,
|
||||
})
|
||||
</script>
|
||||
@@ -8,6 +8,7 @@
|
||||
<el-button type="primary" :disabled="syncLoading" @click="accountInfoSync">账户信息同步</el-button>
|
||||
<el-button type="primary" :disabled="syncLoading" @click="identityInfoSync">身份信息同步</el-button>
|
||||
<el-button type="primary" :disabled="syncLoading" @click="transactionDataSync">交易数据同步</el-button>
|
||||
<right-toolbar :search="false" :export="false" class="ml10 mr20" style="float: right" @queryTable="getDataList" />
|
||||
</div>
|
||||
</el-row>
|
||||
|
||||
@@ -21,52 +22,66 @@
|
||||
max-height="calc(100vh - 200px)"
|
||||
>
|
||||
<el-table-column type="index" label="#" width="50" />
|
||||
<el-table-column prop="apiUrl" label="apiUrl" show-overflow-tooltip />
|
||||
<el-table-column prop="bizType" label="同步类型" show-overflow-tooltip>
|
||||
<el-table-column prop="apiUrl" label="apiUrl" show-overflow-tooltip min-width="160" />
|
||||
<el-table-column prop="bizType" label="同步类型" min-width="160">
|
||||
<template #default="{ row }">
|
||||
<dict-tag :type="row.bizType" :dict="third_zy_log_biz_type" />
|
||||
<dict-tag :value="row.bizType" :options="thrid_zy_biz_type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="orgRes" label="原始res" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<el-button text type="primary" @click="handleClickJsonView(row.orgRes)">查看</el-button>
|
||||
<el-button text :type="row.orgRes ? 'primary' : 'danger'" @click="row.orgRes && handleClickJsonView(row.orgRes)">
|
||||
查看
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="encipherRes" label="加密res" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<el-button text type="primary" @click="handleClickJsonView(row.encipherRes)">查看</el-button>
|
||||
<el-button text :type="row.encipherRes ? 'primary' : 'danger'" @click="row.encipherRes && handleClickJsonView(row.encipherRes)">
|
||||
查看
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="orgReq" label="原始req" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<el-button text type="primary" @click="handleClickJsonView(row.orgReq)">查看</el-button>
|
||||
<el-button text :type="row.encipherRes ? 'primary' : 'danger'" @click="row.encipherRes && handleClickJsonView(row.orgReq)">
|
||||
查看
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="encipherReq" label="加密req" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<el-button text type="primary" @click="handleClickJsonView(row.encipherReq)">查看</el-button>
|
||||
<el-button text :type="row.encipherReq ? 'primary' : 'danger'" @click="row.encipherReq && handleClickJsonView(row.encipherReq)">
|
||||
查看
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="error" label="调用错误" show-overflow-tooltip />
|
||||
<el-table-column prop="version" label="同步版本" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="120">
|
||||
<el-table-column prop="error" label="调用错误" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<el-button text type="primary" v-auth="'third_thirdZyLog_edit'" @click="formDialogRef.openDialog(row.id)">编辑</el-button>
|
||||
<el-button
|
||||
icon="view"
|
||||
@click="row.error && LogDetailRef.openDialog(row)"
|
||||
size="small"
|
||||
text
|
||||
:type="row.error ? 'primary' : 'danger'"
|
||||
>
|
||||
详情
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="version" label="同步版本" show-overflow-tooltip />
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||
</div>
|
||||
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||
|
||||
<el-dialog title="" v-model="jsonViewVisible">
|
||||
<vue-json-pretty :data="jsonData" showLength showLineNumber showIcon :collapsedOnClickBrackets="false" />
|
||||
<template #footer>
|
||||
<el-button @click="jsonViewVisible = false">关闭</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<log-detail ref="LogDetailRef" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -79,10 +94,10 @@ import "vue-json-pretty/lib/styles.css"
|
||||
import { syncAllDept, syncAllMch, syncAllRole, syncAllUser } from "/@/api/wallet/mch-thrid-zy"
|
||||
import { useMessage } from "/@/hooks/message"
|
||||
|
||||
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
|
||||
const LogDetail = defineAsyncComponent(() => import("./detail.vue"))
|
||||
|
||||
const formDialogRef = ref()
|
||||
const { third_zy_log_biz_type } = useDict("third_zy_log_biz_type")
|
||||
const LogDetailRef = ref()
|
||||
const { thrid_zy_biz_type } = useDict("thrid_zy_biz_type")
|
||||
const jsonViewVisible = ref<boolean>()
|
||||
const jsonData = ref()
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
|
||||
Reference in new issue
Block a user