af-mobile-client-vue3 1.3.47 → 1.3.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "af-mobile-client-vue3",
3
3
  "type": "module",
4
- "version": "1.3.47",
4
+ "version": "1.3.49",
5
5
  "packageManager": "pnpm@10.13.1",
6
6
  "description": "Vue + Vite component lib",
7
7
  "engines": {
@@ -56,7 +56,7 @@ function search(val) {
56
56
  }
57
57
  function getData(val) {
58
58
  const res = props.columns.filter((item) => {
59
- return val.includes(item[props.option.value])
59
+ return val?.includes(item[props.option.value])
60
60
  })
61
61
  return res
62
62
  }
@@ -90,6 +90,7 @@ function toggleAll() {
90
90
  }
91
91
  function showPopu(disabled) {
92
92
  columnsData.value = JSON.parse(JSON.stringify(props.columns))
93
+ checkboxValue.value = JSON.parse(JSON.stringify(props.selectValue))
93
94
  if (disabled !== undefined && disabled !== false)
94
95
  return false
95
96
  else
@@ -103,14 +104,14 @@ watch(() => checkboxValue.value.length, (newVal, _oldVal) => {
103
104
  })
104
105
  const resultLabel = computed(() => {
105
106
  const res = props.columns.filter((item) => {
106
- return (resultValue.value as unknown as string[]).includes(item[props.option.value])
107
+ return (resultValue.value as unknown as string[])?.includes(item[props.option.value])
107
108
  }).map(item => item[props.option.text])
108
109
  return res.join(',')
109
110
  })
110
111
  </script>
111
112
 
112
113
  <template>
113
- <div class="dh-field">
114
+ <div class="x-multi-select">
114
115
  <VanField
115
116
  v-model="resultLabel"
116
117
  v-bind="$attrs"
@@ -131,7 +132,7 @@ const resultLabel = computed(() => {
131
132
  确认
132
133
  </button>
133
134
  </div>
134
- <div style="max-height:264px; overflow-y:auto;">
135
+ <div class="x-multi-select-content">
135
136
  <VanSearch
136
137
  v-if="props.isSearch"
137
138
  v-model="searchVal"
@@ -139,44 +140,53 @@ const resultLabel = computed(() => {
139
140
  @update:model-value="search"
140
141
  @cancel="search"
141
142
  />
142
- <VanCell title="全选">
143
- <template #right-icon>
144
- <VanCheckbox v-model="checkedAll" name="all" @click="toggleAll" />
145
- </template>
146
- </VanCell>
147
- <VanCheckboxGroup ref="checkboxGroup" v-model="checkboxValue" @change="change">
148
- <VanCellGroup>
149
- <VanCell
150
- v-for="(item, index) in columnsData"
151
- :key="item[props.option.value]"
152
- :title="item[props.option.text]"
153
- clickable
154
- @click="toggle(item, index)"
155
- >
156
- <template #right-icon>
157
- <VanCheckbox ref="checkboxes" :name="item[props.option.value]" @click.stop />
158
- </template>
159
- </VanCell>
160
- </VanCellGroup>
161
- </VanCheckboxGroup>
143
+ <div class="x-multi-select-checkbox-group">
144
+ <VanCell title="全选">
145
+ <template #right-icon>
146
+ <VanCheckbox v-model="checkedAll" name="all" @click="toggleAll" />
147
+ </template>
148
+ </VanCell>
149
+ <VanCheckboxGroup ref="checkboxGroup" v-model="checkboxValue" @change="change">
150
+ <VanCellGroup>
151
+ <VanCell
152
+ v-for="(item, index) in columnsData"
153
+ :key="item[props.option.value]"
154
+ :title="item[props.option.text]"
155
+ clickable
156
+ @click="toggle(item, index)"
157
+ >
158
+ <template #right-icon>
159
+ <VanCheckbox ref="checkboxes" :name="item[props.option.value]" @click.stop />
160
+ </template>
161
+ </VanCell>
162
+ </VanCellGroup>
163
+ </VanCheckboxGroup>
164
+ </div>
162
165
  </div>
163
166
  </VanPopup>
164
167
  </div>
165
168
  </template>
166
169
 
167
170
  <style lang="less" scoped>
168
- .dh-field {
171
+ .x-multi-select {
169
172
  width: 100%;
170
173
  padding: 0;
171
174
  background: #fff;
172
175
  .dh-cell.van-cell {
173
- padding: 10px 0;
176
+ padding: 10px 16px;
174
177
  }
175
178
  .dh-cell.van-cell--required::before {
176
179
  left: -8px;
177
180
  }
178
- .van-popup {
179
- border-radius: 20px 20px 0 0;
181
+ .x-multi-select-content {
182
+ max-height: 264px;
183
+ overflow-y: auto;
184
+ .x-multi-select-checkbox-group {
185
+ padding: 0 16px;
186
+ }
180
187
  }
188
+ //.van-popup {
189
+ // border-radius: 20px 20px 0 0;
190
+ //}
181
191
  }
182
192
  </style>
@@ -872,6 +872,7 @@ function findOptionInTree(options, value) {
872
872
  :readonly="readonly"
873
873
  :placeholder="placeholder"
874
874
  :columns="option"
875
+ :select-value="Array.isArray(modelData) ? modelData : []"
875
876
  :option="attr.option ? attr.option : columnsField"
876
877
  :rules="[{ required: attr.rule.required === 'true', message: `请选择${attr.name}` }]"
877
878
  :required="attr.rule.required === 'true'"
@@ -2,6 +2,7 @@
2
2
  import type { FormInstance } from 'vant'
3
3
  import { LoginStateEnum, useFormRules, useLoginState } from '@af-mobile-client-vue3/hooks/useLogin'
4
4
  import GetAppDataService from '@af-mobile-client-vue3/plugins/AppData'
5
+ import { getConfigByNameAsync, runLogic } from '@af-mobile-client-vue3/services/api/common'
5
6
  import { getUserPermissions } from '@af-mobile-client-vue3/services/api/search'
6
7
  import { useSettingStore } from '@af-mobile-client-vue3/stores/modules/setting'
7
8
  import { useUserStore } from '@af-mobile-client-vue3/stores/modules/user'
@@ -105,10 +106,25 @@ function handleSubmit() {
105
106
  try {
106
107
  loading.value = true
107
108
  showLoadingToast('登录中...')
109
+ let username = formData.username
110
+ let password = formData.password
111
+ debugger
112
+ const webConfig = await getConfigByNameAsync('webConfig')
113
+ const verification = webConfig.setting?.phoneLoginVerification || false
114
+ if (verification) {
115
+ try {
116
+ const res = await runLogic('openapi/loginVerification', { username, password }) as any
117
+ username = res.username
118
+ password = res.password
119
+ }
120
+ catch (e) {
121
+ console.error('验证登录失败: ', e)
122
+ }
123
+ }
108
124
  console.warn(setting)
109
125
  const data: any = await userState.Login({
110
- username: formData.username,
111
- password: formData.password,
126
+ username,
127
+ password,
112
128
  resourceName: setting.getSetting()?.routerName || '智慧手机',
113
129
  })
114
130
  login.f = data