widget.html 11.7 KB
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <title>Title</title>
</head>
<style>
    #app{
        background-color: #ffffff;
    }
    [v-cloak] {
        display: none;
    }
    .header{
        display: flex;
        flex-direction: row;
        padding: 1rem 0 1rem 0;
        font-size: 16px;
    }
    [class*=" el-icon-"], [class^=el-icon-] {
        font-weight: 1000;
        line-height: 0.1;
        margin-left: -0.5rem;
    }
    .el-button {
        width: 4.375rem;
        height: 1.875rem;
        line-height: 0.4;
    }
    .el-button--primary.is-plain {
        background: #ffffff;
    }
    .el-input__suffix {
        height: 2.575rem;
        margin-top: -0.25rem;
    }
    .header-search{
        width: 18.75rem;
        height: 1.875rem;
    }
    .el-input--suffix .el-input__inner {
        padding-right: 30px;
        height: 100%;
        width: 100%;
    }
    .header-input{
        display: flex;
        /*flex-direction: row;*/
        justify-content : center;
        width: 18.25rem;
        height: 1.875rem;
        margin-left: 3rem;

    }
    .header-input-label{
        padding: 0.26rem;
        width: 6rem;
    }
    .tableTitle {
        position: relative;
        margin: 0 auto;
        width: 99vw;
        height: 1px;
        background-color: #d4d4d4;
        text-align: center;
        color: rgba(101, 101, 101, 1);
    }
    .main-content{
        height: 90vh;
    }
    .el-radio-button__inner {
        height: 1.875rem;
        width: 4.75rem;
        padding: 0.5rem 0 0 0.1rem;
    }
    .dialog-input{
        width: 95%;
        margin-left: 1rem;
    }
    .dialog-col{
        border: 1px solid #afa6a6;
        height: 40vh;
    }
    .dialog-table{
        margin-top: 1rem;
    }
    .footer{
        display: flex;
        flex-direction: row-reverse;
    }
