Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
custom_form
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
2023-04-04 18:11:43 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
41fab86c096ddc9222f540b6fa68dfaf1afebc33
41fab86c
1 parent
0b295892
✨ feat: 表格页直接进入,需要再进入首页一次
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
15 deletions
components.d.ts
src/pages/table/index.vue
src/stores/index.js
components.d.ts
View file @
41fab86
...
...
@@ -31,7 +31,6 @@ declare module '@vue/runtime-core' {
NutCheckboxGroup
:
typeof
import
(
'@nutui/nutui-taro'
)[
'CheckboxGroup'
]
NutConfigProvider
:
typeof
import
(
'@nutui/nutui-taro'
)[
'ConfigProvider'
]
NutDialog
:
typeof
import
(
'@nutui/nutui-taro'
)[
'Dialog'
]
NutField
:
typeof
import
(
'@nutui/nutui-taro'
)[
'Field'
]
NutForm
:
typeof
import
(
'@nutui/nutui-taro'
)[
'Form'
]
NutFormItem
:
typeof
import
(
'@nutui/nutui-taro'
)[
'FormItem'
]
NutInput
:
typeof
import
(
'@nutui/nutui-taro'
)[
'Input'
]
...
...
src/pages/table/index.vue
View file @
41fab86
<!--
* @Date: 2023-03-24 09:19:27
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-04-04 1
5:55:41
* @LastEditTime: 2023-04-04 1
8:09:30
* @FilePath: /custom_form/src/pages/table/index.vue
* @Description: 文件描述
-->
...
...
@@ -73,7 +73,7 @@ const ruleForm = ref(null);
// // 获取表单设置
const store = mainStore();
const { formSetting, formInfo } = storeToRefs(store);
const { formSetting, formInfo
, callIndex
} = storeToRefs(store);
// web端判断封面图片高度
const is_pc = computed(() => process.env.TARO_ENV === 'h5' && wxInfo().isPC);
...
...
@@ -188,6 +188,15 @@ const onSubmitPwd = async () => {
}
onMounted(async () => {
// 检查是否从首页跳转
if (!callIndex.value) {
// 翻状态
store.changeCallIndex(true);
// 跳转index页面
Taro.redirectTo({
url: `../index/index?code=${form_code}&model=${model}`
})
}
// TAG: 全局背景色
// $('body').css('background-color', styleColor.backgroundColor)
const { data } = await queryFormAPI({ form_code });
...
...
src/stores/index.js
View file @
41fab86
/*
* @Date: 2022-04-18 15:59:42
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-0
3-24 14:04:54
* @LastEditTime: 2023-0
4-04 18:07:56
* @FilePath: /custom_form/src/stores/index.js
* @Description: 文件描述
*/
...
...
@@ -12,13 +12,14 @@ export const mainStore = defineStore('main', {
state
:
()
=>
{
return
{
fieldName
:
''
,
callIndex
:
false
,
// 是否访问过index页面
formInfo
:
{},
// 表单字段信息
formSetting
:
{},
// 表单数据收集设置
successInfo
:
{},
// 表单提交返回值
}
;
}
},
getters
:
{
getKeepPages
()
{
getKeepPages
()
{
return
this
.
keepPages
},
// getTestStoreList () {
...
...
@@ -26,17 +27,20 @@ export const mainStore = defineStore('main', {
// }
},
actions
:
{
changeFieldName
(
v
)
{
this
.
fieldName
=
v
;
changeFieldName
(
v
)
{
this
.
fieldName
=
v
},
change
FormInfo
(
v
)
{
this
.
formInfo
=
v
;
change
CallIndex
(
v
)
{
this
.
callIndex
=
v
},
changeForm
Setting
(
v
)
{
this
.
form
Setting
=
v
;
changeForm
Info
(
v
)
{
this
.
form
Info
=
v
},
change
SuccessInfo
(
v
)
{
this
.
successInfo
=
v
;
change
FormSetting
(
v
)
{
this
.
formSetting
=
v
},
changeSuccessInfo
(
v
)
{
this
.
successInfo
=
v
},
});
},
})
...
...
Please
register
or
login
to post a comment