国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

甘特圖 Dhtmlx Gantt

這篇具有很好參考價值的文章主要介紹了甘特圖 Dhtmlx Gantt。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

介紹
在一些任務計劃、日程進度等場景中我們會使用到甘特圖,Dhtmlx Gantt 對于甘特圖的實現(xiàn)支持很友好,文檔API介紹全面,雖然增強版的收費,但免費版的足以夠用。
官網(wǎng):https://docs.dhtmlx.com/gantt/
安裝dhtml gannt插件

npm install dhtmlx-gantt

引入插件

//頁面引入,如果多個頁面使用可以全局引入
import { gantt } from 'dhtmlx-gantt';
import 'dhtmlx-gantt/codebase/dhtmlxgantt.css';

頁面代碼

<template>
    <div class="gantt-box" ref="ganttRef"></div>
</template>

<script setup>
import { gantt } from 'dhtmlx-gantt';
import 'dhtmlx-gantt/codebase/dhtmlxgantt.css';
import { onMounted, ref } from 'vue';
const ganttRef = ref(null);
const data = {
    data: [
        {
            id: 1,
            text: 'projectName',
            start_date: '01-04-2023',
            end_date: '05-12-2023',
            duration: 248,
            progress: 0.3,
            open: true,
            color: '#b38989'
        },
        {
            id: 2,
            text: '任務1',
            start_date: '02-04-2023',
            end_date: '11-07-2023',
            duration: 100,
            progress: 0.6,
            parent: 1
        },
        {
            id: 3,
            text: '任務2',
            start_date: '12-07-2023',
            end_date: '09-09-2023',
            duration: 59,
            progress: 0,
            parent: 1
        }
    ],
    links: [
        { id: 1, source: 1, target: 2, type: '1' },
        { id: 2, source: 2, target: 3, type: '0' }
    ]
};
const columns = [
    { name: 'text', label: '項目名稱', tree: true, min_width: 140 },
    { name: 'start_date', label: '開始時間', min_width: 100 },
    { name: 'end_date', label: '結(jié)束時間', min_width: 100 },
    { name: 'duration', label: '計劃工期' },
    { name: 'add', label: '' }
];
const initGantt = () => {
    // 清空之前的配置
    gantt.clearAll();

    gantt.i18n.setLocale('cn'); // 設置中文
    gantt.config.readonly = true; // 設置為只讀

    gantt.plugins({
        tooltip: true,
        quick_info: true // 快速信息框
        // multiselect: true,// 激活多任務選擇
    });
    gantt.config.show_quick_info = true;

    gantt.config.tooltip_offset_x = 10;
    gantt.config.tooltip_offset_y = 30;

    // gantt.config.open_split_tasks = false;
    gantt.config.details_on_create = true; // 創(chuàng)建新事件通過點擊“+”按鈕打開燈箱
    gantt.config.autofit = true; // 甘特圖圖表寬度自適應
    // gantt.config.resize_rows = true; // 用戶可以通過拖拽調(diào)整行高

    // 圖表項目欄可以任意拖拽(任意節(jié)點下)
    gantt.config.order_branch = false;
    gantt.config.order_branch_free = false;

    gantt.config.placeholder_task = false; // 新增空白列后新增項目

    gantt.config.scale_height = 50;

    gantt.config.show_links = true; //是否顯示依賴連線

    gantt.config.sort = false; // 點擊表頭可排序

    gantt.config.row_height = 40; //設置行高

    gantt.config.drag_project = true;

    gantt.config.scales = [
        // 設置時間刻度相關屬性

        // 顯示月日用這個
        // { unit: 'month', step: 1, format: '%Y-%m' },
        // { unit: 'day', step: 1, format: '%Y-%m-%d' }

        // 顯示年月用這個
        { unit: 'year', step: 1, format: '%Y' },
        { unit: 'month', step: 1, format: '%M' }
    ];
    // gantt.config.start_date = new Date(
    //     `${new Date().getFullYear() - 1},${new Date().getMonth()},${new Date().getDay()}`
    // );
    // gantt.config.end_date = new Date(`${new Date().getFullYear() + 1},${new Date().getMonth()},${new Date().getDay()}`);
    // gantt.config.show_tasks_outside_timescale = true;

    gantt.config.auto_scheduling = true;

    // 配置Gantt內(nèi)置彈出框內(nèi)容
    gantt.templates.lightbox_header = function (start_date, end_date, task) {
        return `<b>${task.text}</b>`;
    };
    gantt.config.lightbox.sections = [
        {
            name: 'description',
            height: 36,
            map_to: 'text',
            type: 'textarea',
            focus: true
        },
        { name: 'time', type: 'duration', map_to: 'auto' },
        {
            name: 'Participants',
            height: 36,
            map_to: 'Participants',
            type: 'ParticipantsPlan',
            focus: true
        },
        {
            name: 'BgColor',
            height: 36,
            map_to: 'color',
            type: 'ParticipantsPlanColor',
            focus: true
        }
    ];

    gantt.templates.tooltip_text = function (start, end, task) {
        return (
            task.text +
            '<br/><span>開始:</span> ' +
            gantt.templates.tooltip_date_format(start) +
            '<br/><span>結(jié)束:</span> ' +
            gantt.templates.tooltip_date_format(end) +
            '<br/><span>進度:</span> ' +
            Math.round(task.progress * 100) +
            '%'
        );
    };
    gantt.config.bar_height = 30;
    // 自定義信息彈窗class
    gantt.templates.quick_info_class = function () {
        return 'default-quick-info';
    };
    // 自定義信息彈窗頭部class
    gantt.templates.grid_header_class = function () {
        return 'progress-header';
    };
    gantt.templates.quick_info_content = function (start, end, task) {
        return `
                    <div>
                        ${task.text}<br/>
                        計劃開始 : ${gantt.templates.tooltip_date_format(start)}<br/>
                        計劃結(jié)束:${gantt.templates.tooltip_date_format(end)}<br/>
                        進度 : ${Math.round(task.progress * 100) + '%'}<br/>
                        狀態(tài) :
                    </div>
                `;
    };
    // 設置樹形列的父項圖標
    gantt.templates.grid_folder = function () {
        return '';
    };
    // 設置樹形列的子項圖標
    gantt.templates.grid_file = function () {
        return '';
    };

    // 自定義進度條上的文本
    gantt.templates.task_text = function (start, end, task) {
        return `
            <span style="margin-left:10px;color:white;">${task.progress * 100}%</span>
          `;
    };

    // 自定義progress_text內(nèi)容
    gantt.templates.progress_text = function () {
        // return "<span style='text-align:left;'>" + Math.round(task.progress * 100) + '% </span>';
        return '';
    };

    gantt.config.columns = columns;
    // 初始化甘特圖
    gantt.init(ganttRef.value);
    // 渲染數(shù)據(jù)
    gantt.parse(data);
};