</style>
<body>
<div id="app" v-cloak>
    <el-container>
        <el-header>
            <div class="header">
                <el-input placeholder="搜索待办项目" suffix-icon="el-icon-search" v-model="search" class="header-search"></el-input>
                <div class="header-input">
                    <div class="header-input-label">业务类型</div>
                    <el-input v-model="input">
                        <i slot="suffix" class="el-input__icon el-icon-plus" @click="dialogVisible = true" style="color: #0096eb"></i>
                    </el-input>
                    <div >
                        <el-dialog
                                title="选择业务类型"
                                :visible.sync="dialogVisible"
                                width="40%"
                                :before-close="handleClose">
                            <div>
                                <el-input class="dialog-input" placeholder="搜索业务类型" v-model="dialogInput">
                                    <template slot-scope="scope">
                                        <span style="color: #0096eb">{{dialogInput}}</span>
                                    </template>
                                </el-input>
                                <div class="dialog-table">
                                    <el-row>
                                        <el-col :span="12" class="dialog-col">
                                            <el-table :data="tableFirst" :show-header="false">
                                                <el-table-column prop="name"></el-table-column>
                                            </el-table>
                                        </el-col>
                                        <el-col :span="12" class="dialog-col">
                                            <el-table :data="tableSecond" :show-header="false" @row-click="clickTable">
                                                <el-table-column prop="name"></el-table-column>
                                            </el-table>
                                        </el-col>
                                    </el-row>
                                </div>
                            </div>
                            <span slot="footer" class="dialog-footer">
                                <el-button type="primary" @click="onSubmit">确 定</el-button>
                                <el-button @click="dialogVisible = false">取 消</el-button>
                            </span>
                        </el-dialog>
                    </div>
                </div>
            </div>
            <div class="tableTitle"></div>
        </el-header>
        <el-main>
            <div class="main-content">
                <el-radio-group v-model="activeName" style="margin-bottom: 1rem">
                    <el-radio-button class="radio-button" label="1">空间协调</el-radio-button>
                    <el-radio-button class="radio-button" label="2">可研协调</el-radio-button>
                </el-radio-group>
                <div v-show="activeName === '1'">
                    <el-table
                            ref="multipleTable"
                            :data="tableData"
                            tooltip-effect="dark"
                            style="width: 100vw"
                            height="75vh"
                            :header-cell-style="{background:'#F2F2F2'}"
                            @selection-change="handleSelectionChange">
                        <el-table-column type="selection" width="50"></el-table-column>
                        <el-table-column prop="statue" label="" width="40" align="center">
                            <template slot-scope="scope">
                                    <span v-if="scope.row.statue === '0'" style="color:#FF504A">
                                        <i class="el-icon-warning-outline"></i>
                                    </span>
                                <span v-else style="color:#008000">
                                        <i class="el-icon-success"></i>
                                    </span>
                            </template>
                        </el-table-column>
                        <el-table-column prop="name" label="项目名称" align="center"></el-table-column>
                        <el-table-column prop="reserveId" label="储备编号" align="center"></el-table-column>
                        <el-table-column prop="projectNature" label="项目性质" align="center"></el-table-column>
                        <el-table-column prop="investment" label="初估投资" align="center"></el-table-column>
                        <el-table-column prop="region" label="项目所在区域" align="center"></el-table-column>
                        <el-table-column prop="partition" label="行政分区" align="center"></el-table-column>
                        <el-table-column prop="constructionContent" label="意向建设内容" align="center"></el-table-column>
                        <el-table-column prop="time" label="创建时间" width="160" align="center"></el-table-column>
                        <el-table-column prop="department" label="创建部门" align="center"></el-table-column>
                        <el-table-column prop="isBack" label="是否返库" align="center"></el-table-column>
                    </el-table>
                    <div class="footer">共{{tableLength}}条</div>
                </div>
                <div v-show="activeName === '2'">
                    <el-table
                            ref="multipleTable"
                            :data="yearTableData"
                            tooltip-effect="dark"
                            style="width: 100vw"
                            height="75vh"
                            :header-cell-style="{background:'#F2F2F2'}"
                            @selection-change="handleSelectionChange">
                        <el-table-column type="selection" width="50"></el-table-column>
                        <el-table-column prop="statue" label="" width="40" align="center">
                            <template slot-scope="scope">
                                    <span v-if="scope.row.statue === '0'" style="color:#FF504A">
                                        <i class="el-icon-warning-outline"></i>
                                    </span>
                                <span v-else style="color:#008000">
                                        <i class="el-icon-success"></i>
                                    </span>
                            </template>
                        </el-table-column>
                        <el-table-column prop="name" label="项目名称" align="center"></el-table-column>
                        <el-table-column prop="reserveId" label="储备编号" align="center"></el-table-column>
                        <el-table-column prop="projectNature" label="项目性质" align="center"></el-table-column>
                        <el-table-column prop="investment" label="初估投资" align="center"></el-table-column>
                        <el-table-column prop="region" label="项目所在区域" align="center"></el-table-column>
                        <el-table-column prop="partition" label="行政分区" align="center"></el-table-column>
                        <el-table-column prop="constructionContent" label="意向建设内容" align="center"></el-table-column>
                        <el-table-column prop="time" label="创建时间" width="160" align="center"></el-table-column>
                        <el-table-column prop="department" label="创建部门" align="center"></el-table-column>
                        <el-table-column prop="isBack" label="是否返库" align="center"></el-table-column>
                    </el-table>
                    <div class="footer">共{{yearTableLength}}条</div>
                </div>
            </div>
        </el-main>
    </el-container>
</div>
<script src="/frontweb/libs/vue/vue.js"></script>
<script src="/frontweb/libs/element/index.js"></script>
<script src="/frontweb/view/monitorevaluate/monitor/js/jquery.min.js"></script>
<script src="/frontweb/libs/axios/axios.min.js"></script>
<script type="text/javascript">
    var vm = new Vue({
        el: '#app',
        data() {
            return {
                search: '',
                input: '',
                dialogInput: '',
                activeName: '1',
                tableData: [],
                yearTableData: [],
                multipleSelection: [],
                tableLength: '',
                yearTableLength: '',
                dialogVisible: false,
                tableFirst: [],
                tableSecond: [],
            }
        },
        mounted () {
            this.getTableData()
        },
        methods: {
            getTableData () {
                axios.get('data.json').then(res => {
                    this.tableData = res.data.data
                    this.yearTableData = res.data.list
                    this.tableLength = this.tableData.length
                    this.yearTableLength = this.yearTableData.length
                })
            },
            handleClick(tab, event) {
                console.log(tab, event);
            },
            handleSelectionChange(val) {
                this.multipleSelection = val;
            },
            handleClose(done) {
                this.$confirm('确认关闭?')
                    .then(_ => {
                        done();
                    })
                    .catch(_ => {});
            },
        },
        computed: {

        }
    })
</script>
</body>
</html>