fix:余额日志切换会员时表格数据跟随切换

This commit is contained in:
妙码生花 2022-03-27 14:33:33 +08:00
parent a5f1d31d27
commit d12a7edc7d
5 changed files with 13 additions and 12 deletions

View File

@ -19,7 +19,7 @@ class MoneyLog extends Backend
// 排除字段
protected $preExcludeFields = ['createtime'];
protected $quickSearchField = ['username', 'nickname'];
protected $quickSearchField = ['user.username', 'user.nickname'];
public function initialize()
{

View File

@ -205,7 +205,7 @@ defineExpose({
.ba-data-table :deep(.el-button + .el-button) {
margin-left: 6px;
}
:deep(.table-header-cell) .cell {
:deep(.ba-data-table) .table-header-cell .cell {
color: var(--color-text-primary);
overflow: hidden;
text-overflow: ellipsis;

View File

@ -71,7 +71,7 @@
</template>
<script setup lang="ts">
import { reactive, ref, inject } from 'vue'
import { reactive, ref, inject, watch } from 'vue'
import { useI18n } from 'vue-i18n'
import type baTableClass from '/@/utils/baTable'
import type { ElForm } from 'element-plus'
@ -145,7 +145,7 @@ const getAdd = () => {
}
const changeMoney = (value: string) => {
if (!state.userInfo.money) {
if (!state.userInfo || typeof state.userInfo == 'undefined') {
state.after = 0
return
}
@ -153,7 +153,14 @@ const changeMoney = (value: string) => {
state.after = parseFloat(state.userInfo.money) + newValue
}
getAdd()
watch(
() => baTable.form.operate,
(newValue) => {
if (newValue) {
getAdd()
}
}
)
</script>
<style scoped lang="scss">

View File

@ -66,11 +66,4 @@ baTable.getIndex()
provide('baTable', baTable)
</script>
<script lang="ts">
import { defineComponent } from 'vue'
export default defineComponent({
name: 'user/moneyLog',
})
</script>
<style scoped lang="scss"></style>

View File

@ -207,6 +207,7 @@ const onAvatarBeforeUpload = (file: any) => {
}
const changeAccount = (type: string) => {
baTable.toggleForm()
router.push({
name: type == 'money' ? 'user/moneyLog' : 'user/scoreLog',
query: {