Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
data-table
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
hookehuyr
2022-11-17 14:11:05 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
daf28ce181b8a2b0da75d203b8274fac653367dc
daf28ce1
1 parent
a9e5fa18
✨ feat(测试表单渲染结构和保存表单数据):
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
67 additions
and
25 deletions
.env.development
.env.production
src/App.vue
src/api/data.js
src/api/form.js
src/api/index.js
src/utils/axios.js
src/views/index.vue
vite.config.js
.env.development
View file @
daf28ce
...
...
@@ -14,7 +14,7 @@ VITE_ID = 13761653761
VITE_PIN =
# 反向代理服务器地址
#
VITE_PROXY_TARGET = http://oa-dev.onwall.cn
VITE_PROXY_TARGET = http://oa-dev.onwall.cn
# VITE_PROXY_TARGET = http://guanzong.onwall.cn
# PC端地址
...
...
.env.production
View file @
daf28ce
...
...
@@ -11,7 +11,7 @@ VITE_APP_ID =
VITE_APP_PIN =
# 反向代理服务器地址
# VITE_PROXY_TARGET = http://guanzong
.onwall.cn
VITE_PROXY_TARGET = http://oa
.onwall.cn
# PC端地址
# VITE_MOBILE_URL = http://oa.onwall.cn/f/guanzong/web/
...
...
src/App.vue
View file @
daf28ce
...
...
@@ -2,7 +2,7 @@
* @Author: hookehuyr hookehuyr@gmail.com
* @Date: 2022-05-26 23:52:36
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-
09-06 16:24:19
* @LastEditTime: 2022-
11-17 13:34:07
* @FilePath: /data-table/src/App.vue
* @Description:
-->
...
...
@@ -16,37 +16,39 @@
</template>
<script setup>
import { mainStore, useTitle } from
'@/utils/generatePackage'
import { computed, watchEffect, onMounted } from
'vue'
;
import { useRoute, useRouter } from
'vue-router'
import { Toast } from
'vant'
;
import { mainStore, useTitle } from
"@/utils/generatePackage";
import { computed, watchEffect, onMounted } from
"vue"
;
import { useRoute, useRouter } from
"vue-router";
import { Toast } from
"vant"
;
// 会根据配置判断是否显示调试控件
// eslint-disable-next-line no-unused-vars
import vConsole from
'@/utils/vconsole'
import vConsole from
"@/utils/vconsole";
// 初始化WX环境
// import wx from 'weixin-js-sdk'
// import { wxJsAPI } from '@/api/wx/config'
// import { apiList } from '@/api/wx/jsApiList.js'
import { wxInfo } from
'@/utils/tools'
import { wxInfo } from
"@/utils/tools";
// 使用 include + pinia 状态管理动态缓存页面
const store = mainStore()
const keepPages = computed(() => store.getKeepPages)
const store = mainStore()
;
const keepPages = computed(() => store.getKeepPages)
;
// // TAG: 全局设置页面标题
// const $route = useRoute();
watchEffect(
() => useTitle('表单标题')
)
watchEffect(() => useTitle("表单标题"));
// 监听路由变化
// 切换路由页面返回顶部
const $router = useRouter();
watch(() => $router.currentRoute.value, (newValue, oldValue) => {
watch(
() => $router.currentRoute.value,
(newValue, oldValue) => {
nextTick(() => {
// document.getElementById('app')?.scrollIntoView();
})
});
// console.warn(wxInfo().isMobile);
}, { immediate: true })
},
{ immediate: true }
);
// TAG: 全局配置Toast
// Toast.setDefaultOptions({
...
...
@@ -55,7 +57,7 @@ watch(() => $router.currentRoute.value, (newValue, oldValue) => {
// });
// web端判断
const is_pc = computed(() => wxInfo().isPC)
const is_pc = computed(() => wxInfo().isPC)
;
onMounted(async () => {
// const { data } = await wxJsAPI();
...
...
@@ -67,18 +69,20 @@ onMounted(async () => {
// wx.error((err) => {
// console.warn(err);
// });
})
})
;
</script>
<style lang="less">
@prefix: ~
'@{namespace}-x'
;
@prefix: ~
"@{namespace}-x"
;
html,
body {
width: 100%;
height: 100%;
color: @base-font-color;
background-color: #F7F8FA;
background-color: #f7f8fa;
padding: 0;
margin: 0;
}
body {
...
...
src/api/data.js
0 → 100644
View file @
daf28ce
/*
* @Date: 2022-06-17 14:54:29
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-11-17 13:49:35
* @FilePath: /data-table/src/api/data.js
* @Description: 表单数据接口
*/
import
{
fn
,
fetch
}
from
'@/api/fn'
;
const
Api
=
{
ADD_FORM_DATA
:
'/srv/?a=add_formdata'
,
}
/**
* @description: 添加表单数据
* @param: form_code 表单唯一标识
* @param: data 待添加的数据,json对象结构;键值对记录变更的字段和值;
*/
export
const
addFormDataAPI
=
(
params
)
=>
fn
(
fetch
.
post
(
Api
.
ADD_FORM_DATA
,
params
));
src/api/form.js
0 → 100644
View file @
daf28ce
/*
* @Date: 2022-06-17 14:54:29
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-11-17 10:41:39
* @FilePath: /data-table/src/api/form.js
* @Description: 表单接口
*/
import
{
fn
,
fetch
}
from
'@/api/fn'
;
const
Api
=
{
FORM_QUERY
:
'/srv/?a=query_form'
,
}
/**
* @description: 查询表单
* @param: client_id 主体客户id
* @param: form_code 表单唯一标识
* @param: name 表单名称,模糊查询
*/
export
const
queryFormAPI
=
(
params
)
=>
fn
(
fetch
.
get
(
Api
.
FORM_QUERY
,
params
));
src/api/index.js
View file @
daf28ce
/*
* @Date: 2022-06-17 14:54:29
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-
08-29 13:58:16
* @LastEditTime: 2022-
11-17 13:46:01
* @FilePath: /data-table/src/api/index.js
* @Description: 首页接口
*/
...
...
@@ -9,7 +9,7 @@ import { fn, fetch } from '@/api/fn';
const
Api
=
{
INDEX
:
'/srv/?a=home_page'
,
}
/**
* @description: 首页接口
* @returns HOMEBANNER 轮播区
...
...
src/utils/axios.js
View file @
daf28ce
...
...
@@ -2,7 +2,7 @@
* @Author: hookehuyr hookehuyr@gmail.com
* @Date: 2022-05-28 10:17:40
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-
09-06 18:01:36
* @LastEditTime: 2022-
11-17 10:17:01
* @FilePath: /data-table/src/utils/axios.js
* @Description:
*/
...
...
@@ -13,7 +13,7 @@ import { strExist } from '@/utils/tools'
// import { parseQueryString } from '@/utils/tools'
axios
.
defaults
.
params
=
{
f
:
'custom
ize
'
,
f
:
'custom
_form
'
,
};
/**
...
...
src/views/index.vue
View file @
daf28ce
This diff is collapsed. Click to expand it.
vite.config.js
View file @
daf28ce
...
...
@@ -62,6 +62,7 @@ export default ({ command, mode }) => {
"@css"
:
path
.
resolve
(
__dirname
,
"src/assets/css"
),
"@mock"
:
path
.
resolve
(
__dirname
,
"src/assets/mock"
),
"common"
:
path
.
resolve
(
__dirname
,
"src/common"
),
"@api"
:
path
.
resolve
(
__dirname
,
"src/api"
),
},
// dedupe: [''], // 如果你在你的应用程序中有相同依赖的副本(比如 monorepos),使用这个选项来强制 Vite 总是将列出的依赖关系解析到相同的副本(从项目根目录)。
// conditions: [''], // 在解析包的 情景导出 时允许的附加条件。
...
...
Please
register
or
login
to post a comment