DHTMLX Gantt甘特图的弹窗表单

361 阅读2分钟

参考链接:583.cn/article/164…

弹窗表单

//弹出层
gantt.config.lightbox.sections = [ {name: "text", height: 70, map_to: "text", type: "textarea", focus: true, width: "*" },{name: "time", height: 40, map_to: "auto", type: "duration", time_format: ["%Y", "%m", "%d"]},
{name: "projectClass", height: 30, map_to: "proTemplate", type: "template"},
{name: "head", height: 22, map_to: "head_id", type: "select", options:gantt.serverList('staff',[])},
{name: "description", height: 70, map_to: "description", type: "textarea" },
{name: "priority", height: 40, map_to: "priority", type: "radio", options:gantt.serverList("priority")}
];

点击+号或者双击表格行出现的弹窗 image.png

注意,默认gantt的图表都是全英文的,所以我们要进行汉化(上面的截图是汉化过的)

 gantt.locale = {
        date: {
          month_full: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"],
          month_short: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
          day_full: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
          day_short: ["日", "一", "二", "三", "四", "五", "六"]
        },
        labels: {
          dhx_cal_today_button: "今天",
          day_tab: "日",
          week_tab: "周",
          month_tab: "月",
          new_event: "新建日程",
          icon_save: "保存",
          icon_cancel: "关闭",
          icon_details: "详细",
          icon_edit: "编辑",
          icon_delete: "删除",
          confirm_closing: "请确认是否撤销修改!", //Your changes will be lost, are your sure?
          confirm_deleting: "是否删除计划?",
          section_description: "描述:",//section开头的都是弹窗的标题
          section_time: "时间范围:",
          section_type: "类型:",
          section_text: "计划名称:",
          section_taskProgress: "任务状态",
          section_test: "测试:",
          // 自定义属性汉化开始
          // section_projectClass: "项目类型:",
          // taskProjectType_0: "项目任务",
          // taskProjectType_1: "普通任务",
          // section_head: "负责人:",
          // section_priority: '优先级:',
          // taskProgress: '任务状态',
          // taskProgress_0: "未开始",
          // taskProgress_1: "进行中",
          // taskProgress_2: "已完成",
          // taskProgress_3: "已延期",
          // taskProgress_4: "搁置中",
          // 自定义属性汉化结束
          section_template: 'Details',
          /* grid columns */
          column_text: "计划名称",
          column_start_date: "开始时间",
          column_duration: "持续时间",
          column_add: "",
          column_priority: "难度",
          /* link confirmation */
          link: "关联",
          confirm_link_deleting: "将被删除",
          link_start: " (开始)",
          link_end: " (结束)",
          type_task: "任务",
          type_project: "项目",
          type_milestone: "里程碑",


          minutes: "分钟",
          hours: "小时",
          days: "天",
          weeks: "周",
          months: "月",
          years: "年"
        }
      }