hino / app / controllers / approval-input-configuration / detail.js
detail.js
Raw
import Controller from '@ember/controller';
import { inject as service } from '@ember/service';

export default Controller.extend({
	approvalInputConfiguration : service(),
	approvalInputConfigurationData : service(),
	approvalInputConfigurationDetailData : service(),
	approvalInputConfigurationDetailActionData : service(),
	errors : service(),

	init() {
		this._super(...arguments);
		this.table = {
			mode: "list",
			model: "approval-input-configuration-detail",
			columns: [
			{
				name: 'Form',
				key: 'form.name',
			},
			{
				name: 'Field',
				key: 'field.name',
			},
			] 
		};
		this.tableAction = {
			mode: "list",
			model: "approval-input-configuration-detail-action",
			columns: [
			{
				name: 'Form',
				key: 'form.name',
				uri: "approval-input-configuration-detail-action.detail",
				editUri: "approval-input-configuration-detail-action.edit"
			},
			{
				name: 'Approve',
				key: 'isShowApprove',
			},
			{
				name: 'Reject',
				key: 'isShowReject',
			},
			{
				name: 'Revise',
				key: 'isShowRevise',
			},
			{
				name: 'Accept',
				key: 'isShowAccept',
			},
			// {
			// 	name: 'Repropose',
			// 	key: 'isShowRepropose',
			// },
			] 
		};
	},

	actions: {
		scrollTo(fragmentIdLink) {
			document.querySelector(`#${fragmentIdLink}`).scrollIntoView({
				behavior: 'smooth',
				block: "start",
				inline: "start"
			});
		}
	}
});