onMounted(() => {
    initGantt();
});
</script>

<style lang="less" scoped>
.gantt-box {
    width: 1000px;
    height: 400px;
}
// /deep/.default-quick-info {
//     background-color: aqua;
// }
</style>

效果
甘特圖 Dhtmlx Gantt,vue3+vite,其他,甘特圖,vue.js,前端文章來源地址http://www.zghlxwxcb.cn/news/detail-612868.html

到了這里,關于甘特圖 Dhtmlx Gantt的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權(quán),不承擔相關法律責任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實不符,請點擊違法舉報進行投訴反饋,一經(jīng)查實,立即刪除!

領支付寶紅包贊助服務器費用

相關文章

  • 甘特圖組件DHTMLX Gantt用例 - 如何拆分任務和里程碑項目路線圖

    甘特圖組件DHTMLX Gantt用例 - 如何拆分任務和里程碑項目路線圖

    創(chuàng)建一致且引人注意的視覺樣式是任何項目管理應用程序的重要要求,這就是為什么我們會在這個系列中繼續(xù)探索DHTMLX Gantt圖庫的自定義。在本文中我們將考慮一個新的甘特圖定制場景,DHTMLX Gantt組件如何創(chuàng)建一個項目路線圖。 DHTMLX Gantt正式版下載 用例 - 帶有自定義時間尺

    2024年02月05日
    瀏覽(32)
  • 甘特圖工具DHTMLX Gantt 8.0搶先看, 改進的資源管理、更新的自動計劃等功能,一起查閱吧

    甘特圖工具DHTMLX Gantt 8.0搶先看, 改進的資源管理、更新的自動計劃等功能,一起查閱吧

    DHTMLX Gantt是用于跨瀏覽器和跨平臺應用程序的功能齊全的Gantt圖表。可滿足項目管理應用程序的大部分開發(fā)需求,具備完善的甘特圖圖表庫,功能強大,價格便宜,提供豐富而靈活的JavaScript API接口,與各種服務器端技術(PHP,ASP.NET,Java等)簡單集成,滿足多種定制開發(fā)需求

    2023年04月08日
    瀏覽(30)
  • 在vue中element ui 結(jié)合frappe-gantt實現(xiàn)一個簡單的甘特圖功能

    在vue中element ui 結(jié)合frappe-gantt實現(xiàn)一個簡單的甘特圖功能

    在vue中創(chuàng)建甘特圖步驟請參考: https://editor.csdn.net/md/?articleId=130145782 實現(xiàn)效果: 2.1 下載element ui 因為我是在vue3中,所以下載element-plus 執(zhí)行 npm i element-plus --save main.js 里引入element ui 2.2. 創(chuàng)建Gantt.vue組件 這樣就可以實現(xiàn)一個簡單的功能了。

    2024年02月12日
    瀏覽(24)
  • vue2實現(xiàn)可拖拽甘特圖(結(jié)合element-ui的gantt圖)

    vue2實現(xiàn)可拖拽甘特圖(結(jié)合element-ui的gantt圖)

    ? 接到公司需求,要做一個可拖拽的甘特圖來實現(xiàn)排期需求,官方的插件要付費還沒有中文的官方文檔可以看,就去找了各種開源的demo來看,功能上都不是很齊全,于是總結(jié)了很多demo,合在一起組成了一版較為完整的滿足需求的甘特圖。 1.拖拽? 拖拽功能是甘特圖的主要功

    2024年02月03日
    瀏覽(22)
  • DHTMLX Gantt入門使用教程【引入】:如何開始使用 dhtmlxGantt

    DHTMLX Gantt入門使用教程【引入】:如何開始使用 dhtmlxGantt

    DHTMLX Gantt是用于跨瀏覽器和跨平臺應用程序的功能齊全的Gantt圖表??蓾M足項目管理應用程序的大部分開發(fā)需求,具備完善的甘特圖圖表庫,功能強大,價格便宜,提供豐富而靈活的JavaScript API接口,與各種服務器端技術(PHP,ASP.NET,Java等)簡單集成,滿足多種定制開發(fā)需求

    2023年04月14日
    瀏覽(111)
  • DHTMLX JavaScript Gantt Chart 8.0.5 Crack

    DHTMLX JavaScript Gantt Chart 8.0.5 Crack

    8.0.5 September 1, 2023. Bugfix release Fixes Fix incorrect warnings triggered by enabling extensions via the gantt.getGanttInstance configuration Fix the incorrect work of gantt.exportToExcel() when the skip_off_time config is enabled Improvements for the Samples Viewer Comprehensive JavaScript HTML5 Gantt Chart DHTMLX Gantt is the most complete Gantt chart

    2024年02月07日
    瀏覽(20)
  • vue3創(chuàng)建項目,vite+js

    vue3創(chuàng)建項目,vite+js

    之前的時候大哥就讓我自己搭架子,但是我拖延癥,現(xiàn)在用到了,得自己搭了 我的項目都放到了 VuePorjects這個目錄里面, 一、先進入到指定工作目錄,(不是你要創(chuàng)建的項目的名稱哈) 二、創(chuàng)建vue3項目,安裝創(chuàng)建項目 ?@latest是項目名稱,可以自己修改項目名稱,然后選擇

    2024年02月16日
    瀏覽(27)
  • Vue3+Vite前端知識匯總1篇

    Vue3+Vite前端知識匯總1篇

    ?? 目錄 1、設置package.json,讓編譯完成后自動打開瀏覽器。 2、設置vite.config.ts,設置src別名,后面就不用 ../../../ 了。 3、安裝@types/node? 解決vscode顯示紅波浪線問題。 ?4、安裝 sass和reset.css 5、創(chuàng)建并引入全局組件,HospitalTop 6、安裝路由,并添加切換路由后滾動到頂部功能

    2024年02月16日
    瀏覽(57)
  • 前端VUE3+Vite +UniAPP-- 框架搭建

    前端VUE3+Vite +UniAPP-- 框架搭建

    除了HBuilderX可視化界面,也可以使用 cli 腳手架,可以通過 vue-cli 創(chuàng)建 uni-app 項目。 全局安裝 vue-cli 官網(wǎng) 配置tailwindcss插件 官網(wǎng) 在 tailwind.config.js 配置文件中添加所有模板文件的路徑。 將加載 Tailwind 的指令添加到你的 CSS 文件中 在你的主 CSS 文件中通過 @tailwind 指令添加每一

    2024年02月11日
    瀏覽(17)
  • Vite + Vue3 實現(xiàn)前端項目工程化

    Vite + Vue3 實現(xiàn)前端項目工程化

    Vue3 發(fā)布至今,周邊的生態(tài)、技術方案已足夠成熟,個人認為新項目是時候切換到 Vite + Vue3 了。今天就給大家操作一下這種技術方案實現(xiàn)前端工程化。 數(shù)字化管理平臺 Vue3+Vite+VueRouter+Pinia+Axios+ElementPlus Vue權(quán)限系統(tǒng)案例 個人博客 通過官方腳手架初始化項目 第一種方式,這是使

    2024年02月03日
    瀏覽(94)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領取紅包,優(yōu)惠每天領

二維碼1

領取紅包

二維碼2

領紅包