Merge remote-tracking branch 'yudao/dev' into dev-to-dev

This commit is contained in:
puhui999 2023-08-06 20:23:19 +08:00
commit 79413e0ae2
45 changed files with 1257 additions and 385 deletions

View File

@ -28,4 +28,4 @@ VITE_DROP_CONSOLE=false
VITE_SOURCEMAP=false VITE_SOURCEMAP=false
# 输出路径 # 输出路径
VITE_OUT_DIR=dist-dev VITE_OUT_DIR=dist

View File

@ -1,31 +0,0 @@
# 测试环境
NODE_ENV=production
VITE_DEV=false
# 请求路径
VITE_BASE_URL='http://localhost:48080'
# 上传路径
VITE_UPLOAD_URL='http://localhost:48080/admin-api/infra/file/upload'
# 接口前缀
VITE_API_BASEPATH=
# 接口地址
VITE_API_URL=/admin-api
# 是否删除debugger
VITE_DROP_DEBUGGER=false
# 是否删除console.log
VITE_DROP_CONSOLE=false
# 是否sourcemap
VITE_SOURCEMAP=true
# 打包路径
VITE_BASE_PATH=/
# 输出路径
VITE_OUT_DIR=dist-test

View File

@ -1,4 +1,6 @@
module.exports = { // @ts-check
const { defineConfig } = require('eslint-define-config')
module.exports = defineConfig({
root: true, root: true,
env: { env: {
browser: true, browser: true,
@ -16,9 +18,16 @@ module.exports = {
jsx: true jsx: true
} }
}, },
extends: ['plugin:vue/vue3-recommended', 'prettier', 'plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'], extends: [
'plugin:vue/vue3-recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
'plugin:prettier/recommended'
],
rules: { rules: {
'vue/script-setup-uses-vars': 'error', 'vue/script-setup-uses-vars': 'error',
'vue/no-reserved-component-names': 'off',
'vue/no-setup-props-destructure': 'off',
'@typescript-eslint/ban-ts-ignore': 'off', '@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/explicit-function-return-type': 'off', '@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off', '@typescript-eslint/no-explicit-any': 'off',
@ -31,20 +40,8 @@ module.exports = {
'@typescript-eslint/ban-types': 'off', '@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-non-null-assertion': 'off', '@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off', '@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unused-vars': [ '@typescript-eslint/no-unused-vars': 'off',
'error', 'no-unused-vars': 'off',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_'
}
],
'no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_'
}
],
'space-before-function-paren': 'off', 'space-before-function-paren': 'off',
'vue/attributes-order': 'off', 'vue/attributes-order': 'off',
@ -68,6 +65,7 @@ module.exports = {
math: 'always' math: 'always'
} }
], ],
'vue/multi-word-component-names': 'off' 'vue/multi-word-component-names': 'off',
'vue/no-v-html': 'off'
} }
} })

View File

