瀏覽代碼

Merge branch 'http_mock' of git.xiaojukeji.com:jacklijiajia/thoth-frontend into http_mock

qinzhipeng_v 5 年之前
父節點
當前提交
808e41d5e8

+ 35 - 0
src/api/configure.js

@@ -107,3 +107,38 @@ export function deleteBiz(data) {
     data
   })
 }
+
+// 获取结构化模块列表
+export function queryBizModuleList(data) {
+  return request({
+    url: TeamManagement + `/setting/queryBizModuleList?bizId=` + data,
+    method: 'get'
+  })
+}
+
+// 添加模块
+export function addModule(data) {
+  return request({
+    url: TeamManagement + `/setting/addBizModule`,
+    method: 'post',
+    data
+  })
+}
+
+// 更新模块
+export function updateBizModule(data) {
+  return request({
+    url: TeamManagement + `/setting/updateBizModule`,
+    method: 'post',
+    data
+  })
+}
+
+// 删除模块
+export function deleteBizModule(data) {
+  return request({
+    url: TeamManagement + `/setting/deleteBizModule`,
+    method: 'post',
+    data
+  })
+}

+ 1 - 1
src/components/dialog/normalDialog.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="dialog-main">
-    <el-dialog :title="title" :visible.sync="visible">
+    <el-dialog :title="title" :visible.sync="visible" @close="cancel()">
       <slot />
       <span slot="footer" class="dialog-footer">
         <el-button @click="cancel()">取 消</el-button>

+ 2 - 2
src/icons/svg/Float_icon_二维码_蓝色.svg

@@ -9,8 +9,8 @@
 	<g id="thoth_homepage" transform="translate(-1393.000000, -1477.000000)">
 		<g id="float" transform="translate(1380.000000, 1462.000000)">
 			<g id="Float_icon_二维码_def" transform="translate(13.000000, 15.000000)">
-				<path id="Float_icon_二维码" class="st0" d="M99.7,477.8c0-126.5,0-252.8,0-379.5c126.1,0,251.8,0,378.3,0
-					c0,126.4,0,252.6,0,379.5C352,477.8,226.1,477.8,99.7,477.8z M409.9,F167c-81,0-161.2,0-241.2,0c0,81.2,0,161.7,0,242.2
+				<path id="	" class="st0" d="M99.7,477.8c0-126.5,0-252.8,0-379.5c126.1,0,251.8,0,378.3,0
+					c0,126.4,0,252.6,0,379.5C352,477.8,226.1,477.8,99.7,477.8z M409.9,167c-81,0-161.2,0-241.2,0c0,81.2,0,161.7,0,242.2
 					c80.7,0,160.6,0,241.2,0C409.9,328.4,409.9,248.1,409.9,167z M99.9,548.5c125.9,0,251.6,0,378.1,0c0,126.5,0,252.8,0,379.6
 					c-125.8,0-251.6,0-378.1,0C99.9,801.9,99.9,675.5,99.9,548.5z M409.9,617.4c-81,0-161.2,0-241.2,0c0,81.2,0,161.8,0,242.2
 					c80.7,0,160.7,0,241.2,0C409.9,778.8,409.9,698.6,409.9,617.4z M549.3,477.9c0-126.9,0-252.9,0-379.6c126.3,0,252.3,0,378.7,0

File diff suppressed because it is too large
+ 0 - 0
src/icons/svg/团队工作台.svg


+ 1 - 1
src/layout/components/Navbar.vue

