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>
</el-button>
</template>
<el-button @click="queryDialog=true">
<el-icon><ep-filter /></el-icon>
<span>{{$t('高级筛选')}}</span>
</el-button>
<slot name="tableButtons" :rows="selectedRows"></slot>
</el-col>
</el-row>
@ -143,6 +147,62 @@ export default {
/>
</el-col>
</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()">
<template #header> <span class="el-dialog__title"> {{$t('filter')}} </span> </template>
<el-scrollbar>
@ -240,6 +300,8 @@ export default {
const sortColumns = ref(new Map());
const schema = ref(props.schema);
const queryFromSchema = ref(null);
const queryList = ref([]);
const queryDialog = ref(false);
const tableSchema = ref({});
const tableData = ref([]);
const editFormRef = ref(null);
@ -418,6 +480,14 @@ export default {
subDrawer.value = true;
}
};
const pushQueryList = () => {
queryList.value.push({
property: "",
operator: "等于",
value: "",
logical: "且",
});
};
onMounted(async () => {
const vm = (await get(indexUrl)).data;
schema.value = vm.schema;
@ -442,6 +512,8 @@ export default {
dialogVisible,
selectedRows,
queryFromSchema,
queryDialog,
queryList,
tableSchema,
buttons,
data,
@ -463,6 +535,7 @@ export default {
submit,
showList,
subListQuery,
pushQueryList,
};
},
};

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

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

Loading…
Cancel
Save