|
@@ -0,0 +1,212 @@
|
|
|
+<template>
|
|
|
+ <basic-container>
|
|
|
+ <div class="h-100p">
|
|
|
+ <el-tabs v-model="activeName" @tab-click="handleClick">
|
|
|
+ <el-tab-pane label="压实度评标参数" name="first">
|
|
|
+ <avue-crud
|
|
|
+ :table-loading="loading"
|
|
|
+ :data="tableData"
|
|
|
+ :option="option"
|
|
|
+ @row-save="rowSave"
|
|
|
+ @row-update="addUpdate"
|
|
|
+ @selection-change="selectionChange"
|
|
|
+ @refresh-change="refreshChange"
|
|
|
+ @current-change="currentChange"
|
|
|
+ @size-change="sizeChange"
|
|
|
+ @on-load="onLoad"
|
|
|
+ :page.sync="page"
|
|
|
+ ref="crud"
|
|
|
+ >
|
|
|
+ <template slot="menuRight">
|
|
|
+ <el-button
|
|
|
+ type="danger"
|
|
|
+ size="small"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ plain
|
|
|
+ @click="handleDelete">删除
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ icon="el-icon-plus"
|
|
|
+ @click="importdata"
|
|
|
+ >导入
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </avue-crud>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="温度及密度参数" name="second">
|
|
|
+ <temperature/>
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+ </div>
|
|
|
+ <!-- 导入参数弹窗 -->
|
|
|
+ <importDialog ref="importDialog"/>
|
|
|
+ </basic-container>
|
|
|
+
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import importDialog from './importDialog.vue';
|
|
|
+import temperature from './temperature.vue'
|
|
|
+export default {
|
|
|
+ components:{
|
|
|
+ importDialog,
|
|
|
+ temperature
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ activeName: 'first',
|
|
|
+ page: {
|
|
|
+ pageSize: 20,
|
|
|
+ currentPage:1
|
|
|
+ },
|
|
|
+ loading:false,
|
|
|
+ tableData: [
|
|
|
+ {
|
|
|
+ id:1,
|
|
|
+ name:'张三',
|
|
|
+ sex:'男'
|
|
|
+ }, {
|
|
|
+ id:2,
|
|
|
+ name:'李四',
|
|
|
+ sex:'女'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ selectionList:[],
|
|
|
+ query:{},
|
|
|
+
|
|
|
+ option:{
|
|
|
+ height: 'auto',
|
|
|
+ calcHeight: 30,
|
|
|
+ tip: false,
|
|
|
+ searchShow:false,
|
|
|
+ searchMenuSpan: 6,
|
|
|
+ border: true,
|
|
|
+ index: true,
|
|
|
+ viewBtn: false,
|
|
|
+ selection: true,
|
|
|
+ editBtn:true,
|
|
|
+ delBtn:false,
|
|
|
+ addBtn:true,
|
|
|
+ menu:true,
|
|
|
+
|
|
|
+ dialogClickModal: false,
|
|
|
+ column:[
|
|
|
+ {
|
|
|
+ label:'姓名',
|
|
|
+ prop:'name'
|
|
|
+ }, {
|
|
|
+ label:'性别',
|
|
|
+ prop:'sex'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed:{
|
|
|
+ ids () {
|
|
|
+ let ids = [];
|
|
|
+ this.selectionList.forEach(ele => {
|
|
|
+ ids.push(ele.id);
|
|
|
+ });
|
|
|
+ return ids.join(",");
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+
|
|
|
+ onLoad(page, params = {}) {
|
|
|
+ //模拟分页
|
|
|
+ this.page.total = 40
|
|
|
+ // this.loading = true;
|
|
|
+ // // getLazyMenuList(this.parentId, Object.assign(params, this.query)).then(res => {
|
|
|
+ // // this.data = res.data.data;
|
|
|
+ // // this.loading = false;
|
|
|
+ // // this.selectionClear();
|
|
|
+ // // });
|
|
|
+ },
|
|
|
+ refreshChange() {
|
|
|
+ this.onLoad(this.page, this.query);
|
|
|
+ },
|
|
|
+ sizeChange(pageSize) {
|
|
|
+ this.page.pageSize = pageSize;
|
|
|
+ },
|
|
|
+ currentChange(currentPage) {
|
|
|
+ this.page.currentPage = currentPage;
|
|
|
+ },
|
|
|
+ handleClick(tab, event) {
|
|
|
+ console.log(tab, event);
|
|
|
+ },
|
|
|
+ rowSave (row, done, loading) {
|
|
|
+ console.log(row,'row');
|
|
|
+ // add(row).then(() => {
|
|
|
+ // this.onLoad(this.page);
|
|
|
+ // this.$message({
|
|
|
+ // type: "success",
|
|
|
+ // message: "操作成功!"
|
|
|
+ // });
|
|
|
+ // done();
|
|
|
+ // }, error => {
|
|
|
+ // loading();
|
|
|
+ // window.console.log(error);
|
|
|
+ // });
|
|
|
+ },
|
|
|
+ addUpdate(form,index,done,loading){
|
|
|
+ console.log(form,'编辑');
|
|
|
+ this.$message.success('模拟网络请求')
|
|
|
+ setTimeout(() => {
|
|
|
+ this.$message.success('关闭按钮等待')
|
|
|
+ loading()
|
|
|
+ }, 1000)
|
|
|
+ setTimeout(() => {
|
|
|
+ this.$message.success(
|
|
|
+ '编辑数据' + JSON.stringify(form) + '数据序号' + index
|
|
|
+ )
|
|
|
+ done()
|
|
|
+ }, 2000)
|
|
|
+ },
|
|
|
+ handleDelete () {
|
|
|
+ if (this.selectionList.length === 0) {
|
|
|
+ this.$message.warning("请选择至少一条数据");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.$confirm("确定将选择数据删除?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ // return delTabInfoAll(this.ids);
|
|
|
+ console.log(this.ids,'this.ids删除');
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ // this.onLoad(this.page);//刷新表格数据
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "操作成功!"
|
|
|
+ });
|
|
|
+ this.$refs.crud.toggleSelection();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ selectionChange (list) {
|
|
|
+ this.selectionList = list;
|
|
|
+ },
|
|
|
+ selectionClear () {
|
|
|
+ this.selectionList = [];
|
|
|
+ this.$refs.crud.toggleSelection();
|
|
|
+ },
|
|
|
+ importdata(){
|
|
|
+ console.log('导入');
|
|
|
+ this.$refs.importDialog.show()
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style>
|
|
|
+
|
|
|
+</style>
|