|
@@ -0,0 +1,123 @@
|
|
|
|
|
+<template>
|
|
|
|
|
+ <!-- 过滤现货品种表格 -->
|
|
|
|
|
+ <div class="filter-custom-table">
|
|
|
|
|
+ <a-input v-model:value="nickname"
|
|
|
|
|
+ class="tableConditionInput"
|
|
|
|
|
+ placeholder="模糊搜索现货品种" />
|
|
|
|
|
+ <a-button class="selectBtn"
|
|
|
|
|
+ @click="search">搜索</a-button>
|
|
|
|
|
+ <!-- <a-button class="selectBtn"
|
|
|
|
|
+ @click="reset">重置</a-button> -->
|
|
|
|
|
+ <slot></slot>
|
|
|
|
|
+ </div>
|
|
|
|
|
+</template>
|
|
|
|
|
+
|
|
|
|
|
+<script lang="ts">
|
|
|
|
|
+import { defineComponent, ref, SetupContext } from 'vue';
|
|
|
|
|
+
|
|
|
|
|
+// 搜索
|
|
|
|
|
+function handleSearch(context: SetupContext) {
|
|
|
|
|
+ const nickname = ref<string>('');
|
|
|
|
|
+ const name = ref<string>('');
|
|
|
|
|
+ const phone = ref<string>('');
|
|
|
|
|
+ interface Value {
|
|
|
|
|
+ key: string;
|
|
|
|
|
+ value: string;
|
|
|
|
|
+ }
|
|
|
|
|
+ let useType = '';
|
|
|
|
|
+ const userinfotype = ref<number>(0);
|
|
|
|
|
+ function handleChange(value: Value) {
|
|
|
|
|
+ useType = value.value;
|
|
|
|
|
+ search();
|
|
|
|
|
+ }
|
|
|
|
|
+ function search() {
|
|
|
|
|
+ const result = { nickname: [nickname.value], name: [name.value], mobile: [phone.value], userinfotype: [useType] };
|
|
|
|
|
+ context.emit('search', result);
|
|
|
|
|
+ }
|
|
|
|
|
+ function reset() {
|
|
|
|
|
+ nickname.value = '';
|
|
|
|
|
+ name.value = '';
|
|
|
|
|
+ phone.value = '';
|
|
|
|
|
+ userinfotype.value = 0;
|
|
|
|
|
+ useType = '';
|
|
|
|
|
+ search();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return { nickname, name, phone, search, reset, userinfotype, handleChange };
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+export default defineComponent({
|
|
|
|
|
+ name: 'filter-custom-table',
|
|
|
|
|
+ components: {},
|
|
|
|
|
+ setup(props, context) {
|
|
|
|
|
+ return {
|
|
|
|
|
+ ...handleSearch(context),
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
+});
|
|
|
|
|
+</script>
|
|
|
|
|
+
|
|
|
|
|
+<style lang="less">
|
|
|
|
|
+.filter-custom-table {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ display: inline-flex;
|
|
|
|
|
+ padding-top: 9px;
|
|
|
|
|
+ padding-bottom: 6px;
|
|
|
|
|
+}
|
|
|
|
|
+.tableConditionInput {
|
|
|
|
|
+ margin-left: 3px;
|
|
|
|
|
+}
|
|
|
|
|
+.ant-select-single:not(.ant-select-customize-input) {
|
|
|
|
|
+ margin-right: 10px;
|
|
|
|
|
+ // background: #252D34;
|
|
|
|
|
+ // .rounded-corners(3px);
|
|
|
|
|
+ .ant-select-selector {
|
|
|
|
|
+ height: 30px;
|
|
|
|
|
+ padding: 0 8px;
|
|
|
|
|
+ background: @m-grey9;
|
|
|
|
|
+ border: none;
|
|
|
|
|
+ .rounded-corners(3px);
|
|
|
|
|
+ color: @m-grey10;
|
|
|
|
|
+ .ant-select-arrow {
|
|
|
|
|
+ right: 8px;
|
|
|
|
|
+ color: @m-grey1;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ .ant-select-arrow {
|
|
|
|
|
+ color: @m-grey1;
|
|
|
|
|
+ }
|
|
|
|
|
+ .ant-select-selection-item {
|
|
|
|
|
+ color: @m-white1;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+.conditionSelect + .conditionSelect {
|
|
|
|
|
+ margin-left: 10px;
|
|
|
|
|
+}
|
|
|
|
|
+.selectBtn.ant-btn {
|
|
|
|
|
+ margin-left: 10px;
|
|
|
|
|
+ width: 80px;
|
|
|
|
|
+ height: 30px;
|
|
|
|
|
+ line-height: 31px;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ background: linear-gradient(0deg, @m-grey15 0%, @m-grey16 98%);
|
|
|
|
|
+ border: 0;
|
|
|
|
|
+ color: @m-white0;
|
|
|
|
|
+ font-size: 14px;
|
|
|
|
|
+ .rounded-corners(3px);
|
|
|
|
|
+ &:hover,
|
|
|
|
|
+ &:focus {
|
|
|
|
|
+ background: linear-gradient(0deg, @m-grey15-hover 0%, @m-grey16-hover 98%);
|
|
|
|
|
+ color: rgba(@m-white0, 0.8);
|
|
|
|
|
+ border: 0;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+.operBtn.ant-btn:extend(.selectBtn.ant-btn) {
|
|
|
|
|
+ background: linear-gradient(0deg, @m-blue6 0%, @m-blue7 99%);
|
|
|
|
|
+ &:hover,
|
|
|
|
|
+ &:focus {
|
|
|
|
|
+ background: linear-gradient(0deg, @m-blue6-hover 0%, @m-blue7-hover 99%);
|
|
|
|
|
+ color: rgba(@m-white0, 0.8);
|
|
|
|
|
+ border: 0;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+</style>;
|