css
shj
2022-07-18 6682fa7eb5f98ee776d9f8a1a11a80195bc7fbd0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<template>
  <el-dialog v-model="dialogVisible" title="选择检查模板" width="900px" draggable>
    <el-row>
      <el-col :span="18">
        <el-row>
          <el-col :span="24">
            <el-form ref="ruleFormRef" :model="ruleForm" :inline="true" status-icon>
              <el-form-item>
                <el-input size="default" v-model="ruleForm.pass" placeholder="id"  style="max-width: 215px;"/>
              </el-form-item>
              <el-form-item>
                <el-input size="default" v-model="ruleForm.checkPass" placeholder="队伍名称"  style="max-width: 215px;padding: 0 12px;"/>
              </el-form-item>
              <el-form-item>
                <el-button size="default" type="primary" @click="submitForm(ruleFormRef)">查询</el-button>
                <el-button size="default" @click="resetForm(ruleFormRef)">重置</el-button>
              </el-form-item>
            </el-form>
          </el-col>
          <el-col :span="24">
            <el-button size="default" :icon="Delete" style="margin-top: 15px;">清除选择</el-button>
          </el-col>
        </el-row>
        <el-table
            :data="tableData"
            ref="multipleTableRef"
            style="width: 100%;margin-top:20px"
        >
          <el-table-column type="selection" width="55" />
          <el-table-column align="center" prop="date" label="id" />
          <el-table-column align="center" prop="name" label="队伍名称"/>
        </el-table>
        <div class="pages">
          <el-pagination
              v-model:currentPage="currentPage4"
              v-model:page-size="pageSize4"
              :page-sizes="[100, 200, 300, 400]"
              :small="small"
              :disabled="disabled"
              :background="background"
              layout="total, sizes, prev, pager, next, jumper"
              :total="400"
              @size-change="handleSizeChange"
              @current-change="handleCurrentChange"
          />
        </div>
      </el-col>
      <el-col :span="6" style="padding-left: 15px">
        <el-tag v-for="tag in dynamicTags" :key="tag" class="mx-1" style="margin:5px" closable :disable-transitions="false" @close="handleClose(tag)">
          {{ tag }}
        </el-tag>
      </el-col>
    </el-row>
    <template #footer>
            <span class="dialog-footer">
                <el-button @click="dialogVisible = false" size="default">关闭</el-button>
                <el-button type="primary" @click="dialogVisible = false" size="default">确定</el-button>
            </span>
    </template>
  </el-dialog>
</template>
<script lang="ts">
import {
  defineComponent,
  reactive,
  ref,
} from 'vue';
import {
  Delete
} from '@element-plus/icons-vue';
interface User {
  date: string
  name: string
  address: string
}
export default defineComponent({
  setup() {
    const dialogVisible = ref<boolean>(false);
    const openDailog = () => {
      dialogVisible.value = true;
    };
    // 搜索条件
    const ruleForm = reactive({
      pass: '',
      checkPass: '',
    });
    // 表格
    const tableData = [
      {
        date: '6421cbc6cbb5493eabf9b27e83372d78',
        name: '应急救援组',
      },
      {
        date: '6421cbc6cbb5493eabf9b27e83372d78',
        name: '工艺抢险组',
      },
      {
        date: '6421cbc6cbb5493eabf9b27e83372d78',
        name: '后勤保障组',
      },
      {
        date: '6421cbc6cbb5493eabf9b27e83372d78',
        name: '应急救援组',
      },
    ];
    const pageSize4 = ref(100);
    const handleSizeChange = (val: number) => {
      console.log(`${val} items per page`);
    };
    const handleCurrentChange = (val: number) => {
      console.log(`current page: ${val}`);
    };
    // 右方点击添加后显示标签
    const dynamicTags = ref(['应急救援组', '工艺抢险组', '后勤保障组']);
    const handleClose = (tag: string) => {
      dynamicTags.value.splice(dynamicTags.value.indexOf(tag), 1);
    };
    return {
      dialogVisible,
      openDailog,
      ruleForm,
      tableData,
      pageSize4,
      handleSizeChange,
      handleCurrentChange,
      dynamicTags,
      handleClose,
      Delete,
    };
  },
});
</script>
<style scoped>
.el-form--inline .el-form-item{
  margin-bottom: 0;
  margin-right: 0;
}
/*分页*/
  .pages{
    /*display: flex;*/
    /*justify-content: flex-end;*/
    margin-top: 15px;
  }
::v-deep .el-pagination .el-pager li {
  margin: 0 5px;
  background-color: #f4f4f5;
  color: #606266;
  min-width: 30px;
  border-radius: 2px;
}
::v-deep .el-pagination .el-pager li.is-active {
  background-color: #409eff;
  color: #fff;
}
::v-deep .el-pagination .btn-prev {
  margin: 0 5px;
  background-color: #f4f4f5;
  color: #606266;
  min-width: 30px;
  border-radius: 2px;
}
::v-deep .el-pagination button:disabled{
  color: #c0c4cc;
}
::v-deep .el-pagination .btn-next{
  margin: 0 5px;
  background-color: #f4f4f5;
  color: #606266;
  min-width: 30px;
  border-radius: 2px;
}
</style>