Browse Source

update

pull/1/head
wanggang 1 year ago
parent
commit
75d03da033
  1. 73
      docs/demo/src/WTA/wwwroot/components/list/index.js
  2. 12
      docs/demo/src/WTA/wwwroot/layouts/index.js

73
docs/demo/src/WTA/wwwroot/components/list/index.js

@ -44,6 +44,10 @@ export default {
<span>{{item.meta.title}}</span> <span>{{item.meta.title}}</span>
</el-button> </el-button>
</template> </template>
<el-button @click="queryDialog=true">
<el-icon><ep-filter /></el-icon>
<span>{{$t('高级筛选')}}</span>
</el-button>
<slot name="tableButtons" :rows="selectedRows"></slot> <slot name="tableButtons" :rows="selectedRows"></slot>
</el-col> </el-col>
</el-row> </el-row>
@ -143,6 +147,62 @@ export default {
/> />
</el-col> </el-col>
</el-row> </el-row>
<el-dialog v-model="queryDialog" align-center destroy-on-close>
<template #header> <span class="el-dialog__title"> {{$t('高级筛选')}} </span> </template>
<el-row>
<el-col style="max-height:calc(100vh - 180px );">
<el-scrollbar>
<el-row :gutter="20" v-for="(item,index) in queryList" style="margin-top:20px;">
<el-col :span="6">
<el-select v-model="item.property" :placeholder="$t('字段')">
<el-option v-for="(value, prop) in queryFromSchema.properties">{{value.title}}</el-option>
</el-select>
</el-col>
<el-col :span="6">
<el-select v-model="item.operator" :placeholder="$t('操作符')">
<el-option>{{$t('等于')}}</el-option>
<el-option>{{$t('不等于')}}</el-option>
<el-option>{{$t('大于')}}</el-option>
<el-option>{{$t('大于等于')}}</el-option>
<el-option>{{$t('小于')}}</el-option>
<el-option>{{$t('小于等于')}}</el-option>
<el-option>{{$t('包含')}}</el-option>
<el-option>{{$t('不包含')}}</el-option>
</el-select>
</el-col>
<el-col :span="6">
<el-input v-model="item.value" :placeholder="$t('值')" />
</el-col>
<el-col :span="4">
<el-select v-model="item.logical" :placeholder="$t('关系')">
<el-option>{{$t('且')}}</el-option>
<el-option>{{$t('或')}}</el-option>
</el-select>
</el-col>
<el-col :span="2">
<el-space style="height:32px">
<el-icon class="cursor-pointer" @click="queryList.splice(index, 1)">
<ep-close />
</el-icon>
</el-space>
</el-col>
</el-row>
<el-row>
<el-col>
<el-space style="height:32px;">
<el-icon class="cursor-pointer" @click="pushQueryList"><ep-plus /></el-icon>
</el-space>
</el-col>
</el-row>
</el-scrollbar>
</el-col>
</el-row>
<template #footer>
<span class="dialog-footer">
<el-button type="primary" @click="queryDialog=false"> {{$t('confirm')}} </el-button>
</span>
</template>
</el-dialog>
<el-drawer v-model="filterDrawer" destroy-on-close @close="tableRef.doLayout()"> <el-drawer v-model="filterDrawer" destroy-on-close @close="tableRef.doLayout()">
<template #header> <span class="el-dialog__title"> {{$t('filter')}} </span> </template> <template #header> <span class="el-dialog__title"> {{$t('filter')}} </span> </template>
<el-scrollbar> <el-scrollbar>
@ -240,6 +300,8 @@ export default {
const sortColumns = ref(new Map()); const sortColumns = ref(new Map());
const schema = ref(props.schema); const schema = ref(props.schema);
const queryFromSchema = ref(null); const queryFromSchema = ref(null);
const queryList = ref([]);
const queryDialog = ref(false);
const tableSchema = ref({}); const tableSchema = ref({});
const tableData = ref([]); const tableData = ref([]);
const editFormRef = ref(null); const editFormRef = ref(null);
@ -418,6 +480,14 @@ export default {
subDrawer.value = true; subDrawer.value = true;
} }
}; };
const pushQueryList = () => {
queryList.value.push({
property: "",
operator: "等于",
value: "",
logical: "且",
});
};
onMounted(async () => { onMounted(async () => {
const vm = (await get(indexUrl)).data; const vm = (await get(indexUrl)).data;
schema.value = vm.schema; schema.value = vm.schema;
@ -442,6 +512,8 @@ export default {
dialogVisible, dialogVisible,
selectedRows, selectedRows,
queryFromSchema, queryFromSchema,
queryDialog,
queryList,
tableSchema, tableSchema,
buttons, buttons,
data, data,
@ -463,6 +535,7 @@ export default {
submit, submit,
showList, showList,
subListQuery, subListQuery,
pushQueryList,
}; };
}, },
}; };

12
docs/demo/src/WTA/wwwroot/layouts/index.js

@ -20,17 +20,9 @@ export default {
<layout-tabs /> <layout-tabs />
<el-main> <el-main>
<router-view v-if="!isRefreshing" v-slot="{ Component, route }"> <router-view v-if="!isRefreshing" v-slot="{ Component, route }">
<component <component :is="Component" v-if="route.meta?.disableCaching" :key="$route.fullPath" />
:is="Component"
v-if="!appStore.isUseTabsRouter || !route.meta?.cached"
:key="$route.fullPath"
/>
<keep-alive> <keep-alive>
<component <component :is="Component" v-if="!route.meta?.disableCaching" :key="route.fullPath" />
:is="Component"
v-if="appStore.isUseTabsRouter && route.meta?.cached"
:key="route.fullPath"
/>
</keep-alive> </keep-alive>
</router-view> </router-view>
</el-main> </el-main>

Loading…
Cancel
Save