@@ -128,7 +128,7 @@ export default {
       settingGetBizList({}).then(res => {
         this.sumTypeArray = res.data
         settingUserGetBiz().then(res => {
-          if (res.data.bizId) {
+          if (res.data) {
             this.sumTypeArray.map(item => {
               if (res.data.bizId === item.code) {
                 this.sumType = item.name

+ 77 - 70
src/router/index.js

@@ -60,27 +60,34 @@ export const constantRoutes = [{
   hidden: true
 },
 {
-  path: '/Platform/workbench',
-  name: '工作台',
+  path: '/Platform/workbench/person',
+  name: '个人工作台',
   component: Layout,
   redirect: '/Platform/workbench/person',
-  meta: { title: '工作台', icon: '工作台' },
+  meta: { title: '个人工作台', icon: '工作台' },
   children: [{
     path: 'person',
-    name: '个人工作台',
     component: () =>
           import('@/views/workbench/person/index.vue'),
     meta: { title: '个人工作台' }
-  },
-  {
-    path: 'team',
-    name: '团队工作台',
-    component: () =>
-          import('@/views/workbench/team/index.vue'),
-    meta: { title: '团队工作台' }
   }
   ]
 },
+{
+  path: '/Platform/workbench/team',
+  name: '团队工作台',
+  component: Layout,
+  redirect: '/Platform/workbench/team',
+  meta: { title: '团队工作台', icon: '团队工作台' },
+  children: [
+    {
+      path: 'team',
+      component: () =>
+          import('@/views/workbench/team/index.vue'),
+      meta: { title: '团队工作台' }
+    }
+  ]
+},
 {
   path: '/Platform/projectManage',
   name: '项目管理',
@@ -585,68 +592,68 @@ export const constantRoutes = [{
   children: [
     {
       path: 'configure',
-      name: '组织配置',
+      name: '配置',
       component: () =>
           import('@/views/ToConfigure/configure'),
-      meta: { title: '组织配置' }
-    },
-    {
-      path: 'systemSetup',
-      name: '系统设置',
-      component: () =>
-            import('@/views/Platform/setUp/systemSetup/testa'),
-      meta: { title: '系统设置' },
-      children: [{
-        path: 'bizPage',
-        name: '业务线',
-        component: () =>
-                import('@/views/Platform/setUp/systemSetup/bizPage'),
-        meta: { title: '业务线' }
-      },
-      {
-        path: 'platformPage',
-        name: '平台类型',
-        component: () =>
-                import('@/views/Platform/setUp/systemSetup/platformPage'),
-        meta: { title: '平台类型' }
-      },
-      {
-        path: 'modulePage',
-        name: '业务模块',
-        component: () =>
-                import('@/views/Platform/setUp/systemSetup/modulePage'),
-        meta: { title: '业务模块' }
-      },
-      {
-        path: 'projectPage',
-        name: '工程模块',
-        component: () =>
-                import('@/views/Platform/setUp/systemSetup/projectPage'),
-        meta: { title: '工程模块' }
-      },
-      {
-        path: 'confList',
-        name: '业务配置列表',
-        component: () =>
-                import('@/views/Platform/setUp/systemSetup/confList'),
-        meta: { title: '业务配置列表' }
-      },
-      {
-        path: 'addConf',
-        name: '新增配置',
-        component: () =>
-                import('@/views/Platform/setUp/systemSetup/addConf'),
-        meta: { title: '新增配置' }
-      }
-      ]
-    },
-    {
-      path: 'teamPage',
-      name: '团队设置',
-      component: () =>
-            import('@/views/Platform/setUp/teamPage'),
-      meta: { title: '团队设置' }
+      meta: { title: '配置' }
     }
+    // {
+    //   path: 'systemSetup',
+    //   name: '系统设置',
+    //   component: () =>
+    //         import('@/views/Platform/setUp/systemSetup/testa'),
+    //   meta: { title: '系统设置' },
+    //   children: [{
+    //     path: 'bizPage',
+    //     name: '业务线',
+    //     component: () =>
+    //             import('@/views/Platform/setUp/systemSetup/bizPage'),
+    //     meta: { title: '业务线' }
+    //   },
+    //   {
+    //     path: 'platformPage',
+    //     name: '平台类型',
+    //     component: () =>
+    //             import('@/views/Platform/setUp/systemSetup/platformPage'),
+    //     meta: { title: '平台类型' }
+    //   },
+    //   {
+    //     path: 'modulePage',
+    //     name: '业务模块',
+    //     component: () =>
+    //             import('@/views/Platform/setUp/systemSetup/modulePage'),
+    //     meta: { title: '业务模块' }
+    //   },
+    //   {
+    //     path: 'projectPage',
+    //     name: '工程模块',
+    //     component: () =>
+    //             import('@/views/Platform/setUp/systemSetup/projectPage'),
+    //     meta: { title: '工程模块' }
+    //   },
+    //   {
+    //     path: 'confList',
+    //     name: '业务配置列表',
+    //     component: () =>
+    //             import('@/views/Platform/setUp/systemSetup/confList'),
+    //     meta: { title: '业务配置列表' }
+    //   },
+    //   {
+    //     path: 'addConf',
+    //     name: '新增配置',
+    //     component: () =>
+    //             import('@/views/Platform/setUp/systemSetup/addConf'),
+    //     meta: { title: '新增配置' }
+    //   }
+    //   ]
+    // },
+    // {
+    //   path: 'teamPage',
+    //   name: '团队设置',
+    //   component: () =>
+    //         import('@/views/Platform/setUp/teamPage'),
+    //   meta: { title: '团队设置' }
+    // }
   ]
 },
 {

+ 180 - 34
src/views/ToConfigure/configure.vue

@@ -144,31 +144,82 @@
             </el-row>
             <div>
               <el-table
-                :data="tableData1"
+                ref="moduleTable"
+                :data="moduleData"
                 style="width: 100%;margin-bottom: 20px;"
                 row-key="id"
                 border
-                :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
+                :tree-props="{children: 'childModules', hasChildren: 'hasChildren'}"
+                :row-class-name="tableRowhidden"
               >
-                <el-table-column prop="date" label="模块名称" width="180" />
-                <el-table-column prop="name" label="创建人" width="180" />
-                <el-table-column prop="address" label="创建时间" />
+                <el-table-column v-if="false" prop="id" label="ID" width="180" />
+                <el-table-column prop="moduleName" label="模块名称" width="180">
+                  <template slot="header">
+                    模块名称<i class="el-icon-circle-plus" @click="handlerModule('add')" />
+                  </template>
+                </el-table-column>
+                <el-table-column prop="creator" label="创建人" width="180" />
+                <el-table-column prop="createTime" label="创建时间" />
                 <el-table-column label="操作">
                   <template slot-scope="scope">
                     <el-button
                       size="mini"
-                      @click="handleEdit(scope.$index, scope.row)"
+                      @click="handlerModule('add', scope.row, scope.$index)"
+                    >添加</el-button>
+                    <el-button
+                      size="mini"
+                      @click="handlerModule('edit', scope.row, scope.$index)"
                     >编辑</el-button>
                     <el-button
                       size="mini"
                       type="danger"
-                      @click="handleDelete(scope.$index, scope.row)"
+                      @click="handlerModule('delete', scope.row, scope.$index)"
                     >删除</el-button>
                   </template>
                 </el-table-column>
               </el-table>
             </div>
           </el-main>
+          <normal-dialog :show-dialog="moduleDialog" :title="moduleTitle" @confirm="confirmModule('moduleForm')" @cancel="moduleDialog=false">
+            <el-form ref="moduleForm" :model="moduleForm">
+              <template v-if="curcentModule === 'add'">
+                <el-form-item label="父模块:" :label-width="formLabelWidth">
+                  <el-col :span="11">{{ curcentParent }}</el-col>
+                </el-form-item>
+                <el-form-item
+                  v-for="(moduleName, index) in moduleForm.moduleNames"
+                  :key="index"
+                  label="模块名称:"
+                  :label-width="formLabelWidth"
+                  :prop="'moduleNames.' + index"
+                  :rules="[
+                    { required: true, message: '请输入模块名称', trigger: 'blur' },
+                    { min: 1, max: 20, message: '模块名称过长', trigger: 'blur' }
+                  ]"
+                >
+                  <el-col :span="11">
+                    <el-input v-model="moduleForm.moduleNames[index]" autocomplete="off" placeholder="不超过20个字符" />
+                  </el-col>
+                  <el-col v-show="index === moduleForm.moduleNames.length-1" :span="2" :offset="1">
+                    <i class="el-icon-circle-plus-outline" @click="addModuleForm()" />
+                  </el-col>
+                </el-form-item>
+              </template>
+              <template v-if="curcentModule === 'edit'">
+                <el-form-item label="父模块:" :label-width="formLabelWidth">
+                  <el-col :span="11">{{ curcentParent }}</el-col>
+                </el-form-item>
+                <el-form-item label="模块名称:" :label-width="formLabelWidth">
+                  <el-col :span="11">
+                    <el-input v-model="moduleForm.moduleNames[0]" autocomplete="off" placeholder="不超过20个字符" />
+                  </el-col>
+                </el-form-item>
+              </template>
+              <el-col v-if="curcentModule === 'delete'" :span="11">
+                是否要删除模块:<span style="color: #E6A23C">{{ moduleForm.moduleNames[0] }}</span>
+              </el-col>
+            </el-form>
+          </normal-dialog>
         </el-container>
       </div>
     </section>
@@ -176,7 +227,7 @@
 </template>
 <script>
 
-import { teamCreateTeam, memberQueryMemberInfoByIDAPorName, teamQueryTeamInfoList, configShowTeamAndMemberEnum, teamIsTeamNameRepetition, teamQueryTeamInfo, teamModifyTeam, getBizList, verifyIsAdmin, addBiz, updateBiz, deleteBiz } from '@/api/configure'
+import { teamCreateTeam, memberQueryMemberInfoByIDAPorName, teamQueryTeamInfoList, configShowTeamAndMemberEnum, teamIsTeamNameRepetition, teamQueryTeamInfo, teamModifyTeam, getBizList, verifyIsAdmin, addBiz, updateBiz, deleteBiz, queryBizModuleList, addModule, updateBizModule, deleteBizModule } from '@/api/configure'
 import normalDialog from '@/components/dialog/normalDialog'
 export default {
   name: 'PersonalWorkbench',
@@ -233,23 +284,13 @@ export default {
           { type: 'number', message: 'id必须为数字值' }
         ]
       },
-      tableData1: [{
-        id: 3,
-        date: '2016-05-01',
-        name: '王小虎',
-        address: '上海市普陀区金沙江路 1519 弄',
-        children: [{
-          id: 31,
-          date: '2016-05-01',
-          name: '王小虎',
-          address: '上海市普陀区金沙江路 1519 弄'
-        }, {
-          id: 32,
-          date: '2016-05-01',
-          name: '王小虎',
-          address: '上海市普陀区金沙江路 1519 弄'
-        }]
-      }]
+      moduleData: [], // 模块数据
+      moduleDialog: false, // 模块操作对话框
+      moduleTitle: '', // 模块对话框title
+      curcentModule: '', // 当前模块类型
+      curcentParent: '', // 当前模块父模块
+      curcentParentId: '', // 当前模块父模块ID
+      moduleForm: { bizId: null, moduleNames: [null], parentId: null, id: null } // 添加模块form
     }
   },
   created() {
@@ -454,6 +495,7 @@ export default {
           return { id: item.code, label: item.name }
         })
         this.curcentTreeData = this.treeData[0]
+        this.getQueryBizModuleList(this.curcentTreeData.id)
         this.$nextTick(() => {
           this.$refs.tree.setCurrentKey(this.treeData[0].id)
         })
@@ -484,8 +526,7 @@ export default {
             return false
           }
         })
-      }
-      if (this.curcentDialog === 'edit') {
+      } else if (this.curcentDialog === 'edit') {
         this.$refs[formName].validate((valid) => {
           if (valid) {
             this.editNodeTree(this.nodeForm)
@@ -494,8 +535,7 @@ export default {
             return false
           }
         })
-      }
-      if (this.curcentDialog === 'delete') {
+      } else if (this.curcentDialog === 'delete') {
         this.deteleNodeTree(this.nodeForm)
       }
     },
@@ -530,17 +570,114 @@ export default {
       }
     },
     handleNodeClick(data) { // 选择业务线
-      console.log(data)
       this.curcentTreeData = {
         id: data.id,
         label: data.label
       }
+      this.getQueryBizModuleList(this.curcentTreeData.id)
     },
-    handleEdit() {
-
+    async getQueryBizModuleList(bizId) { // 获取结构化模块列表
+      const res = await queryBizModuleList(bizId)
+      this.moduleData = res.data
     },
-    handleDelete() {
-
+    tableRowhidden(row, index) { // 隐藏处理
+      if (row.row.isDelete === 1) {
+        return 'hidden-row'
+      }
+      return ''
+    },
+    handlerModule(type, data, index) { // 模块处理
+      console.log(data)
+      this.moduleDialog = true
+      this.moduleTitle = '新增模块'
+      this.curcentModule = type
+      this.moduleForm = { bizId: null, moduleNames: [null], parentId: -1, id: null }// 初始化
+      this.curcentParent = '无'
+      if (data && type === 'add') {
+        this.curcentParent = data.moduleName
+        this.moduleForm.parentId = data.id
+      } else if (data && type === 'edit') {
+        this.moduleForm.id = data.id
+        this.curcentParent = data.parentId === -1 ? '无' : data.parentModuleName
+        this.moduleForm.parentId = data.parentId
+        this.moduleForm.moduleNames[0] = data.moduleName
+      } else if (data && type === 'delete') {
+        this.moduleForm.id = data.id
+        this.moduleForm.moduleNames[0] = data.moduleName
+      }
+    },
+    confirmModule(formName) { // 模块操作确认
+      if (this.curcentModule === 'add') {
+        this.$refs[formName].validate((valid) => {
+          if (valid) {
+            this.addModule(this.moduleForm)
+          } else {
+            this.$message({ message: '填写格式不正确', type: 'error' })
+            return false
+          }
+        })
+      } else if (this.curcentModule === 'edit') {
+        this.$refs[formName].validate((valid) => {
+          if (valid) {
+            this.updataModule(this.moduleForm)
+          } else {
+            this.$message({ message: '填写格式不正确', type: 'error' })
+            return false
+          }
+        })
+      } else if (this.curcentModule === 'delete') {
+        this.deleteModule(this.moduleForm)
+      }
+    },
+    addModuleForm() {
+      if (this.moduleForm.moduleNames.length <= 4) {
+        this.moduleForm.moduleNames.push(null)
+      }
+    },
+    async addModule(moduleForm) { // 添加模块
+      const form = {
+        bizId: this.curcentTreeData.id,
+        moduleNames: moduleForm.moduleNames,
+        parentId: moduleForm.parentId || -1
+      }
+      const res = await addModule(form)
+      if (res.code === 200) {
+        this.$message({ message: '添加成功', type: 'success' })
+        this.getQueryBizModuleList(this.curcentTreeData.id)// 重新获取模块列表
+        this.moduleDialog = false
+      } else {
+        this.$message({ message: res.msg, type: 'error' })
+      }
+    },
+    async updataModule(moduleForm) { // 更新模块
+      const form = {
+        id: moduleForm.id,
+        bizId: this.curcentTreeData.id,
+        moduleName: moduleForm.moduleNames[0],
+        parentId: moduleForm.parentId || -1
+      }
+      const res = await updateBizModule(form)
+      if (res.code === 200) {
+        this.$message({ message: '更新成功', type: 'success' })
+        this.getQueryBizModuleList(this.curcentTreeData.id)// 重新获取模块列表
+        this.moduleDialog = false
+      } else {
+        this.$message({ message: res.msg, type: 'error' })
+      }
+    },
+    async deleteModule(moduleForm) { // 删除模块
+      const form = {
+        id: moduleForm.id
+      }
+      const res = await deleteBizModule(form)
+      if (res.code === 200) {
+        this.$message({ message: '删除成功', type: 'success' })
+        this.moduleData = []// 初始化
+        this.getQueryBizModuleList(this.curcentTreeData.id)// 重新获取模块列表
+        this.moduleDialog = false
+      } else {
+        this.$message({ message: res.msg, type: 'error' })
+      }
     }
   }
 }
@@ -572,6 +709,7 @@ export default {
       width: 98%;
       overflow: auto;
       border-radius:4px;
+      background-color: white;
       .tab-line {
         width: 100%;
         display: inline-block;
@@ -610,6 +748,10 @@ export default {
     width: 82.7%;
     margin: 0 0 1.5% 1.5%;
     flex: 0 1 auto !important;
+    i {
+      margin-left: 5%;
+      color: rgb(64, 158, 255);
+    }
     .table-main{
       display: flex;
       align-items: center;
@@ -629,6 +771,10 @@ export default {
       align-items: center;
     }
   }
+  .el-table .hidden-row {
+    display: none;
+  }
+
   .el-popover {
     min-width: 100px !important;
   }

+ 8 - 8
src/views/workbench/person/calendarFormDialog.vue

@@ -36,9 +36,9 @@
             <el-select v-model="form.bizId" style="width: 100%">
               <el-option
                 v-for="item in businesslines"
-                :key="item.id"
-                :label="item.bizName"
-                :value="item.id"
+                :key="item.code"
+                :label="item.name"
+                :value="item.code"
               />
             </el-select>
           </el-form-item>
@@ -68,7 +68,7 @@
 
 <script>
 import workbenchApi from '@/api/workbench.js'
-import { queryBizTypeList } from '@/api/defectManage'
+import { settingGetBizList } from '@/api/defectManage'
 // import dayjs from 'dayjs'
 
 export default {
@@ -136,7 +136,7 @@ export default {
     }
   },
   mounted() {
-    this.queryBizTypeList()
+    this.settingGetBizList()
   },
   methods: {
     cancel() {
@@ -190,9 +190,9 @@ export default {
       this.dateFomat()
       return workbenchApi.updateSelfSchedule(this.form)
     },
-    queryBizTypeList() {
-      queryBizTypeList({}).then(res => {
-        this.businesslines = res.data.list
+    settingGetBizList() {
+      settingGetBizList({}).then(res => {
+        this.businesslines = res.data
       })
     }
   }

+ 49 - 22
src/views/workbench/team/index.vue

@@ -23,9 +23,9 @@
         >
           <el-option
             v-for="item in searchEnum.businesslines"
-            :key="item.id"
-            :label="item.bizName"
-            :value="item.id"
+            :key="item.code"
+            :label="item.name"
+            :value="item.code"
           />
         </el-select>
       </div>
@@ -75,6 +75,8 @@
         </el-col>
       </el-row>
       <gantt-elastic
+        v-if="ganttShow"
+        ref="ganttElastic"
         :tasks="tasks"
         :options="options"
       >
@@ -86,7 +88,7 @@
 
 <script>
 import workbenchApi from '@/api/workbench.js'
-import { queryBizTypeList } from '@/api/defectManage'
+import { settingGetBizList } from '@/api/defectManage'
 import GanttElastic from 'gantt-elastic'
 import GanttHeader from 'gantt-elastic-header'
 import dayjs from 'dayjs'
@@ -156,7 +158,7 @@ export default {
             {
               id: 2,
               label: '任务名称',
-              value: 'label',
+              value: 'labelName',
               width: 180,
               expander: true,
               style: {
@@ -169,7 +171,7 @@ export default {
             {
               id: 3,
               label: '开始时间',
-              value: task => dayjs(task.start).format('YYYY-MM-DD'),
+              value: 'startDate',
               width: 90,
               style: {
                 'task-list-header-label': {
@@ -185,7 +187,7 @@ export default {
             {
               id: 4,
               label: '结束时间',
-              value: task => dayjs(task.start + task.duration).format('YYYY-MM-DD'),
+              value: 'endDate',
               width: 90,
               style: {
                 'task-list-header-label': {
@@ -219,6 +221,7 @@ export default {
       }, // 甘特图配置
       ganttHeaderStyle: {
       },
+      colorList: ['rgba(255,82,0,0.5)', 'rgba(227,131,247,0.5)', 'rgba(68,190,255,0.5)', 'rgba(122,221,13,0.5)', 'rgba(245,108,108,0.5)'],
       radio1: '忙碌',
       radio2: '今天',
       radio2TF: true,
@@ -236,12 +239,13 @@ export default {
         businesslines: []
       },
       username: localStorage.getItem('username'),
-      teamWorkList: []
+      teamWorkList: [],
+      ganttShow: false
     }
   },
   mounted() {
     this.queryTeamInfoList(this.username)
-    this.queryBizTypeList()
+    this.settingGetBizList()
     this.queryTeamWorkList()
   },
   methods: {
@@ -268,13 +272,13 @@ export default {
         // this.radio2TF = !this.radio2TF
       }
       if (val === '月') {
-        this.$refs.ganttHeader.setScale(22)
+        this.$refs.ganttHeader.scale = 24
       }
       if (val === '周') {
-        this.$refs.ganttHeader.setScale(20)
+        this.$refs.ganttHeader.scale = 20
       }
       if (val === '日') {
-        this.$refs.ganttHeader.setScale(10)
+        this.$refs.ganttHeader.scale = 17
       }
     },
     queryTeamInfoList(username) {
@@ -289,13 +293,13 @@ export default {
         }
       })
     },
-    queryBizTypeList() {
-      queryBizTypeList({}).then(res => {
+    settingGetBizList() {
+      settingGetBizList({}).then(res => {
         if (res.data) {
-          this.searchEnum.businesslines = res.data.list
+          this.searchEnum.businesslines = res.data
           this.searchEnum.businesslines.unshift({
-            id: null,
-            bizName: '全部'
+            code: null,
+            name: '全部'
           })
         }
       })
@@ -321,6 +325,9 @@ export default {
       })
     },
     createTasks(res, mode) {
+      const today = new Date()
+      const colorlist = ['#A1DEFF', '#FAB5B5', '#BCED86', '#FFA87F', '#8E44AD', '#1EBC61', '#0287D0']
+      this.ganttShow = false
       this.tasks = []
       let count = 0
       for (const i in res.data) {
@@ -330,29 +337,49 @@ export default {
         } else {
           label = res.data[i].workNum.taskWorkNum + '个空闲时段'
         }
+        const color = colorlist[count % colorlist.length]
         const parentItem = {
           id: count++,
-          label: label,
+          labelName: label,
+          label: res.data[i].workNum.startTime && res.data[i].workNum.endTime ? label : '',
           user: res.data[i].userInfo.ldapName,
           collapsed: true,
+          progress: 0,
           needLegalAllDays: res.data[i].workNum.needDays + '/' + res.data[i].workNum.legalDays + '/' + res.data[i].workNum.allDays,
-          start: dayjs(res.data[i].workNum.startTime).toDate().getTime(),
-          duration: dayjs(res.data[i].workNum.endTime).toDate().getTime() - dayjs(res.data[i].workNum.startTime).toDate().getTime(),
-          type: 'task'
+          start: res.data[i].workNum.startTime ? dayjs(res.data[i].workNum.startTime).toDate().getTime() : today.getTime(),
+          duration: res.data[i].workNum.endTime ? dayjs(res.data[i].workNum.endTime).toDate().getTime() - dayjs(res.data[i].workNum.startTime).toDate().getTime() : 0,
+          startDate: res.data[i].workNum.startTime ? dayjs(res.data[i].workNum.startTime).format('YYYY-MM-DD') : '',
+          endDate: res.data[i].workNum.endTime ? dayjs(res.data[i].workNum.endTime).format('YYYY-MM-DD') : '',
+          type: 'task',
+          style: {
+            base: {
+              fill: color
+            }
+          }
         }
         this.tasks.push(parentItem)
         for (const j in res.data[i].workData) {
           const item = {
             id: count++,
             parentId: parentItem.id,
+            labelName: res.data[i].workData[j].name,
             label: res.data[i].workData[j].name,
             user: parentItem.user,
+            progress: 0,
             needLegalAllDays: res.data[i].workData[j].needDays + '/' + res.data[i].workData[j].legalDays + '/' + res.data[i].workData[j].allDays,
             start: dayjs(res.data[i].workData[j].startTime).toDate().getTime(),
             duration: dayjs(res.data[i].workData[j].endTime).toDate().getTime() - dayjs(res.data[i].workData[j].startTime).toDate().getTime(),
-            type: 'task'
+            startDate: dayjs(res.data[i].workData[j].startTime).format('YYYY-MM-DD'),
+            endDate: dayjs(res.data[i].workData[j].endTime).format('YYYY-MM-DD'),
+            type: 'task',
+            style: {
+              base: {
+                fill: color
+              }
+            }
           }
           this.tasks.push(item)
+          this.ganttShow = true
         }
       }
     }

Some files were not shown because too many files changed in this diff