| | |
| | | <template> |
| | | <cl-crud :ref="setRefs('crud')" :on-refresh="onRefresh" @load="onLoad"> |
| | | <el-row type="flex"> |
| | | <cl-refresh-btn /> |
| | | <cl-add-btn /> |
| | | <cl-menu-quick @success="refresh()" v-if="isDev" /> |
| | | </el-row> |
| | | <cl-crud :ref="setRefs('crud')" |
| | | :on-refresh="onRefresh" |
| | | @load="onLoad"> |
| | | <el-row type="flex"> |
| | | <cl-refresh-btn /> |
| | | <cl-add-btn /> |
| | | <cl-menu-quick @success="refresh()" |
| | | v-if="isDev" /> |
| | | </el-row> |
| | | |
| | | <el-row> |
| | | <cl-table :ref="setRefs('table')" v-bind="table" @row-click="onRowClick"> |
| | | <!-- 名称 --> |
| | | <template #column-name="{ scope }"> |
| | | <span>{{ scope.row.name }}</span> |
| | | <el-tag |
| | | v-if="!scope.row.isShow" |
| | | size="mini" |
| | | effect="dark" |
| | | type="danger" |
| | | style="margin-left: 10px" |
| | | >隐藏</el-tag |
| | | > |
| | | </template> |
| | | <el-row> |
| | | <cl-table :ref="setRefs('table')" |
| | | v-bind="table" |
| | | @row-click="onRowClick"> |
| | | <!-- 名称 --> |
| | | <template #column-name="{ scope }"> |
| | | <span>{{ scope.row.name }}</span> |
| | | <el-tag v-if="!scope.row.isShow" |
| | | size="mini" |
| | | effect="dark" |
| | | type="danger" |
| | | style="margin-left: 10px">隐藏</el-tag> |
| | | </template> |
| | | |
| | | <!-- 图标 --> |
| | | <template #column-icon="{ scope }"> |
| | | <icon-svg :name="scope.row.icon" size="16px" style="margin-top: 5px" /> |
| | | </template> |
| | | <!-- 图标 --> |
| | | <template #column-icon="{ scope }"> |
| | | <icon-svg :name="scope.row.icon" |
| | | size="16px" |
| | | style="margin-top: 5px" /> |
| | | </template> |
| | | |
| | | <!-- 权限 --> |
| | | <template #column-perms="{ scope }"> |
| | | <el-tag |
| | | v-for="(item, index) in scope.row.permList" |
| | | :key="index" |
| | | size="mini" |
| | | effect="dark" |
| | | style="margin: 2px; letter-spacing: 0.5px" |
| | | >{{ item }}</el-tag |
| | | > |
| | | </template> |
| | | <!-- 权限 --> |
| | | <template #column-perms="{ scope }"> |
| | | <el-tag v-for="(item, index) in scope.row.permList" |
| | | :key="index" |
| | | size="mini" |
| | | effect="dark" |
| | | style="margin: 2px; letter-spacing: 0.5px">{{ item }}</el-tag> |
| | | </template> |
| | | |
| | | <!-- 路由 --> |
| | | <template #column-router="{ scope }"> |
| | | <el-link v-if="scope.row.type == 1" type="primary" :href="scope.row.router">{{ |
| | | <!-- 路由 --> |
| | | <template #column-router="{ scope }"> |
| | | <el-link v-if="scope.row.type == 1" |
| | | type="primary" |
| | | :href="scope.row.router">{{ |
| | | scope.row.router |
| | | }}</el-link> |
| | | <span v-else>{{ scope.row.router }}</span> |
| | | </template> |
| | | <span v-else>{{ scope.row.router }}</span> |
| | | </template> |
| | | |
| | | <!-- 路由缓存 --> |
| | | <template #column-keepAlive="{ scope }"> |
| | | <template v-if="scope.row.type == 1"> |
| | | <i v-if="scope.row.keepAlive" class="el-icon-check"></i> |
| | | <i v-else class="el-icon-close"></i> |
| | | </template> |
| | | </template> |
| | | <!-- 路由缓存 --> |
| | | <template #column-keepAlive="{ scope }"> |
| | | <template v-if="scope.row.type == 1"> |
| | | <i v-if="scope.row.keepAlive" |
| | | class="el-icon-check"></i> |
| | | <i v-else |
| | | class="el-icon-close"></i> |
| | | </template> |
| | | </template> |
| | | |
| | | <!-- 行新增 --> |
| | | <template #slot-add="{ scope }"> |
| | | <el-button |
| | | v-if="scope.row.type != 2" |
| | | type="text" |
| | | size="mini" |
| | | @click="upsertAppend(scope.row)" |
| | | >新增</el-button |
| | | > |
| | | </template> |
| | | </cl-table> |
| | | </el-row> |
| | | <!-- 行新增 --> |
| | | <template #slot-add="{ scope }"> |
| | | <el-button v-if="scope.row.type != 2" |
| | | type="text" |
| | | size="mini" |
| | | @click="upsertAppend(scope.row)">新增</el-button> |
| | | </template> |
| | | </cl-table> |
| | | </el-row> |
| | | |
| | | <el-row type="flex"> |
| | | <cl-flex1 /> |
| | | <cl-pagination :props="{ layout: 'total' }" /> |
| | | </el-row> |
| | | <el-row type="flex"> |
| | | <cl-flex1 /> |
| | | <cl-pagination :props="{ layout: 'total' }" /> |
| | | </el-row> |
| | | |
| | | <!-- 编辑 --> |
| | | <cl-upsert v-bind="upsert" /> |
| | | </cl-crud> |
| | | <!-- 编辑 --> |
| | | <cl-upsert v-bind="upsert" /> |
| | | </cl-crud> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | |
| | | |
| | | // 刷新 |
| | | function refresh() { |
| | | console.log("刷新方法内打印"); |
| | | refs.value.crud.refresh(); |
| | | } |
| | | |