@ -39,14 +39,14 @@
| 框架 | 说明 | 版本 | | 框架 | 说明 | 版本 |
|----------------------------------------------------------------------|------------------|--------| |----------------------------------------------------------------------|------------------|--------|
| [Vue](https://staging-cn.vuejs.org/) | Vue 框架 | 3.3.4 | | [Vue](https://staging-cn.vuejs.org/) | Vue 框架 | 3.3.4 |
| [Vite](https://cn.vitejs.dev//) | 开发与构建工具 | 4.4.7 | | [Vite](https://cn.vitejs.dev//) | 开发与构建工具 | 4.4.8 |
| [Element Plus](https://element-plus.org/zh-CN/) | Element Plus | 2.3.8 | | [Element Plus](https://element-plus.org/zh-CN/) | Element Plus | 2.3.9 |
| [TypeScript](https://www.typescriptlang.org/docs/) | JavaScript 的超集 | 5.1.6 | | [TypeScript](https://www.typescriptlang.org/docs/) | JavaScript 的超集 | 5.1.6 |
| [pinia](https://pinia.vuejs.org/) | Vue 存储库 替代 vuex5 | 2.1.6 | | [pinia](https://pinia.vuejs.org/) | Vue 存储库 替代 vuex5 | 2.1.6 |
| [vueuse](https://vueuse.org/) | 常用工具集 | 10.2.1 | | [vueuse](https://vueuse.org/) | 常用工具集 | 10.3.0 |
| [vue-i18n](https://kazupon.github.io/vue-i18n/zh/introduction.html/) | 国际化 | 9.2.2 | | [vue-i18n](https://kazupon.github.io/vue-i18n/zh/introduction.html/) | 国际化 | 9.2.2 |
| [vue-router](https://router.vuejs.org/) | Vue 路由 | 4.2.4 | | [vue-router](https://router.vuejs.org/) | Vue 路由 | 4.2.4 |
| [unocss](https://uno.antfu.me/) | 原子 css | 0.54.0 | | [unocss](https://uno.antfu.me/) | 原子 css | 0.54.1 |
| [iconify](https://icon-sets.iconify.design/) | 在线图标库 | 3.1.1 | | [iconify](https://icon-sets.iconify.design/) | 在线图标库 | 3.1.1 |
| [wangeditor](https://www.wangeditor.com/) | 富文本编辑器 | 5.1.23 | | [wangeditor](https://www.wangeditor.com/) | 富文本编辑器 | 5.1.23 |

View File

@ -11,22 +11,19 @@
"ts:check": "vue-tsc --noEmit", "ts:check": "vue-tsc --noEmit",
"build:pro": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode pro", "build:pro": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode pro",
"build:dev": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode dev", "build:dev": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode dev",
"build:base": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode base",
"build:stage": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode stage", "build:stage": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode stage",
"build:test": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode test",
"build:static": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode static", "build:static": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode static",
"build:front": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode front", "build:front": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode front",
"serve:pro": "vite preview --mode pro", "serve:pro": "vite preview --mode pro",
"serve:dev": "vite preview --mode dev", "serve:dev": "vite preview --mode dev",
"serve:test": "vite preview --mode test", "preview": "pnpm build:base && vite preview",
"preview": "pnpm build && vite preview",
"npm:check": "npx npm-check-updates",
"clean": "npx rimraf node_modules", "clean": "npx rimraf node_modules",
"clean:cache": "npx rimraf node_modules/.cache", "clean:cache": "npx rimraf node_modules/.cache",
"lint:eslint": "eslint --fix --ext .js,.ts,.vue ./src", "lint:eslint": "eslint --fix --ext .js,.ts,.vue ./src",
"lint:format": "prettier --write --loglevel warn \"src/**/*.{js,ts,json,tsx,css,less,scss,vue,html,md}\"", "lint:format": "prettier --write --loglevel warn \"src/**/*.{js,ts,json,tsx,css,less,scss,vue,html,md}\"",
"lint:style": "stylelint --fix \"**/*.{vue,less,postcss,css,scss}\" --cache --cache-location node_modules/.cache/stylelint/", "lint:style": "stylelint --fix \"**/*.{vue,less,postcss,css,scss}\" --cache --cache-location node_modules/.cache/stylelint/",
"lint:lint-staged": "lint-staged -c ", "lint:lint-staged": "lint-staged -c "
"lint:pretty": "pretty-quick --staged"
}, },
"dependencies": { "dependencies": {
"@element-plus/icons-vue": "^2.1.0", "@element-plus/icons-vue": "^2.1.0",
@ -34,7 +31,7 @@
"@form-create/element-ui": "^3.1.17", "@form-create/element-ui": "^3.1.17",
"@iconify/iconify": "^3.1.1", "@iconify/iconify": "^3.1.1",
"@videojs-player/vue": "^1.0.0", "@videojs-player/vue": "^1.0.0",
"@vueuse/core": "^10.2.1", "@vueuse/core": "^10.3.0",
"@wangeditor/editor": "^5.1.23", "@wangeditor/editor": "^5.1.23",
"@wangeditor/editor-for-vue": "^5.1.10", "@wangeditor/editor-for-vue": "^5.1.10",
"@zxcvbn-ts/core": "^3.0.3", "@zxcvbn-ts/core": "^3.0.3",
@ -49,8 +46,8 @@
"diagram-js": "^11.6.0", "diagram-js": "^11.6.0",
"echarts": "^5.4.3", "echarts": "^5.4.3",
"echarts-wordcloud": "^2.1.0", "echarts-wordcloud": "^2.1.0",
"element-plus": "2.3.8", "element-plus": "2.3.9",
"fast-xml-parser": "^4.2.6", "fast-xml-parser": "^4.2.7",
"highlight.js": "^11.8.0", "highlight.js": "^11.8.0",
"intro.js": "^7.0.1", "intro.js": "^7.0.1",
"jsencrypt": "^3.3.2", "jsencrypt": "^3.3.2",
@ -76,7 +73,7 @@
"devDependencies": { "devDependencies": {
"@commitlint/cli": "^17.6.7", "@commitlint/cli": "^17.6.7",
"@commitlint/config-conventional": "^17.6.7", "@commitlint/config-conventional": "^17.6.7",
"@iconify/json": "^2.2.95", "@iconify/json": "^2.2.98",
"@intlify/unplugin-vue-i18n": "^0.12.2", "@intlify/unplugin-vue-i18n": "^0.12.2",
"@purge-icons/generated": "^0.9.0", "@purge-icons/generated": "^0.9.0",
"@types/intro.js": "^5.1.1", "@types/intro.js": "^5.1.1",
@ -85,42 +82,42 @@
"@types/nprogress": "^0.2.0", "@types/nprogress": "^0.2.0",
"@types/qrcode": "^1.5.1", "@types/qrcode": "^1.5.1",
"@types/qs": "^6.9.7", "@types/qs": "^6.9.7",
"@typescript-eslint/eslint-plugin": "^6.2.0", "@typescript-eslint/eslint-plugin": "^6.2.1",
"@typescript-eslint/parser": "^6.2.0", "@typescript-eslint/parser": "^6.2.1",
"@unocss/transformer-variant-group": "^0.51.4", "@unocss/transformer-variant-group": "^0.54.1",
"@vitejs/plugin-legacy": "^4.1.1", "@vitejs/plugin-legacy": "^4.1.1",
"@vitejs/plugin-vue": "^4.2.3", "@vitejs/plugin-vue": "^4.2.3",
"@vitejs/plugin-vue-jsx": "^3.0.1", "@vitejs/plugin-vue-jsx": "^3.0.1",
"@vue-macros/volar": "^0.12.3", "@vue-macros/volar": "^0.13.2",
"autoprefixer": "^10.4.14", "autoprefixer": "^10.4.14",
"bpmn-js": "^8.9.0", "bpmn-js": "^8.9.0",
"bpmn-js-properties-panel": "^0.46.0", "bpmn-js-properties-panel": "^0.46.0",
"consola": "^3.2.3", "consola": "^3.2.3",
"eslint": "^8.46.0", "eslint": "^8.46.0",
"eslint-config-prettier": "^8.9.0", "eslint-config-prettier": "^8.10.0",
"eslint-define-config": "^1.21.0", "eslint-define-config": "^1.22.0",
"eslint-plugin-prettier": "^5.0.0", "eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-vue": "^9.15.1", "eslint-plugin-vue": "^9.16.1",
"lint-staged": "^13.2.3", "lint-staged": "^13.2.3",
"postcss": "^8.4.27", "postcss": "^8.4.27",
"postcss-html": "^1.5.0", "postcss-html": "^1.5.0",
"postcss-scss": "^4.0.6", "postcss-scss": "^4.0.6",
"prettier": "^3.0.0", "prettier": "^3.0.1",
"rimraf": "^5.0.1", "rimraf": "^5.0.1",
"rollup": "^3.27.0", "rollup": "^3.27.2",
"sass": "^1.64.1", "sass": "^1.64.2",
"stylelint": "^15.10.2", "stylelint": "^15.10.2",
"stylelint-config-html": "^1.1.0",
"stylelint-config-recommended": "^13.0.0", "stylelint-config-recommended": "^13.0.0",
"stylelint-config-recommended-vue": "^1.5.0",
"stylelint-config-standard": "^34.0.0", "stylelint-config-standard": "^34.0.0",
"stylelint-order": "^6.0.3", "stylelint-order": "^6.0.3",
"terser": "^5.19.2", "terser": "^5.19.2",
"typescript": "5.1.6", "typescript": "5.1.6",
"unocss": "^0.54.0", "unocss": "^0.54.1",
"unplugin-auto-import": "^0.16.6", "unplugin-auto-import": "^0.16.6",
"unplugin-element-plus": "^0.7.2", "unplugin-element-plus": "^0.8.0",
"unplugin-vue-components": "^0.25.1", "unplugin-vue-components": "^0.25.1",
"vite": "4.4.7", "vite": "4.4.8",
"vite-plugin-compression": "^0.5.1", "vite-plugin-compression": "^0.5.1",
"vite-plugin-ejs": "^1.6.4", "vite-plugin-ejs": "^1.6.4",
"vite-plugin-eslint": "^1.8.1", "vite-plugin-eslint": "^1.8.1",

View File

@ -7,7 +7,6 @@ export interface ChannelVO {
status: number status: number
remark: string remark: string
feeRate: number feeRate: number
merchantId: number
appId: number appId: number
createTime: Date createTime: Date
} }
@ -18,13 +17,12 @@ export const getChannelPage = (params: PageParam) => {
} }
// 查询详情支付渠道 // 查询详情支付渠道
export const getChannel = (merchantId: number, appId: string, code: string) => { export const getChannel = (appId: string, code: string) => {
const params = { const params = {
merchantId: merchantId,
appId: appId, appId: appId,
code: code code: code
} }
return request.get({ url: '/pay/channel/get-channel', params: params }) return request.get({ url: '/pay/channel/get', params: params })
} }
// 新增支付渠道 // 新增支付渠道

View File

@ -1,8 +1,6 @@
<script lang="ts" setup> <script lang="ts" setup>
import { propTypes } from '@/utils/propTypes' import { propTypes } from '@/utils/propTypes'
import { isNumber } from '@/utils/is' import { isNumber } from '@/utils/is'
// eslint-disable-next-line vue/no-reserved-component-names
defineOptions({ name: 'Dialog' }) defineOptions({ name: 'Dialog' })
const slots = useSlots() const slots = useSlots()
@ -13,7 +11,7 @@ const props = defineProps({
fullscreen: propTypes.bool.def(true), fullscreen: propTypes.bool.def(true),
width: propTypes.oneOfType([String, Number]).def('40%'), width: propTypes.oneOfType([String, Number]).def('40%'),
scroll: propTypes.bool.def(false), // maxHeight scroll: propTypes.bool.def(false), // maxHeight
maxHeight: propTypes.oneOfType([String, Number]).def('300px') maxHeight: propTypes.oneOfType([String, Number]).def('400px')
}) })
const getBindValue = computed(() => { const getBindValue = computed(() => {
@ -39,7 +37,6 @@ const dialogHeight = ref(isNumber(props.maxHeight) ? `${props.maxHeight}px` : pr
watch( watch(
() => isFullscreen.value, () => isFullscreen.value,
async (val: boolean) => { async (val: boolean) => {
//
await nextTick() await nextTick()
if (val) { if (val) {
const windowHeight = document.documentElement.offsetHeight const windowHeight = document.documentElement.offsetHeight
@ -62,36 +59,47 @@ const dialogStyle = computed(() => {
<template> <template>
<ElDialog <ElDialog
v-bind="getBindValue"
:close-on-click-modal="true" :close-on-click-modal="true"
:fullscreen="isFullscreen" :fullscreen="isFullscreen"
:width="width" :width="width"
destroy-on-close destroy-on-close
draggable
lock-scroll lock-scroll
v-bind="getBindValue" draggable
top="0"
:show-close="false"
> >
<template #header> <template #header="{ close }">
<div class="flex justify-between"> <div class="flex justify-between items-center h-54px pl-15px pr-15px relative">
<slot name="title"> <slot name="title">
{{ title }} {{ title }}
</slot> </slot>
<Icon <div
v-if="fullscreen" class="h-54px flex justify-between items-center absolute top-[50%] right-15px translate-y-[-50%]"
:icon="isFullscreen ? 'zmdi:fullscreen-exit' : 'zmdi:fullscreen'" >
class="mr-22px cursor-pointer is-hover mt-2px z-10" <Icon
color="var(--el-color-info)" v-if="fullscreen"
@click="toggleFull" class="cursor-pointer is-hover mr-10px"
/> :icon="isFullscreen ? 'radix-icons:exit-full-screen' : 'radix-icons:enter-full-screen'"
color="var(--el-color-info)"
hover-color="var(--el-color-primary)"
@click="toggleFull"
/>
<Icon
class="cursor-pointer is-hover"
icon="ep:close"
hover-color="var(--el-color-primary)"
color="var(--el-color-info)"
@click="close"
/>
</div>
</div> </div>
</template> </template>
<!-- 情况一如果 scroll true说明开启滚动条 -->
<ElScrollbar v-if="scroll" :style="dialogStyle"> <ElScrollbar v-if="scroll" :style="dialogStyle">
<slot></slot> <slot></slot>
</ElScrollbar> </ElScrollbar>
<!-- 情况二如果 scroll false说明关闭滚动条滚动条 -->
<slot v-else></slot> <slot v-else></slot>
<template v-if="slots.footer" #footer> <template v-if="slots.footer" #footer>
<slot name="footer"></slot> <slot name="footer"></slot>
</template> </template>
@ -99,24 +107,32 @@ const dialogStyle = computed(() => {
</template> </template>
<style lang="scss"> <style lang="scss">
.#{$elNamespace}-overlay-dialog {
display: flex;
justify-content: center;
align-items: center;
}
.#{$elNamespace}-dialog { .#{$elNamespace}-dialog {
margin: 0 !important;
&__header { &__header {
height: 54px;
padding: 0;
margin-right: 0 !important; margin-right: 0 !important;
border-bottom: 1px solid var(--el-border-color); border-bottom: 1px solid var(--el-border-color);
} }
&__body { &__body {
padding: 0 !important; padding: 15px !important;
} }
&__footer { &__footer {
border-top: 1px solid var(--el-border-color); border-top: 1px solid var(--el-border-color);
} }
}
.is-hover { &__headerbtn {
&:hover { top: 0;
color: var(--el-color-primary) !important;
} }
} }
</style> </style>

View File

@ -300,12 +300,12 @@ export default defineComponent({
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
:deep(.el-button.is-text) { :deep(.el-button.is-text) {
margin-left: 0;
padding: 8px 4px; padding: 8px 4px;
margin-left: 0;
} }
:deep(.el-button.is-link) { :deep(.el-button.is-link) {
margin-left: 0;
padding: 8px 4px; padding: 8px 4px;
margin-left: 0;
} }
</style> </style>

View File

@ -147,10 +147,10 @@ const listToString = (list: UploadUserFile[], separator?: string) => {
} }
:deep(.upload-file-list .el-upload-list__item) { :deep(.upload-file-list .el-upload-list__item) {
border: 1px solid #e4e7ed;
line-height: 2;
margin-bottom: 10px;
position: relative; position: relative;
margin-bottom: 10px;
line-height: 2;
border: 1px solid #e4e7ed;
} }
:deep(.el-upload-list__item-file-name) { :deep(.el-upload-list__item-file-name) {

View File

@ -229,16 +229,16 @@ const uploadError = () => {
position: absolute; position: absolute;
top: 0; top: 0;
right: 0; right: 0;
box-sizing: border-box;
display: flex; display: flex;
align-items: center;
justify-content: center;
width: 100%; width: 100%;
height: 100%; height: 100%;
cursor: pointer; cursor: pointer;
background: rgb(0 0 0 / 60%); background: rgb(0 0 0 / 60%);
opacity: 0; opacity: 0;
box-sizing: border-box;
transition: var(--el-transition-duration-fast); transition: var(--el-transition-duration-fast);
align-items: center;
justify-content: center;
.handle-icon { .handle-icon {
display: flex; display: flex;

View File

@ -248,16 +248,16 @@ const handlePictureCardPreview: UploadProps['onPreview'] = (uploadFile) => {
position: absolute; position: absolute;
top: 0; top: 0;
right: 0; right: 0;
box-sizing: border-box;
display: flex; display: flex;
align-items: center;
justify-content: center;
width: 100%; width: 100%;
height: 100%; height: 100%;
cursor: pointer; cursor: pointer;
background: rgb(0 0 0 / 60%); background: rgb(0 0 0 / 60%);
opacity: 0; opacity: 0;
box-sizing: border-box;
transition: var(--el-transition-duration-fast); transition: var(--el-transition-duration-fast);
align-items: center;
justify-content: center;
.handle-icon { .handle-icon {
display: flex; display: flex;

File diff suppressed because one or more lines are too long

View File

@ -17,7 +17,7 @@
ref="canvas" ref="canvas"
:src="'data:image/png;base64,' + pointBackImgBase" :src="'data:image/png;base64,' + pointBackImgBase"
alt="" alt=""
style="width: 100%; height: 100%; display: block" style="display: block; width: 100%; height: 100%"
@click="bindingClick ? canvasClick($event) : undefined" @click="bindingClick ? canvasClick($event) : undefined"
/> />

View File

@ -9,7 +9,7 @@
<img <img
:src="'data:image/png;base64,' + backImgBase" :src="'data:image/png;base64,' + backImgBase"
alt="" alt=""
style="width: 100%; height: 100%; display: block" style="display: block; width: 100%; height: 100%"
/> />
<div v-show="showRefresh" class="verify-refresh" @click="refresh"> <div v-show="showRefresh" class="verify-refresh" @click="refresh">
<i class="iconfont icon-refresh"></i> <i class="iconfont icon-refresh"></i>
@ -63,7 +63,7 @@
<img <img
:src="'data:image/png;base64,' + blockBackImgBase" :src="'data:image/png;base64,' + blockBackImgBase"
alt="" alt=""
style="width: 100%; height: 100%; display: block; -webkit-user-drag: none" style="display: block; width: 100%; height: 100%; -webkit-user-drag: none"
/> />
</div> </div>
</div> </div>

View File

@ -39,12 +39,12 @@ const getBindValue = computed(() => {
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
:deep(.el-button.is-text) { :deep(.el-button.is-text) {
margin-left: 0;
padding: 8px 4px; padding: 8px 4px;
margin-left: 0;
} }
:deep(.el-button.is-link) { :deep(.el-button.is-link) {
margin-left: 0;
padding: 8px 4px; padding: 8px 4px;
margin-left: 0;
} }
</style> </style>

View File

@ -38,12 +38,12 @@ const getBindValue = computed(() => {
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
:deep(.el-button.is-text) { :deep(.el-button.is-text) {
margin-left: 0;
padding: 8px 4px; padding: 8px 4px;
margin-left: 0;
} }
:deep(.el-button.is-link) { :deep(.el-button.is-link) {
margin-left: 0;
padding: 8px 4px; padding: 8px 4px;
margin-left: 0;
} }
</style> </style>

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="my-process-designer"> <div class="my-process-designer">
<div class="my-process-designer__header" style="display: table-row-group; z-index: 999"> <div class="my-process-designer__header" style="z-index: 999; display: table-row-group">
<slot name="control-header"></slot> <slot name="control-header"></slot>
<template v-if="!$slots['control-header']"> <template v-if="!$slots['control-header']">
<ElButtonGroup key="file-control"> <ElButtonGroup key="file-control">

View File

@ -565,11 +565,11 @@ watch(
} }
.element-overlays { .element-overlays {
box-sizing: border-box; width: 200px;
padding: 8px; padding: 8px;
color: #fafafa;
background: rgb(0 0 0 / 60%); background: rgb(0 0 0 / 60%);
border-radius: 4px; border-radius: 4px;
color: #fafafa; box-sizing: border-box;
width: 200px;
} }
</style> </style>

View File

@ -31,15 +31,15 @@ const addTask = (event, options: any = {}) => {
<style scoped lang="scss"> <style scoped lang="scss">
.my-process-palette { .my-process-palette {
box-sizing: border-box;
padding: 80px 20px 20px; padding: 80px 20px 20px;
box-sizing: border-box;
.test-button { .test-button {
box-sizing: border-box;
padding: 8px 16px; padding: 8px 16px;
border-radius: 4px;
border: 1px solid rgb(24 144 255 / 80%);
cursor: pointer; cursor: pointer;
border: 1px solid rgb(24 144 255 / 80%);
border-radius: 4px;
box-sizing: border-box;
} }
} }
</style> </style>

View File

@ -71,7 +71,7 @@ onMounted(() => {
</ElTabPane> </ElTabPane>
</ElTabs> </ElTabs>
<!-- 更多 --> <!-- 更多 -->
<div style="text-align: right; margin-top: 10px"> <div style="margin-top: 10px; text-align: right">
<XButton preIcon="ep:view" title="查看全部" type="primary" @click="goMyList" /> <XButton preIcon="ep:view" title="查看全部" type="primary" @click="goMyList" />
</div> </div>
</ElPopover> </ElPopover>

View File

@ -118,17 +118,13 @@ export const PayChannelEnum = {
ALIPAY_BAR: { ALIPAY_BAR: {
code: 'alipay_bar', code: 'alipay_bar',
name: '支付宝条码支付' name: '支付宝条码支付'
},
MOCK: {
code: 'mock',
name: '模拟支付'
} }
} }
/**
*
*/
export const PayType = {
WECHAT: 'WECHAT',
ALIPAY: 'ALIPAY'
}
/** /**
* *
*/ */

View File

@ -9,13 +9,13 @@
label-width="120px" label-width="120px"
size="large" size="large"
> >
<el-row style="margin-left: -10px; margin-right: -10px"> <el-row style="margin-right: -10px; margin-left: -10px">
<el-col :span="24" style="padding-left: 10px; padding-right: 10px"> <el-col :span="24" style="padding-right: 10px; padding-left: 10px">
<el-form-item> <el-form-item>
<LoginFormTitle style="width: 100%" /> <LoginFormTitle style="width: 100%" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" style="padding-left: 10px; padding-right: 10px"> <el-col :span="24" style="padding-right: 10px; padding-left: 10px">
<el-form-item v-if="loginData.tenantEnable === 'true'" prop="tenantName"> <el-form-item v-if="loginData.tenantEnable === 'true'" prop="tenantName">
<el-input <el-input
v-model="loginData.loginForm.tenantName" v-model="loginData.loginForm.tenantName"
@ -26,7 +26,7 @@
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" style="padding-left: 10px; padding-right: 10px"> <el-col :span="24" style="padding-right: 10px; padding-left: 10px">
<el-form-item prop="username"> <el-form-item prop="username">
<el-input <el-input
v-model="loginData.loginForm.username" v-model="loginData.loginForm.username"
@ -35,7 +35,7 @@
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" style="padding-left: 10px; padding-right: 10px"> <el-col :span="24" style="padding-right: 10px; padding-left: 10px">
<el-form-item prop="password"> <el-form-item prop="password">
<el-input <el-input
v-model="loginData.loginForm.password" v-model="loginData.loginForm.password"
@ -49,7 +49,7 @@
</el-col> </el-col>
<el-col <el-col
:span="24" :span="24"
style="padding-left: 10px; padding-right: 10px; margin-top: -20px; margin-bottom: -20px" style="padding-right: 10px; padding-left: 10px; margin-top: -20px; margin-bottom: -20px"
> >
<el-form-item> <el-form-item>
<el-row justify="space-between" style="width: 100%"> <el-row justify="space-between" style="width: 100%">
@ -64,7 +64,7 @@
</el-row> </el-row>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" style="padding-left: 10px; padding-right: 10px"> <el-col :span="24" style="padding-right: 10px; padding-left: 10px">
<el-form-item> <el-form-item>
<XButton <XButton
:loading="loginLoading" :loading="loginLoading"
@ -82,7 +82,7 @@
mode="pop" mode="pop"
@success="handleLogin" @success="handleLogin"
/> />
<el-col :span="24" style="padding-left: 10px; padding-right: 10px"> <el-col :span="24" style="padding-right: 10px; padding-left: 10px">
<el-form-item> <el-form-item>
<el-row :gutter="5" justify="space-between" style="width: 100%"> <el-row :gutter="5" justify="space-between" style="width: 100%">
<el-col :span="8"> <el-col :span="8">
@ -110,7 +110,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-divider content-position="center">{{ t('login.otherLogin') }}</el-divider> <el-divider content-position="center">{{ t('login.otherLogin') }}</el-divider>
<el-col :span="24" style="padding-left: 10px; padding-right: 10px"> <el-col :span="24" style="padding-right: 10px; padding-left: 10px">
<el-form-item> <el-form-item>
<div class="flex justify-between w-[100%]"> <div class="flex justify-between w-[100%]">
<Icon <Icon
@ -126,7 +126,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-divider content-position="center">萌新必读</el-divider> <el-divider content-position="center">萌新必读</el-divider>
<el-col :span="24" style="padding-left: 10px; padding-right: 10px"> <el-col :span="24" style="padding-right: 10px; padding-left: 10px">
<el-form-item> <el-form-item>
<div class="flex justify-between w-[100%]"> <div class="flex justify-between w-[100%]">
<el-link href="https://doc.iocoder.cn/" target="_blank">📚开发指南</el-link> <el-link href="https://doc.iocoder.cn/" target="_blank">📚开发指南</el-link>
@ -316,16 +316,16 @@ onMounted(() => {
} }
.login-code { .login-code {
float: right;
width: 100%; width: 100%;
height: 38px; height: 38px;
float: right;
img { img {
cursor: pointer;
width: 100%; width: 100%;
max-width: 100px;
height: auto; height: auto;
max-width: 100px;
vertical-align: middle; vertical-align: middle;
cursor: pointer;
} }
} }
</style> </style>

View File

@ -9,14 +9,14 @@
label-width="120px" label-width="120px"
size="large" size="large"
> >
<el-row style="margin-left: -10px; margin-right: -10px"> <el-row style="margin-right: -10px; margin-left: -10px">
<!-- 租户名 --> <!-- 租户名 -->
<el-col :span="24" style="padding-left: 10px; padding-right: 10px"> <el-col :span="24" style="padding-right: 10px; padding-left: 10px">
<el-form-item> <el-form-item>
<LoginFormTitle style="width: 100%" /> <LoginFormTitle style="width: 100%" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" style="padding-left: 10px; padding-right: 10px"> <el-col :span="24" style="padding-right: 10px; padding-left: 10px">
<el-form-item v-if="loginData.tenantEnable === 'true'" prop="tenantName"> <el-form-item v-if="loginData.tenantEnable === 'true'" prop="tenantName">
<el-input <el-input
v-model="loginData.loginForm.tenantName" v-model="loginData.loginForm.tenantName"
@ -28,7 +28,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- 手机号 --> <!-- 手机号 -->
<el-col :span="24" style="padding-left: 10px; padding-right: 10px"> <el-col :span="24" style="padding-right: 10px; padding-left: 10px">
<el-form-item prop="mobileNumber"> <el-form-item prop="mobileNumber">
<el-input <el-input
v-model="loginData.loginForm.mobileNumber" v-model="loginData.loginForm.mobileNumber"
@ -38,7 +38,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- 验证码 --> <!-- 验证码 -->
<el-col :span="24" style="padding-left: 10px; padding-right: 10px"> <el-col :span="24" style="padding-right: 10px; padding-left: 10px">
<el-form-item prop="code"> <el-form-item prop="code">
<el-row :gutter="5" justify="space-between" style="width: 100%"> <el-row :gutter="5" justify="space-between" style="width: 100%">
<el-col :span="24"> <el-col :span="24">
@ -68,7 +68,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- 登录按钮 / 返回按钮 --> <!-- 登录按钮 / 返回按钮 -->
<el-col :span="24" style="padding-left: 10px; padding-right: 10px"> <el-col :span="24" style="padding-right: 10px; padding-left: 10px">
<el-form-item> <el-form-item>
<XButton <XButton
:loading="loginLoading" :loading="loginLoading"
@ -79,7 +79,7 @@
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" style="padding-left: 10px; padding-right: 10px"> <el-col :span="24" style="padding-right: 10px; padding-left: 10px">
<el-form-item> <el-form-item>
<XButton <XButton
:loading="loginLoading" :loading="loginLoading"

View File

@ -1,15 +1,15 @@
<template> <template>
<el-row v-show="getShow" style="margin-left: -10px; margin-right: -10px"> <el-row v-show="getShow" style="margin-right: -10px; margin-left: -10px">
<el-col :span="24" style="padding-left: 10px; padding-right: 10px"> <el-col :span="24" style="padding-right: 10px; padding-left: 10px">
<LoginFormTitle style="width: 100%" /> <LoginFormTitle style="width: 100%" />
</el-col> </el-col>
<el-col :span="24" style="padding-left: 10px; padding-right: 10px"> <el-col :span="24" style="padding-right: 10px; padding-left: 10px">
<el-card class="mb-10px text-center" shadow="hover"> <el-card class="mb-10px text-center" shadow="hover">
<Qrcode :logo="logoImg" /> <Qrcode :logo="logoImg" />
</el-card> </el-card>
</el-col> </el-col>
<el-divider class="enter-x">{{ t('login.qrcode') }}</el-divider> <el-divider class="enter-x">{{ t('login.qrcode') }}</el-divider>
<el-col :span="24" style="padding-left: 10px; padding-right: 10px"> <el-col :span="24" style="padding-right: 10px; padding-left: 10px">
<div class="w-[100%] mt-15px"> <div class="w-[100%] mt-15px">
<XButton :title="t('login.backLogin')" class="w-[100%]" @click="handleBackLogin()" /> <XButton :title="t('login.backLogin')" class="w-[100%]" @click="handleBackLogin()" />
</div> </div>

View File

@ -54,8 +54,8 @@ const activeName = ref('basicInfo')
.profile-tabs > .el-tabs__content { .profile-tabs > .el-tabs__content {
padding: 32px; padding: 32px;
color: #6b778c;
font-weight: 600; font-weight: 600;
color: #6b778c;
} }
.el-tabs--left .el-tabs__content { .el-tabs--left .el-tabs__content {

View File

@ -67,17 +67,17 @@ onMounted(async () => {
<style scoped> <style scoped>
.text-center { .text-center {
text-align: center;
position: relative; position: relative;
height: 120px; height: 120px;
text-align: center;
} }
.list-group-striped > .list-group-item { .list-group-striped > .list-group-item {
border-left: 0;
border-right: 0;
border-radius: 0;
padding-left: 0;
padding-right: 0; padding-right: 0;
padding-left: 0;
border-right: 0;
border-left: 0;
border-radius: 0;
} }
.list-group { .list-group {
@ -86,11 +86,11 @@ onMounted(async () => {
} }
.list-group-item { .list-group-item {
border-bottom: 1px solid #e7eaec;
border-top: 1px solid #e7eaec;
margin-bottom: -1px;
padding: 11px 0; padding: 11px 0;
margin-bottom: -1px;
font-size: 13px; font-size: 13px;
border-top: 1px solid #e7eaec;
border-bottom: 1px solid #e7eaec;
} }
.pull-right { .pull-right {

View File

@ -99,7 +99,7 @@ onMounted(async () => {
<style lang="scss"> <style lang="scss">
.process-panel__container { .process-panel__container {
position: absolute; position: absolute;
right: 60px;
top: 90px; top: 90px;
right: 60px;
} }
</style> </style>

View File

@ -14,24 +14,24 @@
> >
<p style="font-weight: 700">任务{{ item.name }}</p> <p style="font-weight: 700">任务{{ item.name }}</p>
<el-card :body-style="{ padding: '10px' }"> <el-card :body-style="{ padding: '10px' }">
<label v-if="item.assigneeUser" style="font-weight: normal; margin-right: 30px"> <label v-if="item.assigneeUser" style="margin-right: 30px; font-weight: normal">
审批人{{ item.assigneeUser.nickname }} 审批人{{ item.assigneeUser.nickname }}
<el-tag size="small" type="info">{{ item.assigneeUser.deptName }}</el-tag> <el-tag size="small" type="info">{{ item.assigneeUser.deptName }}</el-tag>
</label> </label>
<label v-if="item.createTime" style="font-weight: normal">创建时间</label> <label v-if="item.createTime" style="font-weight: normal">创建时间</label>
<label style="color: #8a909c; font-weight: normal"> <label style="font-weight: normal; color: #8a909c">
{{ formatDate(item?.createTime) }} {{ formatDate(item?.createTime) }}
</label> </label>
<label v-if="item.endTime" style="margin-left: 30px; font-weight: normal"> <label v-if="item.endTime" style="margin-left: 30px; font-weight: normal">
审批时间 审批时间
</label> </label>
<label v-if="item.endTime" style="color: #8a909c; font-weight: normal"> <label v-if="item.endTime" style="font-weight: normal; color: #8a909c">
{{ formatDate(item?.endTime) }} {{ formatDate(item?.endTime) }}
</label> </label>
<label v-if="item.durationInMillis" style="margin-left: 30px; font-weight: normal"> <label v-if="item.durationInMillis" style="margin-left: 30px; font-weight: normal">
耗时 耗时
</label> </label>
<label v-if="item.durationInMillis" style="color: #8a909c; font-weight: normal"> <label v-if="item.durationInMillis" style="font-weight: normal; color: #8a909c">
{{ formatPast2(item?.durationInMillis) }} {{ formatPast2(item?.durationInMillis) }}
</label> </label>
<p v-if="item.reason"> <p v-if="item.reason">

View File

@ -32,7 +32,7 @@
/> />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div style="margin-left: 10%; margin-bottom: 20px; font-size: 14px"> <div style="margin-bottom: 20px; margin-left: 10%; font-size: 14px">
<el-button type="success" @click="handleAudit(item, true)"> <el-button type="success" @click="handleAudit(item, true)">
<Icon icon="ep:select" /> <Icon icon="ep:select" />
通过 通过

View File

@ -215,8 +215,8 @@ onMounted(async () => {
<style lang="scss"> <style lang="scss">
.app-infra-codegen-preview-container { .app-infra-codegen-preview-container {
.el-scrollbar .el-scrollbar__wrap .el-scrollbar__view { .el-scrollbar .el-scrollbar__wrap .el-scrollbar__view {
white-space: nowrap;
display: inline-block; display: inline-block;
white-space: nowrap;
} }
} }
</style> </style>

View File

@ -101,7 +101,7 @@ const getDetail = async () => {
if ('ProductSpuDetail' === name) { if ('ProductSpuDetail' === name) {
isDetail.value = true isDetail.value = true
} }
const id = params.spuId as number const id = params.spuId as unknown as number
if (id) { if (id) {
formLoading.value = true formLoading.value = true
try { try {
@ -155,15 +155,15 @@ const submitForm = async () => {
item.subCommissionSecondPrice = convertToInteger(item.subCommissionSecondPrice) item.subCommissionSecondPrice = convertToInteger(item.subCommissionSecondPrice)
}) })
// //
const newSliderPicUrls = [] const newSliderPicUrls: any[] = []
deepCopyFormData.sliderPicUrls.forEach((item) => { deepCopyFormData.sliderPicUrls.forEach((item: any) => {
// //
typeof item === 'object' ? newSliderPicUrls.push(item.url) : newSliderPicUrls.push(item) typeof item === 'object' ? newSliderPicUrls.push(item.url) : newSliderPicUrls.push(item)
}) })
deepCopyFormData.sliderPicUrls = newSliderPicUrls deepCopyFormData.sliderPicUrls = newSliderPicUrls
// //
const data = deepCopyFormData as ProductSpuApi.Spu const data = deepCopyFormData as ProductSpuApi.Spu
const id = params.spuId as number const id = params.spuId as unknown as number
if (!id) { if (!id) {
await ProductSpuApi.createSpu(data) await ProductSpuApi.createSpu(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))

View File

@ -336,7 +336,7 @@
> >
<el-option v-for="item in productSpus" :key="item.id" :label="item.name" :value="item.id"> <el-option v-for="item in productSpus" :key="item.id" :label="item.name" :value="item.id">
<span style="float: left">{{ item.name }}</span> <span style="float: left">{{ item.name }}</span>
<span style="float: right; color: #8492a6; font-size: 13px" <span style="float: right; font-size: 13px; color: #8492a6"
>{{ (item.minPrice / 100.0).toFixed(2) }}</span >{{ (item.minPrice / 100.0).toFixed(2) }}</span
> >
</el-option> </el-option>

View File

@ -341,12 +341,12 @@ const clipboardSuccess = () => {
align-items: center; align-items: center;
&::before { &::before {
content: '';
display: inline-block; display: inline-block;
margin-right: 10px;
width: 3px; width: 3px;
height: 20px; height: 20px;
margin-right: 10px;
background-color: #409eff; background-color: #409eff;
content: '';
} }
} }

View File

@ -52,11 +52,11 @@ const getNickname = (sendFrom: SendFrom) =>
<style lang="scss" scoped> <style lang="scss" scoped>
/* 因为 joolun 实现依赖 avue 组件,该页面使用了 comment.scss、card.scc */ /* 因为 joolun 实现依赖 avue 组件,该页面使用了 comment.scss、card.scc */
@import '../comment.scss'; @import url('../comment.scss');
@import '../card.scss'; @import url('../card.scss');
.avatar-div { .avatar-div {
text-align: center;
width: 80px; width: 80px;
text-align: center;
} }
</style> </style>

View File

@ -174,10 +174,10 @@ const scrollToBottom = async () => {
<style lang="scss" scoped> <style lang="scss" scoped>
.msg-div { .msg-div {
height: 50vh; height: 50vh;
margin-right: 10px;
margin-left: 10px;
overflow: auto; overflow: auto;
background-color: #eaeaea; background-color: #eaeaea;
margin-left: 10px;
margin-right: 10px;
} }
.msg-send { .msg-send {

View File

@ -58,5 +58,5 @@ defineExpose({
<style lang="scss" scoped> <style lang="scss" scoped>
/* 因为 joolun 实现依赖 avue 组件,该页面使用了 card.scss */ /* 因为 joolun 实现依赖 avue 组件,该页面使用了 card.scss */
@import '../wx-msg/card.scss'; @import url('../wx-msg/card.scss');
</style> </style>

View File

@ -219,8 +219,8 @@ const onChildDragEnd = ({ newIndex }) => {
} }
.draggable-ghost { .draggable-ghost {
opacity: 0.5;
background: #f7fafc; background: #f7fafc;
border: 1px solid #4299e1; border: 1px solid #4299e1;
opacity: 0.5;
} }
</style> </style>

View File

@ -10,16 +10,6 @@
<el-form-item label="应用名" prop="name"> <el-form-item label="应用名" prop="name">
<el-input v-model="formData.name" placeholder="请输入应用名" /> <el-input v-model="formData.name" placeholder="请输入应用名" />
</el-form-item> </el-form-item>
<el-form-item label="所属商户" prop="merchantId">
<el-select v-model="formData.merchantId" placeholder="请选择所属商户">
<el-option
v-for="item in merchantList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item label="开启状态" prop="status"> <el-form-item label="开启状态" prop="status">
<el-radio-group v-model="formData.status"> <el-radio-group v-model="formData.status">
<el-radio <el-radio
@ -47,10 +37,10 @@
</template> </template>
</Dialog> </Dialog>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import * as AppApi from '@/api/pay/app' import * as AppApi from '@/api/pay/app'
import * as MerchantApi from '@/api/pay/merchant'
import { CommonStatusEnum } from '@/utils/constants' import { CommonStatusEnum } from '@/utils/constants'
defineOptions({ name: 'PayAppForm' }) defineOptions({ name: 'PayAppForm' })
@ -77,11 +67,9 @@ const formRules = reactive({
name: [{ required: true, message: '应用名不能为空', trigger: 'blur' }], name: [{ required: true, message: '应用名不能为空', trigger: 'blur' }],
status: [{ required: true, message: '开启状态不能为空', trigger: 'blur' }], status: [{ required: true, message: '开启状态不能为空', trigger: 'blur' }],
payNotifyUrl: [{ required: true, message: '支付结果的回调地址不能为空', trigger: 'blur' }], payNotifyUrl: [{ required: true, message: '支付结果的回调地址不能为空', trigger: 'blur' }],
refundNotifyUrl: [{ required: true, message: '退款结果的回调地址不能为空', trigger: 'blur' }], refundNotifyUrl: [{ required: true, message: '退款结果的回调地址不能为空', trigger: 'blur' }]
merchantId: [{ required: true, message: '商户编号不能为空', trigger: 'blur' }]
}) })
const formRef = ref() // Ref const formRef = ref() // Ref
const merchantList = ref([]) //
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (type: string, id?: number) => { const open = async (type: string, id?: number) => {
@ -98,8 +86,6 @@ const open = async (type: string, id?: number) => {
formLoading.value = false formLoading.value = false
} }
} }
//
merchantList.value = await MerchantApi.getMerchantListByName()
} }
defineExpose({ open }) // open defineExpose({ open }) // open
@ -137,8 +123,7 @@ const resetForm = () => {
status: CommonStatusEnum.ENABLE, status: CommonStatusEnum.ENABLE,
remark: undefined, remark: undefined,
payNotifyUrl: undefined, payNotifyUrl: undefined,
refundNotifyUrl: undefined, refundNotifyUrl: undefined
merchantId: undefined
} }
formRef.value?.resetFields() formRef.value?.resetFields()
} }

View File

@ -0,0 +1,316 @@
<template>
<div>
<Dialog v-model="dialogVisible" :title="dialogTitle" @closed="close" width="830px">
<el-form
ref="formRef"
:model="formData"
:formRules="formRules"
label-width="100px"
v-loading="formLoading"
>
<el-form-item label-width="180px" label="渠道费率" prop="feeRate">
<el-input v-model="formData.feeRate" placeholder="请输入渠道费率" clearable>
<template #append>%</template>
</el-input>
</el-form-item>
<el-form-item label-width="180px" label="开放平台 APPID" prop="config.appId">
<el-input v-model="formData.config.appId" placeholder="请输入开放平台 APPID" clearable />
</el-form-item>
<el-form-item label-width="180px" label="渠道状态" prop="status">
<el-radio-group v-model="formData.status">
<el-radio
v-for="dict in getDictOptions(DICT_TYPE.COMMON_STATUS)"
:key="parseInt(dict.value)"
:label="parseInt(dict.value)"
>
{{ dict.label }}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label-width="180px" label="网关地址" prop="config.serverUrl">
<el-radio-group v-model="formData.config.serverUrl">
<el-radio label="https://openapi.alipay.com/gateway.do">线上环境</el-radio>
<el-radio label="https://openapi-sandbox.dl.alipaydev.com/gateway.do">
沙箱环境
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label-width="180px" label="算法类型" prop="config.signType">
<el-radio-group v-model="formData.config.signType">
<el-radio key="RSA2" label="RSA2">RSA2</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label-width="180px" label="公钥类型" prop="config.mode">
<el-radio-group v-model="formData.config.mode">
<el-radio key="公钥模式" :label="1">公钥模式</el-radio>
<el-radio key="证书模式" :label="2">证书模式</el-radio>
</el-radio-group>
</el-form-item>
<div v-if="formData.config.mode === 1">
<el-form-item label-width="180px" label="应用私钥" prop="config.privateKey">
<el-input
type="textarea"
:autosize="{ minRows: 8, maxRows: 8 }"
v-model="formData.config.privateKey"
placeholder="请输入应用私钥"
clearable
:style="{ width: '100%' }"
/>
</el-form-item>
<el-form-item label-width="180px" label="支付宝公钥" prop="config.alipayPublicKey">
<el-input
type="textarea"
:autosize="{ minRows: 8, maxRows: 8 }"
v-model="formData.config.alipayPublicKey"
placeholder="请输入支付宝公钥"
clearable
:style="{ width: '100%' }"
/>
</el-form-item>
</div>
<div v-if="formData.config.mode === 2">
<el-form-item label-width="180px" label="商户公钥应用证书" prop="config.appCertContent">
<el-input
v-model="formData.config.appCertContent"
type="textarea"
placeholder="请上传商户公钥应用证书"
readonly
:autosize="{ minRows: 8, maxRows: 8 }"
:style="{ width: '100%' }"
/>
</el-form-item>
<el-form-item label-width="180px" label="">
<el-upload
action=""
ref="privateKeyContentFile"
:limit="1"
:accept="fileAccept"
:http-request="appCertUpload"
:before-upload="fileBeforeUpload"
>
<el-button type="primary">
<Icon icon="ep:upload" class="mr-5px" /> 点击上传
</el-button>
</el-upload>
</el-form-item>
<el-form-item
label-width="180px"
label="支付宝公钥证书"
prop="config.alipayPublicCertContent"
>
<el-input
v-model="formData.config.alipayPublicCertContent"
type="textarea"
placeholder="请上传支付宝公钥证书"
readonly
:autosize="{ minRows: 8, maxRows: 8 }"
:style="{ width: '100%' }"
/>
</el-form-item>
<el-form-item label-width="180px" label="">
<el-upload
ref="privateCertContentFile"
action=""
:limit="1"
:accept="fileAccept"
:before-upload="fileBeforeUpload"
:http-request="alipayPublicCertUpload"
>
<el-button type="primary">
<Icon icon="ep:upload" class="mr-5px" /> 点击上传
</el-button>
</el-upload>
</el-form-item>
<el-form-item label-width="180px" label="根证书" prop="config.rootCertContent">
<el-input
v-model="formData.config.rootCertContent"
type="textarea"
placeholder="请上传根证书"
readonly
:autosize="{ minRows: 8, maxRows: 8 }"
:style="{ width: '100%' }"
/>
</el-form-item>
<el-form-item label-width="180px" label="">
<el-upload
ref="privateCertContentFile"
:limit="1"
:accept="fileAccept"
action=""
:before-upload="fileBeforeUpload"
:http-request="rootCertUpload"
>
<el-button type="primary">
<Icon icon="ep:upload" class="mr-5px" /> 点击上传
</el-button>
</el-upload>
</el-form-item>
</div>
<el-form-item label-width="180px" label="备注" prop="remark">
<el-input v-model="formData.remark" :style="{ width: '100%' }" />
</el-form-item>
</el-form>
<template #footer>
<el-button :disabled="formLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</div>
</template>
<script lang="ts" setup>
import { CommonStatusEnum } from '@/utils/constants'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
import * as ChannelApi from '@/api/pay/channel'
defineOptions({ name: 'AlipayChannelForm' })
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formData = ref<any>({
appId: '',
code: '',
status: undefined,
feeRate: undefined,
remark: '',
config: {
appId: '',
serverUrl: null,
signType: '',
mode: null,
privateKey: '',
alipayPublicKey: '',
appCertContent: '',
alipayPublicCertContent: '',
rootCertContent: ''
}
})
const formRules = {
feeRate: [{ required: true, message: '请输入渠道费率', trigger: 'blur' }],
status: [{ required: true, message: '渠道状态不能为空', trigger: 'blur' }],
'config.appId': [{ required: true, message: '请输入开放平台上创建的应用的 ID', trigger: 'blur' }],
'config.serverUrl': [{ required: true, message: '请传入网关地址', trigger: 'blur' }],
'config.signType': [{ required: true, message: '请传入签名算法类型', trigger: 'blur' }],
'config.mode': [{ required: true, message: '公钥类型不能为空', trigger: 'blur' }],
'config.privateKey': [{ required: true, message: '请输入商户私钥', trigger: 'blur' }],
'config.alipayPublicKey': [
{ required: true, message: '请输入支付宝公钥字符串', trigger: 'blur' }
],
'config.appCertContent': [{ required: true, message: '请上传商户公钥应用证书', trigger: 'blur' }],
'config.alipayPublicCertContent': [
{ required: true, message: '请上传支付宝公钥证书', trigger: 'blur' }
],
'config.rootCertContent': [{ required: true, message: '请上传指定根证书', trigger: 'blur' }]
}
const fileAccept = '.crt'
const formRef = ref() // Ref
/** 打开弹窗 */
const open = async (appId, code) => {
dialogVisible.value = true
formLoading.value = true
resetForm(appId, code)
//
try {
const data = await ChannelApi.getChannel(appId, code)
if (data && data.id) {
formData.value = data
formData.value.config = JSON.parse(data.config)
}
dialogTitle.value = !formData.value.id ? '创建支付渠道' : '编辑支付渠道'
} finally {
formLoading.value = false
}
}
defineExpose({ open }) // open
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => {
//
if (!formRef) return
const valid = await formRef.value.validate()
if (!valid) return
//
formLoading.value = true
try {
const data = { ...formData.value } as unknown as ChannelApi.ChannelVO
data.config = JSON.stringify(formData.value.config)
if (!data.id) {
await ChannelApi.createChannel(data)
message.success(t('common.createSuccess'))
} else {
await ChannelApi.updateChannel(data)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
}
}
/** 重置表单 */
const resetForm = (appId, code) => {
formData.value = {
appId: appId,
code: code,
status: CommonStatusEnum.ENABLE,
remark: '',
feeRate: null,
config: {
appId: '',
serverUrl: null,
signType: 'RSA2',
mode: null,
privateKey: '',
alipayPublicKey: '',
appCertContent: '',
alipayPublicCertContent: '',
rootCertContent: ''
}
}
formRef.value?.resetFields()
}
const fileBeforeUpload = (file) => {
let format = '.' + file.name.split('.')[1]
if (format !== fileAccept) {
message.error(`请上传指定格式"${fileAccept}"文件`)
return false
}
let isRightSize = file.size / 1024 / 1024 < 2
if (!isRightSize) {
message.error('文件大小超过 2MB')
}
return isRightSize
}
const appCertUpload = (event) => {
const readFile = new FileReader()
readFile.onload = (e: any) => {
formData.value.config.appCertContent = e.target.result
}
readFile.readAsText(event.file)
}
const alipayPublicCertUpload = (event) => {
const readFile = new FileReader()
readFile.onload = (e: any) => {
formData.value.config.alipayPublicCertContent = e.target.result
}
readFile.readAsText(event.file)
}
const rootCertUpload = (event) => {
const readFile = new FileReader()
readFile.onload = (e: any) => {
formData.value.config.rootCertContent = e.target.result
}
readFile.readAsText(event.file)
}
</script>

View File

@ -0,0 +1,122 @@
<template>
<div>
<Dialog v-model="dialogVisible" :title="dialogTitle" @closed="close" width="800px">
<el-form
ref="formRef"
:model="formData"
:rules="formRules"
label-width="100px"
v-loading="formLoading"
>
<el-form-item label-width="180px" label="渠道状态" prop="status">
<el-radio-group v-model="formData.status">
<el-radio
v-for="dict in getDictOptions(DICT_TYPE.COMMON_STATUS)"
:key="parseInt(dict.value)"
:label="parseInt(dict.value)"
>
{{ dict.label }}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label-width="180px" label="备注" prop="remark">
<el-input v-model="formData.remark" :style="{ width: '100%' }" />
</el-form-item>
</el-form>
<template #footer>
<el-button :disabled="formLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</div>
</template>
<script lang="ts" setup>
import { CommonStatusEnum } from '@/utils/constants'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
import * as ChannelApi from '@/api/pay/channel'
defineOptions({ name: 'MockChannelForm' })
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formData = ref<any>({
appId: '',
code: '',
status: undefined,
feeRate: 0,
remark: '',
config: {
name: 'mock-conf'
}
})
const formRules = {
status: [{ required: true, message: '渠道状态不能为空', trigger: 'blur' }]
}
const formRef = ref() // Ref
/** 打开弹窗 */
const open = async (appId, code) => {
dialogVisible.value = true
formLoading.value = true
resetForm(appId, code)
//
try {
const data = await ChannelApi.getChannel(appId, code)
if (data && data.id) {
formData.value = data
formData.value.config = JSON.parse(data.config)
}
dialogTitle.value = !formData.value.id ? '创建支付渠道' : '编辑支付渠道'
} finally {
formLoading.value = false
}
}
defineExpose({ open }) // open
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => {
//
if (!formRef) return
const valid = await formRef.value.validate()
if (!valid) return
//
formLoading.value = true
try {
const data = { ...formData.value } as unknown as ChannelApi.ChannelVO
data.config = JSON.stringify(formData.value.config)
if (!data.id) {
await ChannelApi.createChannel(data)
message.success(t('common.createSuccess'))
} else {
await ChannelApi.updateChannel(data)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
}
}
/** 重置表单 */
const resetForm = (appId, code) => {
formData.value = {
appId: appId,
code: code,
status: CommonStatusEnum.ENABLE,
remark: '',
feeRate: 0,
config: {
name: 'mock-conf'
}
}
formRef.value?.resetFields()
}
</script>

View File

@ -0,0 +1,342 @@
<template>
<div>
<Dialog v-model="dialogVisible" :title="dialogTitle" @close="close" width="800px">
<el-form
ref="formRef"
:model="formData"
:rules="formRules"
label-width="120px"
v-loading="formLoading"
>
<el-form-item label-width="180px" label="渠道费率" prop="feeRate">
<el-input
v-model="formData.feeRate"
placeholder="请输入渠道费率"
clearable
:style="{ width: '100%' }"
>
<template #append>%</template>
</el-input>
</el-form-item>
<el-form-item label-width="180px" label="公众号 APPID" prop="config.appId">
<el-input
v-model="formData.config.appId"
placeholder="请输入公众号 APPID"
clearable
:style="{ width: '100%' }"
/>
</el-form-item>
<el-form-item label-width="180px" label="商户号" prop="config.mchId">
<el-input v-model="formData.config.mchId" :style="{ width: '100%' }" />
</el-form-item>
<el-form-item label-width="180px" label="渠道状态" prop="status">
<el-radio-group v-model="formData.status">
<el-radio
v-for="dict in getDictOptions(DICT_TYPE.COMMON_STATUS)"
:key="parseInt(dict.value)"
:label="parseInt(dict.value)"
>
{{ dict.label }}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label-width="180px" label="API 版本" prop="config.apiVersion">
<el-radio-group v-model="formData.config.apiVersion">
<el-radio label="v2">v2</el-radio>
<el-radio label="v3">v3</el-radio>
</el-radio-group>
</el-form-item>
<div v-if="formData.config.apiVersion === 'v2'">
<el-form-item label-width="180px" label="商户密钥" prop="config.mchKey">
<el-input
v-model="formData.config.mchKey"
placeholder="请输入商户密钥"
clearable
:style="{ width: '100%' }"
type="textarea"
:autosize="{ minRows: 8, maxRows: 8 }"
/>
</el-form-item>
<el-form-item
label-width="180px"
label="apiclient_cert.p12 证书"
prop="config.keyContent"
>
<el-input
v-model="formData.config.keyContent"
type="textarea"
placeholder="请上传 apiclient_cert.p12 证书"
readonly
:autosize="{ minRows: 8, maxRows: 8 }"
:style="{ width: '100%' }"
/>
</el-form-item>
<el-form-item label-width="180px" label="">
<el-upload
:limit="1"
accept=".p12"
action=""
:before-upload="p12FileBeforeUpload"
:http-request="keyContentUpload"
>
<el-button type="primary">
<Icon icon="ep:upload" class="mr-5px" /> 点击上传
</el-button>
</el-upload>
</el-form-item>
</div>
<div v-if="formData.config.apiVersion === 'v3'">
<el-form-item label-width="180px" label="API V3 密钥" prop="config.apiV3Key">
<el-input
v-model="formData.config.apiV3Key"
placeholder="请输入 API V3 密钥"
clearable
:style="{ width: '100%' }"
type="textarea"
:autosize="{ minRows: 8, maxRows: 8 }"
/>
</el-form-item>
<el-form-item
label-width="180px"
label="apiclient_key.pem 证书"
prop="config.privateKeyContent"
>
<el-input
v-model="formData.config.privateKeyContent"
type="textarea"
placeholder="请上传 apiclient_key.pem 证书"
readonly
:autosize="{ minRows: 8, maxRows: 8 }"
:style="{ width: '100%' }"
/>
</el-form-item>
<el-form-item label-width="180px" label="" prop="privateKeyContentFile">
<el-upload
ref="privateKeyContentFile"
:limit="1"
accept=".pem"
action=""
:before-upload="pemFileBeforeUpload"
:http-request="privateKeyContentUpload"
>
<el-button type="primary">
<Icon icon="ep:upload" class="mr-5px" /> 点击上传
</el-button>
</el-upload>
</el-form-item>
<el-form-item
label-width="180px"
label="apiclient_cert.pem证书"
prop="config.privateCertContent"
>
<el-input
v-model="formData.config.privateCertContent"
type="textarea"
placeholder="请上传apiclient_cert.pem证书"
readonly
:autosize="{ minRows: 8, maxRows: 8 }"
:style="{ width: '100%' }"
/>
</el-form-item>
<el-form-item label-width="180px" label="" prop="privateCertContentFile">
<el-upload
ref="privateCertContentFile"
:limit="1"
accept=".pem"
action=""
:before-upload="pemFileBeforeUpload"
:http-request="privateCertContentUpload"
>
<el-button type="primary">
<Icon icon="ep:upload" class="mr-5px" /> 点击上传
</el-button>
</el-upload>
</el-form-item>
</div>
<el-form-item label-width="180px" label="备注" prop="remark">
<el-input v-model="formData.remark" :style="{ width: '100%' }" />
</el-form-item>
</el-form>
<template #footer>
<el-button :disabled="formLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</div>
</template>
<script lang="ts" setup>
import { CommonStatusEnum } from '@/utils/constants'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
import * as ChannelApi from '@/api/pay/channel'
defineOptions({ name: 'WeixinChannelForm' })
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formData = ref<any>({
appId: '',
code: '',
status: undefined,
feeRate: undefined,
remark: '',
config: {
appId: '',
mchId: '',
apiVersion: '',
mchKey: '',
keyContent: '',
privateKeyContent: '',
privateCertContent: '',
apiV3Key: ''
}
})
const formRules = {
feeRate: [{ required: true, message: '请输入渠道费率', trigger: 'blur' }],
status: [{ required: true, message: '渠道状态不能为空', trigger: 'blur' }],
'config.mchId': [{ required: true, message: '请传入商户号', trigger: 'blur' }],
'config.appId': [{ required: true, message: '请输入公众号APPID', trigger: 'blur' }],
'config.apiVersion': [{ required: true, message: 'API版本不能为空', trigger: 'blur' }],
'config.mchKey': [{ required: true, message: '请输入商户密钥', trigger: 'blur' }],
'config.keyContent': [
{ required: true, message: '请上传 apiclient_cert.p12 证书', trigger: 'blur' }
],
'config.privateKeyContent': [
{ required: true, message: '请上传 apiclient_key.pem 证书', trigger: 'blur' }
],
'config.privateCertContent': [
{ required: true, message: '请上传 apiclient_cert.pem证 书', trigger: 'blur' }
],
'config.apiV3Key': [{ required: true, message: '请上传 api V3 密钥值', trigger: 'blur' }]
}
const formRef = ref() // Ref
/** 打开弹窗 */
const open = async (appId, code) => {
dialogVisible.value = true
formLoading.value = true
resetForm(appId, code)
//
try {
const data = await ChannelApi.getChannel(appId, code)
if (data && data.id) {
formData.value = data
formData.value.config = JSON.parse(data.config)
}
dialogTitle.value = !formData.value.id ? '创建支付渠道' : '编辑支付渠道'
} finally {
formLoading.value = false
}
}
defineExpose({ open }) // open
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => {
//
if (!formRef) return
const valid = await formRef.value.validate()
if (!valid) return
//
formLoading.value = true
try {
const data = { ...formData.value } as unknown as ChannelApi.ChannelVO
data.config = JSON.stringify(formData.value.config)
if (!data.id) {
await ChannelApi.createChannel(data)
message.success(t('common.createSuccess'))
} else {
await ChannelApi.updateChannel(data)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
}
}
/** 重置表单 */
const resetForm = (appId, code) => {
formData.value = {
appId: appId,
code: code,
status: CommonStatusEnum.ENABLE,
feeRate: undefined,
remark: '',
config: {
appId: '',
mchId: '',
apiVersion: '',
mchKey: '',
keyContent: '',
privateKeyContent: '',
privateCertContent: '',
apiV3Key: ''
}
}
formRef.value?.resetFields()
}
/**
* apiclient_cert.p12apiclient_cert.pemapiclient_key.pem 上传前的校验
*/
const fileBeforeUpload = (file, fileAccept) => {
let format = '.' + file.name.split('.')[1]
if (format !== fileAccept) {
debugger
message.error('请上传指定格式"' + fileAccept + '"文件')
return false
}
let isRightSize = file.size / 1024 / 1024 < 2
if (!isRightSize) {
message.error('文件大小超过 2MB')
}
return isRightSize
}
const p12FileBeforeUpload = (file) => {
fileBeforeUpload(file, '.p12')
}
const pemFileBeforeUpload = (file) => {
fileBeforeUpload(file, '.pem')
}
/**
* 读取 apiclient_key.pem privateKeyContent 字段
*/
const privateKeyContentUpload = (event) => {
const readFile = new FileReader()
readFile.onload = (e: any) => {
formData.value.config.privateKeyContent = e.target.result
}
readFile.readAsText(event.file)
}
/**
* 读取 apiclient_cert.pem privateCertContent 字段
*/
const privateCertContentUpload = (event) => {
const readFile = new FileReader()
readFile.onload = (e: any) => {
formData.value.config.privateCertContent = e.target.result
}
readFile.readAsText(event.file)
}
/**
* 读取 apiclient_cert.p12 keyContent 字段
*/
const keyContentUpload = (event) => {
const readFile = new FileReader()
readFile.onload = (e: any) => {
formData.value.config.keyContent = e.target.result.split(',')[1]
}
readFile.readAsDataURL(event.file) // base64
}
</script>

View File

@ -17,15 +17,6 @@
class="!w-240px" class="!w-240px"
/> />
</el-form-item> </el-form-item>
<el-form-item label="商户名称" prop="contactName">
<el-input
v-model="queryParams.contactName"
placeholder="请输入商户名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="开启状态" prop="status"> <el-form-item label="开启状态" prop="status">
<el-select <el-select
v-model="queryParams.status" v-model="queryParams.status"
@ -53,8 +44,8 @@
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" />搜索</el-button> <el-button @click="handleQuery"> <Icon icon="ep:search" class="mr-5px" />搜索 </el-button>
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" />重置</el-button> <el-button @click="resetQuery"> <Icon icon="ep:refresh" class="mr-5px" />重置 </el-button>
<el-button <el-button
type="primary" type="primary"
plain plain
@ -83,19 +74,21 @@
<el-table-column label="应用名" align="center" prop="name" /> <el-table-column label="应用名" align="center" prop="name" />
<el-table-column label="开启状态" align="center" prop="status"> <el-table-column label="开启状态" align="center" prop="status">
<template #default="scope"> <template #default="scope">
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" /> <el-switch
v-model="scope.row.status"
:active-value="0"
:inactive-value="1"
@change="handleStatusChange(scope.row)"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="商户名称" align="center" prop="payMerchant.name" />
<el-table-column label="支付宝配置" align="center"> <el-table-column label="支付宝配置" align="center">
<el-table-column :label="PayChannelEnum.ALIPAY_APP.name" align="center"> <el-table-column :label="PayChannelEnum.ALIPAY_APP.name" align="center">
<template #default="scope"> <template #default="scope">
<el-button <el-button
type="success" type="success"
v-if="isChannelExists(scope.row.channelCodes, PayChannelEnum.ALIPAY_APP.code)" v-if="isChannelExists(scope.row.channelCodes, PayChannelEnum.ALIPAY_APP.code)"
@click=" @click="openChannelForm(scope.row, PayChannelEnum.ALIPAY_APP.code)"
handleUpdateChannel(scope.row, PayChannelEnum.ALIPAY_APP.code, PayType.ALIPAY)
"
circle circle
> >
<Icon icon="ep:check" /> <Icon icon="ep:check" />
@ -104,9 +97,7 @@
v-else v-else
type="danger" type="danger"
circle circle
@click=" @click="openChannelForm(scope.row, PayChannelEnum.ALIPAY_APP.code)"
handleCreateChannel(scope.row, PayChannelEnum.ALIPAY_APP.code, PayType.ALIPAY)
"
> >
<Icon icon="ep:close" /> <Icon icon="ep:close" />
</el-button> </el-button>
@ -118,7 +109,7 @@
type="success" type="success"
circle circle
v-if="isChannelExists(scope.row.channelCodes, PayChannelEnum.ALIPAY_PC.code)" v-if="isChannelExists(scope.row.channelCodes, PayChannelEnum.ALIPAY_PC.code)"
@click="handleUpdateChannel(scope.row, PayChannelEnum.ALIPAY_PC.code, PayType.ALIPAY)" @click="openChannelForm(scope.row, PayChannelEnum.ALIPAY_PC.code)"
> >
<Icon icon="ep:check" /> <Icon icon="ep:check" />
</el-button> </el-button>
@ -126,7 +117,7 @@
v-else v-else
type="danger" type="danger"
circle circle
@click="handleCreateChannel(scope.row, PayChannelEnum.ALIPAY_PC.code, PayType.ALIPAY)" @click="openChannelForm(scope.row, PayChannelEnum.ALIPAY_PC.code)"
> >
<Icon icon="ep:close" /> <Icon icon="ep:close" />
</el-button> </el-button>
@ -138,9 +129,7 @@
type="success" type="success"
circle circle
v-if="isChannelExists(scope.row.channelCodes, PayChannelEnum.ALIPAY_WAP.code)" v-if="isChannelExists(scope.row.channelCodes, PayChannelEnum.ALIPAY_WAP.code)"
@click=" @click="openChannelForm(scope.row, PayChannelEnum.ALIPAY_WAP.code)"
handleUpdateChannel(scope.row, PayChannelEnum.ALIPAY_WAP.code, PayType.ALIPAY)
"
> >
<Icon icon="ep:check" /> <Icon icon="ep:check" />
</el-button> </el-button>
@ -148,9 +137,7 @@
v-else v-else
type="danger" type="danger"
circle circle
@click=" @click="openChannelForm(scope.row, PayChannelEnum.ALIPAY_WAP.code)"
handleCreateChannel(scope.row, PayChannelEnum.ALIPAY_WAP.code, PayType.ALIPAY)
"
> >
<Icon icon="ep:close" /> <Icon icon="ep:close" />
</el-button> </el-button>
@ -162,7 +149,7 @@
type="success" type="success"
circle circle
v-if="isChannelExists(scope.row.channelCodes, PayChannelEnum.ALIPAY_QR.code)" v-if="isChannelExists(scope.row.channelCodes, PayChannelEnum.ALIPAY_QR.code)"
@click="handleUpdateChannel(scope.row, PayChannelEnum.ALIPAY_QR.code, PayType.ALIPAY)" @click="openChannelForm(scope.row, PayChannelEnum.ALIPAY_QR.code)"
> >
<Icon icon="ep:check" /> <Icon icon="ep:check" />
</el-button> </el-button>
@ -170,7 +157,7 @@
v-else v-else
type="danger" type="danger"
circle circle
@click="handleCreateChannel(scope.row, PayChannelEnum.ALIPAY_QR.code, PayType.ALIPAY)" @click="openChannelForm(scope.row, PayChannelEnum.ALIPAY_QR.code)"
> >
<Icon icon="ep:close" /> <Icon icon="ep:close" />
</el-button> </el-button>
@ -182,9 +169,7 @@
type="success" type="success"
circle circle
v-if="isChannelExists(scope.row.channelCodes, PayChannelEnum.ALIPAY_BAR.code)" v-if="isChannelExists(scope.row.channelCodes, PayChannelEnum.ALIPAY_BAR.code)"
@click=" @click="openChannelForm(scope.row, PayChannelEnum.ALIPAY_BAR.code)"
handleUpdateChannel(scope.row, PayChannelEnum.ALIPAY_BAR.code, PayType.ALIPAY)
"
> >
<Icon icon="ep:check" /> <Icon icon="ep:check" />
</el-button> </el-button>
@ -192,9 +177,7 @@
v-else v-else
type="danger" type="danger"
circle circle
@click=" @click="openChannelForm(scope.row, PayChannelEnum.ALIPAY_BAR.code)"
handleCreateChannel(scope.row, PayChannelEnum.ALIPAY_BAR.code, PayType.ALIPAY)
"
> >
<Icon icon="ep:close" /> <Icon icon="ep:close" />
</el-button> </el-button>
@ -208,7 +191,7 @@
type="success" type="success"
circle circle
v-if="isChannelExists(scope.row.channelCodes, PayChannelEnum.WX_LITE.code)" v-if="isChannelExists(scope.row.channelCodes, PayChannelEnum.WX_LITE.code)"
@click="handleUpdateChannel(scope.row, PayChannelEnum.WX_LITE.code, PayType.WECHAT)" @click="openChannelForm(scope.row, PayChannelEnum.WX_LITE.code)"
> >
<Icon icon="ep:check" /> <Icon icon="ep:check" />
</el-button> </el-button>
@ -216,7 +199,7 @@
v-else v-else
type="danger" type="danger"
circle circle
@click="handleCreateChannel(scope.row, PayChannelEnum.WX_LITE.code, PayType.WECHAT)" @click="openChannelForm(scope.row, PayChannelEnum.WX_LITE.code)"
> >
<Icon icon="ep:close" /> <Icon icon="ep:close" />
</el-button> </el-button>
@ -228,7 +211,7 @@
type="success" type="success"
circle circle
v-if="isChannelExists(scope.row.channelCodes, PayChannelEnum.WX_PUB.code)" v-if="isChannelExists(scope.row.channelCodes, PayChannelEnum.WX_PUB.code)"
@click="handleUpdateChannel(scope.row, PayChannelEnum.WX_PUB.code, PayType.WECHAT)" @click="openChannelForm(scope.row, PayChannelEnum.WX_PUB.code)"
> >
<Icon icon="ep:check" /> <Icon icon="ep:check" />
</el-button> </el-button>
@ -236,7 +219,7 @@
v-else v-else
type="danger" type="danger"
circle circle
@click="handleCreateChannel(scope.row, PayChannelEnum.WX_PUB.code, PayType.WECHAT)" @click="openChannelForm(scope.row, PayChannelEnum.WX_PUB.code)"
> >
<Icon icon="ep:close" /> <Icon icon="ep:close" />
</el-button> </el-button>
@ -248,7 +231,7 @@
type="success" type="success"
circle circle
v-if="isChannelExists(scope.row.channelCodes, PayChannelEnum.WX_APP.code)" v-if="isChannelExists(scope.row.channelCodes, PayChannelEnum.WX_APP.code)"
@click="handleUpdateChannel(scope.row, PayChannelEnum.WX_APP.code, PayType.WECHAT)" @click="openChannelForm(scope.row, PayChannelEnum.WX_APP.code)"
> >
<Icon icon="ep:check" /> <Icon icon="ep:check" />
</el-button> </el-button>
@ -256,20 +239,35 @@
v-else v-else
type="danger" type="danger"
circle circle
@click="handleCreateChannel(scope.row, PayChannelEnum.WX_APP.code, PayType.WECHAT)" @click="openChannelForm(scope.row, PayChannelEnum.WX_APP.code)"
>
<Icon icon="ep:close" />
</el-button>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="模拟支付配置" align="center">
<el-table-column :label="PayChannelEnum.MOCK.name" align="center">
<template #default="scope">
<el-button
type="success"
circle
v-if="isChannelExists(scope.row.channelCodes, PayChannelEnum.MOCK)"
@click="openChannelForm(scope.row, PayChannelEnum.MOCK.code)"
>
<Icon icon="ep:check" />
</el-button>
<el-button
v-else
type="danger"
circle
@click="openChannelForm(scope.row, PayChannelEnum.MOCK.code)"
> >
<Icon icon="ep:close" /> <Icon icon="ep:close" />
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column
label="创建时间"
align="center"
prop="createTime"
width="180"
:formatter="dateFormatter"
/>
<el-table-column label="操作" align="center" min-width="110" fixed="right"> <el-table-column label="操作" align="center" min-width="110" fixed="right">
<template #default="scope"> <template #default="scope">
<el-button <el-button
@ -302,14 +300,20 @@
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<AppForm ref="formRef" @success="getList" /> <AppForm ref="formRef" @success="getList" />
<AlipayChannelForm ref="alipayFormRef" @success="getList" />
<WeixinChannelForm ref="weixinFormRef" @success="getList" />
<MockChannelForm ref="mockFormRef" @success="getList" />
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download' import download from '@/utils/download'
import * as AppApi from '@/api/pay/app' import * as AppApi from '@/api/pay/app'
import AppForm from '@/views/pay/app/AppForm.vue' import AppForm from './components/AppForm.vue'
import { PayChannelEnum, PayType } from '@/utils/constants' import { PayChannelEnum, PayType } from '@/utils/constants'
import AlipayChannelForm from './components/channel/AlipayChannelForm.vue'
import WeixinChannelForm from './components/channel/WeixinChannelForm.vue'
import MockChannelForm from './components/channel/MockChannelForm.vue'
import { CommonStatusEnum } from '@/utils/constants'
defineOptions({ name: 'PayApp' }) defineOptions({ name: 'PayApp' })
@ -327,24 +331,10 @@ const queryParams = reactive({
remark: undefined, remark: undefined,
payNotifyUrl: undefined, payNotifyUrl: undefined,
refundNotifyUrl: undefined, refundNotifyUrl: undefined,
merchantName: undefined,
createTime: [] createTime: []
}) })
const queryFormRef = ref() // const queryFormRef = ref() //
const exportLoading = ref(false) // const exportLoading = ref(false) //
const channelParam = reactive({
loading: false,
edit: false, //
wechatOpen: false, //
aliPayOpen: false, //
appId: null, // ID
payCode: null, //
//
payMerchant: {
id: null, //
name: null //
}
}) //
/** 查询列表 */ /** 查询列表 */
const getList = async () => { const getList = async () => {
@ -370,6 +360,19 @@ const resetQuery = () => {
handleQuery() handleQuery()
} }
/** 应用状态修改 */
const handleStatusChange = async (row: any) => {
let text = row.status === CommonStatusEnum.ENABLE ? '启用' : '停用'
try {
await message.confirm('确认要"' + text + '""' + row.name + '"应用吗?')
await AppApi.changeAppStatus({ id: row.id, status: row.status })
message.success(text + '成功')
} catch {
row.status =
row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.DISABLE : CommonStatusEnum.ENABLE
}
}
/** 添加/修改操作 */ /** 添加/修改操作 */
const formRef = ref() const formRef = ref()
const openForm = (type: string, id?: number) => { const openForm = (type: string, id?: number) => {
@ -398,7 +401,6 @@ const handleExport = async () => {
exportLoading.value = true exportLoading.value = true
const data = await AppApi.exportApp(queryParams) const data = await AppApi.exportApp(queryParams)
download.excel(data, '支付应用信息.xls') download.excel(data, '支付应用信息.xls')
} catch {
} finally { } finally {
exportLoading.value = false exportLoading.value = false
} }
@ -417,46 +419,30 @@ const isChannelExists = (channels, channelCode) => {
return channels.indexOf(channelCode) !== -1 return channels.indexOf(channelCode) !== -1
} }
// TODO @handleUpdateChannel handleCreateChannel openChannelForm
/**
* 修改支付渠道信息
*
* @param row 行记录
* @param payCode 支付编码
* @param type 支付类型
*/
const handleUpdateChannel = async (row, payCode, type) => {
// TODO @
message.alert('待实现')
await settingChannelParam(row, payCode, type)
channelParam.edit = true
channelParam.loading = true
}
/** /**
* 新增支付渠道信息 * 新增支付渠道信息
*/ */
const handleCreateChannel = async (row, payCode, type) => { const alipayFormRef = ref()
message.alert('待实现') const weixinFormRef = ref()
await settingChannelParam(row, payCode, type) const mockFormRef = ref()
channelParam.edit = false const channelParam = reactive({
channelParam.loading = false appId: null, // ID
} payCode: null //
})
const settingChannelParam = async (row, payCode, type) => { const openChannelForm = async (row, payCode) => {
if (type === PayType.WECHAT) {
channelParam.wechatOpen = true
channelParam.aliPayOpen = false
}
if (type === PayType.ALIPAY) {
channelParam.aliPayOpen = true
channelParam.wechatOpen = false
}
channelParam.edit = false
channelParam.loading = false
channelParam.appId = row.id channelParam.appId = row.id
channelParam.payCode = payCode channelParam.payCode = payCode
channelParam.payMerchant = row.payMerchant if (payCode.indexOf('alipay_') === 0) {
alipayFormRef.value.open(row.id, payCode)
return
}
if (payCode.indexOf('wx_') === 0) {
weixinFormRef.value.open(row.id, payCode)
return
}
if (payCode.indexOf('mock') === 0) {
mockFormRef.value.open(row.id, payCode)
}
} }
/** 初始化 **/ /** 初始化 **/

View File

@ -325,7 +325,7 @@ const openDetail = (id: number) => {
onMounted(async () => { onMounted(async () => {
await getList() await getList()
// //
merchantList.value = await MerchantApi.getMerchantListByName() // merchantList.value = await MerchantApi.getMerchantListByName()
// App // App
// TODO // TODO
// appList.value = await AppApi.getAppListByMerchantId() // appList.value = await AppApi.getAppListByMerchantId()
@ -333,7 +333,7 @@ onMounted(async () => {
</script> </script>
<style> <style>
.order-font { .order-font {
font-size: 12px;
padding: 2px 0; padding: 2px 0;
font-size: 12px;
} }
</style> </style>

View File

@ -338,7 +338,7 @@ onMounted(async () => {
<style> <style>
.order-font { .order-font {
font-size: 12px;
padding: 2px 0; padding: 2px 0;
font-size: 12px;
} }
</style> </style>

View File

@ -1,42 +1,43 @@
module.exports = { module.exports = {
root: true, root: true,
plugins: ['stylelint-order'], plugins: ['stylelint-order'],
extends: ['stylelint-config-standard'],
customSyntax: 'postcss-html', customSyntax: 'postcss-html',
extends: ['stylelint-config-standard'],
rules: { rules: {
'function-no-unknown': null,
'selector-class-pattern': null,
'selector-pseudo-class-no-unknown': [ 'selector-pseudo-class-no-unknown': [
true, true,
{ {
ignorePseudoClasses: ['global'] ignorePseudoClasses: ['global', 'deep']
}
],
'selector-pseudo-element-no-unknown': [
true,
{
ignorePseudoElements: ['v-deep']
} }
], ],
'at-rule-no-unknown': [ 'at-rule-no-unknown': [
true, true,
{ {
ignoreAtRules: ['tailwind', 'apply', 'variants', 'responsive', 'screen', 'function', 'if', 'each', 'include', 'mixin'] ignoreAtRules: ['function', 'if', 'each', 'include', 'mixin']
} }
], ],
// 命名规范
"selector-class-pattern": null,
'no-empty-source': null, 'no-empty-source': null,
'import-notation': null,
'named-grid-areas-no-invalid': null, 'named-grid-areas-no-invalid': null,
'unicode-bom': 'never',
'no-descending-specificity': null, 'no-descending-specificity': null,
'font-family-no-missing-generic-family-keyword': null, 'font-family-no-missing-generic-family-keyword': null,
// 'declaration-block-trailing-semicolon': 'always', 'declaration-colon-space-after': 'always-single-line',
'declaration-colon-space-before': 'never',
'declaration-block-trailing-semicolon': null,
'rule-empty-line-before': [ 'rule-empty-line-before': [
'always', 'always',
{ {
ignore: ['after-comment', 'first-nested'] ignore: ['after-comment', 'first-nested']
} }
], ],
'unit-no-unknown': [true, { ignoreUnits: ['rpx'] }], 'unit-no-unknown': [
true,
{
ignoreUnits: ['rpx']
}
],
'order/order': [ 'order/order': [
[ [
'dollar-variables', 'dollar-variables',
@ -53,14 +54,165 @@ module.exports = {
}, },
'rules' 'rules'
], ],
{ severity: 'warning' } {
severity: 'warning'
}
],
// Specify the alphabetical order of the attributes in the declaration block
'order/properties-order': [
'position',
'top',
'right',
'bottom',
'left',
'z-index',
'display',
'float',
'width',
'height',
'max-width',
'max-height',
'min-width',
'min-height',
'padding',
'padding-top',
'padding-right',
'padding-bottom',
'padding-left',
'margin',
'margin-top',
'margin-right',
'margin-bottom',
'margin-left',
'margin-collapse',
'margin-top-collapse',
'margin-right-collapse',
'margin-bottom-collapse',
'margin-left-collapse',
'overflow',
'overflow-x',
'overflow-y',
'clip',
'clear',
'font',
'font-family',
'font-size',
'font-smoothing',
'osx-font-smoothing',
'font-style',
'font-weight',
'hyphens',
'src',
'line-height',
'letter-spacing',
'word-spacing',
'color',
'text-align',
'text-decoration',
'text-indent',
'text-overflow',
'text-rendering',
'text-size-adjust',
'text-shadow',
'text-transform',
'word-break',
'word-wrap',
'white-space',
'vertical-align',
'list-style',
'list-style-type',
'list-style-position',
'list-style-image',
'pointer-events',
'cursor',
'background',
'background-attachment',
'background-color',
'background-image',
'background-position',
'background-repeat',
'background-size',
'border',
'border-collapse',
'border-top',
'border-right',
'border-bottom',
'border-left',
'border-color',
'border-image',
'border-top-color',
'border-right-color',
'border-bottom-color',
'border-left-color',
'border-spacing',
'border-style',
'border-top-style',
'border-right-style',
'border-bottom-style',
'border-left-style',
'border-width',
'border-top-width',
'border-right-width',
'border-bottom-width',
'border-left-width',
'border-radius',
'border-top-right-radius',
'border-bottom-right-radius',
'border-bottom-left-radius',
'border-top-left-radius',
'border-radius-topright',
'border-radius-bottomright',
'border-radius-bottomleft',
'border-radius-topleft',
'content',
'quotes',
'outline',
'outline-offset',
'opacity',
'filter',
'visibility',
'size',
'zoom',
'transform',
'box-align',
'box-flex',
'box-orient',
'box-pack',
'box-shadow',
'box-sizing',
'table-layout',
'animation',
'animation-delay',
'animation-duration',
'animation-iteration-count',
'animation-name',
'animation-play-state',
'animation-timing-function',
'animation-fill-mode',
'transition',
'transition-delay',
'transition-duration',
'transition-property',
'transition-timing-function',
'background-clip',
'backface-visibility',
'resize',
'appearance',
'user-select',
'interpolation-mode',
'direction',
'marks',
'page',
'set-link-source',
'unicode-bidi',
'speak'
] ]
}, },
ignoreFiles: ['**/*.js', '**/*.jsx', '**/*.tsx', '**/*.ts'], ignoreFiles: ['**/*.js', '**/*.jsx', '**/*.tsx', '**/*.ts'],
overrides: [ overrides: [
{ {
files: ['*.vue', '**/*.vue', '*.html', '**/*.html'], files: ['*.vue', '**/*.vue', '*.html', '**/*.html'],
extends: ['stylelint-config-recommended'], extends: ['stylelint-config-recommended', 'stylelint-config-html'],
rules: { rules: {
'keyframes-name-pattern': null, 'keyframes-name-pattern': null,
'selector-pseudo-class-no-unknown': [ 'selector-pseudo-class-no-unknown': [
@ -76,11 +228,6 @@ module.exports = {
} }
] ]
} }
},
{
files: ['*.less', '**/*.less'],
customSyntax: 'postcss-less',
extends: ['stylelint-config-standard', 'stylelint-config-recommended-vue']
} }
] ]
} }