package com.ecep.contract.controller.permission;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Description;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.ecep.contract.controller.AbstManagerWindowController;
import com.ecep.contract.model.Function;
import com.ecep.contract.service.FunctionService;
import com.ecep.contract.service.PermissionService;
import com.ecep.contract.util.FxmlPath;
import com.ecep.contract.vm.FunctionViewModel;

import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.TableColumn;
import javafx.stage.Stage;


@Lazy
@Scope("prototype")
@Description("")
@FxmlPath("/ui/employee/functions-manager.fxml")
@Component
public class EmployeeFunctionsManagerWindowController
        extends AbstManagerWindowController<Function, FunctionViewModel, FunctionManagerSkin> {

    @Autowired
    PermissionService permissionService;
    @Autowired
    FunctionService functionService;

    @FXML
    public TableColumn<FunctionViewModel, Number> idColumn;
    @FXML
    public TableColumn<FunctionViewModel, String> nameColumn;
    @FXML
    public TableColumn<FunctionViewModel, String> keyColumn;
    @FXML
    public TableColumn<FunctionViewModel, String> controllerColumn;
    @FXML
    public TableColumn<FunctionViewModel, String> iconColumn;
    @FXML
    public TableColumn<FunctionViewModel, String> descriptionColumn;
    @FXML
    public TableColumn<FunctionViewModel, Boolean> activeColumn;

    @Override
    public void show(Stage stage) {
        super.show(stage);
        getTitle().set("功能管理");
    }

    @Override
    protected FunctionManagerSkin createDefaultSkin() {
        return new FunctionManagerSkin(this);
    }

    public void onCreateNewAction(ActionEvent event) {
    }

    public void onReBuildFilesAction(ActionEvent event) {
    }

    @Override
    public FunctionService getViewModelService() {
        return functionService;
    }

    public PermissionService getPermissionService() {
        return permissionService;
    }
}
