Commit 14e90b9d authored by 王纵's avatar 王纵

组件部分兼容vue3修改

parent 565b1d5f
......@@ -5,7 +5,7 @@ const ExtractTextPlugin = require('extract-text-webpack-plugin')
const pkg = require('../package.json')
const myTheme = path.resolve(__dirname, "../src/global.less");
const myTheme = path.resolve(__dirname, "../src/Dynamic/vars.less");
console.log('__dirname', __dirname, myTheme)
......
......@@ -9,7 +9,6 @@ function resolve (dir) {
return path.join(__dirname, '..', dir)
}
const myTheme = path.resolve(__dirname, "./src/global.less");
let webpackConfig = {
context: path.resolve(__dirname, '../'),
......
......@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com
* @Date: 2024-08-01 09:55:12
* @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-14 17:40:37
* @LastEditTime: 2024-08-16 15:27:59
* @Version: 1.0.0
* @Description: 动态渲染-超链接组件
* @Copyright: Copyright (c) 2021, Hand-RongJing
......@@ -10,7 +10,7 @@
<template>
<van-cell center class="d-form-item d-url" :required="required">
<d-label :label="label" :help="help" slot="title" />
<d-custom-render
<d-custom-render
:getData="getCurrentRecord"
:renderer="renderer"
:fieldConfig="fieldConfig"
......@@ -19,12 +19,11 @@
<img src="../../../assets/url-icon.png" alt="" class="right-icon" />
<a>{{value}}</a>
</div>
</d-custom-render>
</d-custom-render>
<!-- <fragment v-else>
<img src="../../../assets/url-icon.png" alt="" class="right-icon" />
<a>{{value}}</a>
</fragment> -->
</div>
</van-cell>
</template>
......
......@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com
* @Date: 2024-07-29 10:51:56
* @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-16 10:13:35
* @LastEditTime: 2024-08-16 15:15:24
* @Version: 1.0.0
* @Description: 查询表单渲染
* @Copyright: Copyright (c) 2021, Hand-RongJing
......@@ -45,7 +45,7 @@
import { Search, Icon, Popup, Button } from 'vant';
import DForm from '../DForm';
import EventBus from '../../utils/eventBus';
import { isNull, isUndefined } from '../../../../packages';
import { isNull, isUndefined } from 'lodash';
export default {
name: 'QueryForm',
......
<!--
* @Author: zong.wang01@hand-china.com
* @Date: 2024-08-16 14:40:38
* @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-16 14:43:54
* @Version: 1.0.0
* @Description:
* @Copyright: Copyright (c) 2021, Hand-RongJing
-->
# 低代码组件说明
### 需要添加的依赖
"less-loader": "5.0.0",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.2",
"babel-plugin-transform-vue-jsx": "^3.7.0",
"babel-preset-vue": "^2.0.2",
"better-scroll": "1.15.1",
"lodash": "^4.17.21",
"vant": "^2.13.2",
"vue": "^2.5.2",
"vue-fragment": "^1.6.0",
### .babelrc
"plugins": ["transform-runtime", "transform-vue-jsx"]
\ No newline at end of file
......@@ -2,19 +2,21 @@
* @Author: zong.wang01@hand-china.com
* @Date: 2024-07-29 16:36:23
* @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-10 00:00:58
* @LastEditTime: 2024-08-16 15:50:20
* @Version: 1.0.0
* @Description:
* @Copyright: Copyright (c) 2021, Hand-RongJing
*/
// 引入axios
import axios from 'axios'
import {hlsPopup} from '../../../packages/index'
import { Toast } from 'vant';
import qs from 'qs'
let promiseArr = {}
let cancel = {}
const CancelToken = axios.CancelToken
const baseUrl = process.env.apiPath
const withTokenAxios = axios.create({
transformResponse(data) {
// 对 data 进行任意转换处理
......@@ -59,10 +61,10 @@ withTokenAxios.interceptors.response.use(response => {
return null;
}
if (data && data.failed) {
hlsPopup.hideLoading()
// hlsPopup.hideLoading()
const err = {}
err.message = response.data.message
hlsPopup.showError(err.message)
Toast.fail(err.message)
throw err;
} else {
return response.data;
......@@ -113,16 +115,18 @@ withTokenAxios.interceptors.response.use(response => {
err.message = '连接到服务器失败'
}
if (err.response && err.response.status === 401) {
hlsPopup.hideLoading()
hlsPopup.showPopup({
title: '登录失效,重新登录',
onConfirm: () => {
Toast.fail(err.message)
// hlsPopup.hideLoading()
// hlsPopup.showPopup({
// title: '登录失效,重新登录',
// onConfirm: () => {
},
})
// },
// })
} else {
hlsPopup.hideLoading()
hlsPopup.showError(err.message + '<br/>' + (err.response.data ? err.response.data.message : ''))
// hlsPopup.hideLoading()
Toast.fail(err.message + '<br/>' + (err.response.data ? err.response.data.message : ''))
// hlsPopup.showError(err.message + '<br/>' + (err.response.data ? err.response.data.message : ''))
}
throw err;
})
......@@ -152,7 +156,7 @@ export function get (url, param = {}) {
return new Promise((resolve, reject) => {
withTokenAxios({
method: 'get',
url: process.env.apiPath + url,
url: baseUrl + url,
headers: headers,
params: param,
}).then(res => {
......@@ -188,7 +192,7 @@ export function post (url, param = {}) {
withTokenAxios({
method: 'post',
headers: headers,
url: process.env.apiPath + url,
url: baseUrl + url,
data: param,
}).then(res => {
resolve(res)
......@@ -218,7 +222,7 @@ export function put (url, param = {}, queryParams = {}) {
withTokenAxios({
method: 'put',
headers: headers,
url: process.env.apiPath + url,
url: baseUrl + url,
data: param,
params: queryParams
}).then(res => {
......@@ -249,7 +253,7 @@ export function deletes (url, param = {}, queryParams = {}) {
withTokenAxios({
method: 'delete',
headers: headers,
url: process.env.apiPath + url,
url: baseUrl + url,
data: param,
params: queryParams
}).then(res => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment