hookehuyr

默认数据常量获取

1 <!-- 1 <!--
2 * @Date: 2022-09-19 14:11:06 2 * @Date: 2022-09-19 14:11:06
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2022-10-22 00:26:20 4 + * @LastEditTime: 2022-10-24 10:53:26
5 * @FilePath: /swx/src/pages/createProject/index.vue 5 * @FilePath: /swx/src/pages/createProject/index.vue
6 * @Description: 新建主办方页面 6 * @Description: 新建主办方页面
7 --> 7 -->
...@@ -106,37 +106,33 @@ import bottomButton from "@/components/bottom-button"; ...@@ -106,37 +106,33 @@ import bottomButton from "@/components/bottom-button";
106 import Toast from '@/components/vant-weapp/toast/toast'; 106 import Toast from '@/components/vant-weapp/toast/toast';
107 import { addHostAPI } from '@/api/Host/index'; 107 import { addHostAPI } from '@/api/Host/index';
108 import { randomId } from '@/utils/tools' 108 import { randomId } from '@/utils/tools'
109 +import { DEFAULT_HOST_TYPE, DEFAULT_HOST_STATUS } from '@/utils/sysData'
109 110
110 const name = ref(''); 111 const name = ref('');
111 const user_type = ref([]); 112 const user_type = ref([]);
112 const user_status = ref([]); 113 const user_status = ref([]);
113 const add_user_type= ref({}); 114 const add_user_type= ref({});
114 const add_user_status = ref({}); 115 const add_user_status = ref({});
116 +const userType = ref([]);
117 +const userStatus = ref([]);
115 118
116 -const userType = ref([{ 119 +// 生成默认数据
117 - key: 'first', 120 +DEFAULT_HOST_TYPE.forEach(item => {
118 - label: '首次参与', 121 + userType.value.push({
119 - checked: 1, 122 + key: randomId(5),
120 - nop: true 123 + label: item,
121 -}, { 124 + checked: 1,
122 - key: 'old', 125 + nop: true
123 - label: '老用户', 126 + })
124 - checked: 1, 127 +});
125 - nop: true 128 +DEFAULT_HOST_STATUS.forEach(item => {
126 -}]); 129 + userStatus.value.push({
127 -const userStatus = ref([{ 130 + key: randomId(5),
128 - key: 'follow', 131 + label: item,
129 - label: '跟踪', 132 + checked: 1,
130 - checked: 1, 133 + nop: true
131 - nop: true 134 + })
132 -}, { 135 +});
133 - key: 'guide',
134 - label: '引导',
135 - checked: 1,
136 - nop: true
137 -}]);
138 -
139 -
140 136
141 // 用户类型弹框操作 137 // 用户类型弹框操作
142 const onTapType = (item) => { 138 const onTapType = (item) => {
......
1 +/**
2 + * 系统参数
3 + */
4 +
5 +const DEFAULT_HOST_TYPE = ['首次参与', '老用户']; // 主办方默认用户类型
6 +const DEFAULT_HOST_STATUS = ['跟踪', '引导']; // 主办方默认用户状态
7 +
8 +export { DEFAULT_HOST_TYPE, DEFAULT_HOST_STATUS }