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

组件部分兼容vue3修改

parent 565b1d5f
...@@ -5,7 +5,7 @@ const ExtractTextPlugin = require('extract-text-webpack-plugin') ...@@ -5,7 +5,7 @@ const ExtractTextPlugin = require('extract-text-webpack-plugin')
const pkg = require('../package.json') 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) console.log('__dirname', __dirname, myTheme)
......
...@@ -9,7 +9,6 @@ function resolve (dir) { ...@@ -9,7 +9,6 @@ function resolve (dir) {
return path.join(__dirname, '..', dir) return path.join(__dirname, '..', dir)
} }
const myTheme = path.resolve(__dirname, "./src/global.less");
let webpackConfig = { let webpackConfig = {
context: path.resolve(__dirname, '../'), context: path.resolve(__dirname, '../'),
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com * @Author: zong.wang01@hand-china.com
* @Date: 2024-08-01 09:55:12 * @Date: 2024-08-01 09:55:12
* @LastEditors: zong.wang01@hand-china.com * @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-14 17:40:37 * @LastEditTime: 2024-08-16 15:27:59
* @Version: 1.0.0 * @Version: 1.0.0
* @Description: 动态渲染-超链接组件 * @Description: 动态渲染-超链接组件
* @Copyright: Copyright (c) 2021, Hand-RongJing * @Copyright: Copyright (c) 2021, Hand-RongJing
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<template> <template>
<van-cell center class="d-form-item d-url" :required="required"> <van-cell center class="d-form-item d-url" :required="required">
<d-label :label="label" :help="help" slot="title" /> <d-label :label="label" :help="help" slot="title" />
<d-custom-render <d-custom-render
:getData="getCurrentRecord" :getData="getCurrentRecord"
:renderer="renderer" :renderer="renderer"
:fieldConfig="fieldConfig" :fieldConfig="fieldConfig"
...@@ -19,12 +19,11 @@ ...@@ -19,12 +19,11 @@
<img src="../../../assets/url-icon.png" alt="" class="right-icon" /> <img src="../../../assets/url-icon.png" alt="" class="right-icon" />
<a>{{value}}</a> <a>{{value}}</a>
</div> </div>
</d-custom-render> </d-custom-render>
<!-- <fragment v-else> <!-- <fragment v-else>
<img src="../../../assets/url-icon.png" alt="" class="right-icon" /> <img src="../../../assets/url-icon.png" alt="" class="right-icon" />
<a>{{value}}</a> <a>{{value}}</a>
</fragment> --> </fragment> -->
</div>
</van-cell> </van-cell>
</template> </template>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com * @Author: zong.wang01@hand-china.com
* @Date: 2024-07-29 10:51:56 * @Date: 2024-07-29 10:51:56
* @LastEditors: zong.wang01@hand-china.com * @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-16 10:13:35 * @LastEditTime: 2024-08-16 15:15:24
* @Version: 1.0.0 * @Version: 1.0.0
* @Description: 查询表单渲染 * @Description: 查询表单渲染
* @Copyright: Copyright (c) 2021, Hand-RongJing * @Copyright: Copyright (c) 2021, Hand-RongJing
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
import { Search, Icon, Popup, Button } from 'vant'; import { Search, Icon, Popup, Button } from 'vant';
import DForm from '../DForm'; import DForm from '../DForm';
import EventBus from '../../utils/eventBus'; import EventBus from '../../utils/eventBus';
import { isNull, isUndefined } from '../../../../packages'; import { isNull, isUndefined } from 'lodash';
export default { export default {
name: 'QueryForm', 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 @@ ...@@ -2,19 +2,21 @@
* @Author: zong.wang01@hand-china.com * @Author: zong.wang01@hand-china.com
* @Date: 2024-07-29 16:36:23 * @Date: 2024-07-29 16:36:23
* @LastEditors: zong.wang01@hand-china.com * @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-10 00:00:58 * @LastEditTime: 2024-08-16 15:50:20
* @Version: 1.0.0 * @Version: 1.0.0
* @Description: * @Description:
* @Copyright: Copyright (c) 2021, Hand-RongJing * @Copyright: Copyright (c) 2021, Hand-RongJing
*/ */
// 引入axios // 引入axios
import axios from 'axios' import axios from 'axios'
import {hlsPopup} from '../../../packages/index' import { Toast } from 'vant';
import qs from 'qs' import qs from 'qs'
let promiseArr = {} let promiseArr = {}
let cancel = {} let cancel = {}
const CancelToken = axios.CancelToken const CancelToken = axios.CancelToken
const baseUrl = process.env.apiPath
const withTokenAxios = axios.create({ const withTokenAxios = axios.create({
transformResponse(data) { transformResponse(data) {
// 对 data 进行任意转换处理 // 对 data 进行任意转换处理
...@@ -59,10 +61,10 @@ withTokenAxios.interceptors.response.use(response => { ...@@ -59,10 +61,10 @@ withTokenAxios.interceptors.response.use(response => {
return null; return null;
} }
if (data && data.failed) { if (data && data.failed) {
hlsPopup.hideLoading() // hlsPopup.hideLoading()
const err = {} const err = {}
err.message = response.data.message err.message = response.data.message
hlsPopup.showError(err.message) Toast.fail(err.message)
throw err; throw err;
} else { } else {
return response.data; return response.data;
...@@ -113,16 +115,18 @@ withTokenAxios.interceptors.response.use(response => { ...@@ -113,16 +115,18 @@ withTokenAxios.interceptors.response.use(response => {
err.message = '连接到服务器失败' err.message = '连接到服务器失败'
} }
if (err.response && err.response.status === 401) { if (err.response && err.response.status === 401) {
hlsPopup.hideLoading() Toast.fail(err.message)
hlsPopup.showPopup({ // hlsPopup.hideLoading()
title: '登录失效,重新登录', // hlsPopup.showPopup({
onConfirm: () => { // title: '登录失效,重新登录',
// onConfirm: () => {
}, // },
}) // })
} else { } else {
hlsPopup.hideLoading() // hlsPopup.hideLoading()
hlsPopup.showError(err.message + '<br/>' + (err.response.data ? err.response.data.message : '')) 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; throw err;
}) })
...@@ -152,7 +156,7 @@ export function get (url, param = {}) { ...@@ -152,7 +156,7 @@ export function get (url, param = {}) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
withTokenAxios({ withTokenAxios({
method: 'get', method: 'get',
url: process.env.apiPath + url, url: baseUrl + url,
headers: headers, headers: headers,
params: param, params: param,
}).then(res => { }).then(res => {
...@@ -188,7 +192,7 @@ export function post (url, param = {}) { ...@@ -188,7 +192,7 @@ export function post (url, param = {}) {
withTokenAxios({ withTokenAxios({
method: 'post', method: 'post',
headers: headers, headers: headers,
url: process.env.apiPath + url, url: baseUrl + url,
data: param, data: param,
}).then(res => { }).then(res => {
resolve(res) resolve(res)
...@@ -218,7 +222,7 @@ export function put (url, param = {}, queryParams = {}) { ...@@ -218,7 +222,7 @@ export function put (url, param = {}, queryParams = {}) {
withTokenAxios({ withTokenAxios({
method: 'put', method: 'put',
headers: headers, headers: headers,
url: process.env.apiPath + url, url: baseUrl + url,
data: param, data: param,
params: queryParams params: queryParams
}).then(res => { }).then(res => {
...@@ -249,7 +253,7 @@ export function deletes (url, param = {}, queryParams = {}) { ...@@ -249,7 +253,7 @@ export function deletes (url, param = {}, queryParams = {}) {
withTokenAxios({ withTokenAxios({
method: 'delete', method: 'delete',
headers: headers, headers: headers,
url: process.env.apiPath + url, url: baseUrl + url,
data: param, data: param,
params: queryParams params: queryParams
}).then(res => { }).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