hookehuyr

✨ feat(测试表单渲染结构和保存表单数据):

......@@ -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端地址
......
......@@ -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/
......
......@@ -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 {
......
/*
* @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));
/*
* @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));
/*
* @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 轮播区
......
......@@ -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: 'customize',
f: 'custom_form',
};
/**
......
This diff is collapsed. Click to expand it.
......@@ -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: [''], // 在解析包的 情景导出 时允许的附加条件。
......