scorpio hace 2 años
padre
commit
ba32883d49

+ 66 - 24
src/views/task/Index.vue

@@ -1,13 +1,30 @@
 <template>
-  <basic-container class='margin'>
-    <el-tabs type="card" @tab-change='taskChange'>
-      <el-tab-pane label="我的任务">
-      </el-tab-pane>
-      <el-tab-pane label="我下发的任务"/>
-    </el-tabs>
-    <my-task v-if='currentTab === "0"'></my-task>
-    <task v-if='currentTab === "1"'></task>
-  </basic-container>
+  <el-card shadow="hover" class="margin">
+    <div class="full-width flex flex-center flex-justify-start">
+      <el-button-group>
+        <el-button type="primary" icon="el-icon-edit">全部任务</el-button>
+        <el-button type="primary" plain icon="el-icon-share"
+          >我创建的
+        </el-button>
+        <el-button type="primary" plain icon="el-icon-delete"
+          >我执行的
+        </el-button>
+      </el-button-group>
+    </div>
+    <div class="flex flex-center flex-justify-start flex-col full-width">
+      <div class="full-width flex flex-justify-start">
+        <span>按时间排序</span>
+      </div>
+      <div class="full-width">
+        <task-table
+          :option="option"
+          :data="data"
+          @rowClick="rowClick"
+        ></task-table>
+      </div>
+      <task ref="task" :task="task"></task>
+    </div>
+  </el-card>
 </template>
 
 <route>
@@ -17,31 +34,56 @@ name: '任务列表'
 </route>
 
 <script>
-import BasicContainer from '@/components/basic-container/main.vue'
-import MyTask from '@/views/task/component/my-task.vue'
+import TaskTable from '@/views/task/component/task-table.vue'
 import Task from '@/views/task/component/task.vue'
 
 export default {
   name: 'Index',
-  components: { Task, MyTask, BasicContainer },
-  data () {
+  components: { Task, TaskTable },
+  data() {
     return {
-      currentTab: '0',
-      taskShow: false,
-      showFolder: false,
-      form: {},
-      data: [],
-      taskFolder: []
+      data: [
+        {
+          title: '项目建议书编写,需要快点'
+        },
+        {
+          title: '项目建议书编写,需要快点'
+        }
+      ],
+      task: [],
+      option: {
+        showCheckBox: false,
+        folderChecked: true,
+        column: [
+          {
+            label: '共20个任务',
+            prop: 'title',
+            display: false,
+            width: 400
+          },
+          {
+            label: '标签',
+            prop: 'createUserName'
+          },
+          {
+            label: '时间',
+            prop: 'createUserName'
+          },
+          {
+            label: '执行人',
+            prop: 'createTime'
+          }
+        ]
+      }
     }
   },
   methods: {
-    taskChange (res) {
-      this.currentTab = res
+    rowClick(item) {
+      this.task = item
+      this.$refs.task.show()
     }
   }
 }
 </script>
 
-<style scoped>
-
-</style>
+<style scoped></style>

+ 0 - 171
src/views/task/component/my-task.vue

@@ -1,171 +0,0 @@
-<template>
-  <avue-crud
-      :option="option"
-      :data="data"
-      ref="crud"
-      v-model="form"
-      v-model:page="page"
-      :before-open="beforeOpen"
-      @row-del="rowDel"
-      @current-change="currentChange"
-      @size-change="sizeChange"
-      @refresh-change="refreshChange"
-      @on-load="onLoad">
-    <template #menu-left="{}">
-      <el-button-group>
-        <el-button type='primary' :plain='query.type !== "0" ' @click='changeQueryType("0")'>待完成</el-button>
-        <el-button type='primary' :plain='query.type !== "1" ' @click='changeQueryType("1")'>已完成</el-button>
-        <el-button type='primary' :plain='query.type !== "" ' @click='changeQueryType("")'>全部</el-button>
-      </el-button-group>
-    </template>
-    <!--    <template #menu="{row}">-->
-    <!--      <el-button type='primary' text icon='Position' @click='changeQueryType("0")'>提交</el-button>-->
-    <!--    </template>-->
-  </avue-crud>
-</template>
-
-<script>
-export default {
-  name: 'my-task',
-  data() {
-    return {
-      query: {
-        type: '0'
-      },
-      page: {
-        pageSize: 10,
-        currentPage: 1,
-        total: 10
-      },
-      data: [],
-      form: {},
-      option: {
-        align: 'center',
-        menuAlign: 'center',
-        menuWidth: 260,
-        size: 'mini',
-        addBtn: false,
-        viewBtn: true,
-        editBtn: false,
-        delBtn: false,
-        refreshBtn: false,
-        columnBtn: false,
-        labelWidth: 140,
-        border: true,
-        column: [
-          {
-            label: '任务名称',
-            prop: 'title'
-          },
-          {
-            label: '任务要求',
-            prop: 'remark'
-          },
-          {
-            label: '所属项目',
-            prop: 'projectName'
-          },
-          {
-            label: '下发人',
-            prop: 'dispatcherUserName'
-          },
-          {
-            label: '下发时间',
-            prop: 'createTime'
-          },
-          {
-            label: '任务截止时间',
-            prop: 'taskEndTime'
-          },
-          {
-            label: '任务状态',
-            prop: 'isCompleted',
-            type: 'select',
-            dicData: [
-              {
-                label: '待完成',
-                value: 0
-              },
-              {
-                label: '已完成',
-                value: 1
-              }
-            ]
-          },
-          {
-            label: '是否确认',
-            prop: 'isConfirmed',
-            type: 'select',
-            dicData: [
-              {
-                label: '待确认',
-                value: 0
-              },
-              {
-                label: '已确认',
-                value: 1
-              }
-            ]
-          }
-        ]
-      }
-    }
-  },
-  methods: {
-    onLoad() {
-      this.loading = true
-      this.page.current = this.page.currentPage
-      this.page.size = this.page.pageSize
-      this.$api.task.taskList(Object.assign(this.page, this.query)).then(res => {
-        this.loading = false
-        if (res.code === 200) {
-          this.data = res.data.records
-          this.page.total = res.data.total
-        }
-      })
-    },
-    beforeOpen(done, type) {
-      if (type === 'view') {
-        this.$router.push({path: '/task/detail', query: {id: this.form.id, taskId: this.form.taskId}})
-      } else {
-        done()
-      }
-    },
-    currentChange(currentPage) {
-      this.page.currentPage = currentPage
-    },
-    sizeChange(pageSize) {
-      this.page.size = pageSize
-    },
-    refreshChange() {
-      this.onLoad()
-    },
-    rowDel(row) {
-      this.$confirm('确定彻底删除所选择的文件?', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      })
-          .then(() => {
-            this.$api.recycle.recycleRemove({ids: row.id}).then(res => {
-              if (res.code === 200) {
-                this.$message.success(res.msg)
-                this.onLoad()
-              } else {
-                this.$message.error(res.msg)
-              }
-            })
-          })
-    },
-    changeQueryType(type) {
-      this.query.type = type
-      this.onLoad()
-    }
-
-  }
-}
-</script>
-
-<style scoped>
-
-</style>

+ 127 - 0
src/views/task/component/task-table.vue

@@ -0,0 +1,127 @@
+<template>
+  <div>
+    <div class="header flex flex-justify-between full-width">
+      <div
+        v-for="(item, index) in option.column"
+        :key="item.label"
+        class="full-width"
+      >
+        <div
+          v-if="index === 0"
+          class="flex-child-shrink flex flex-justify-start first"
+        >
+          {{ item.label }}
+        </div>
+        <div v-else class="flex-child-average">
+          {{ item.label }}
+        </div>
+      </div>
+    </div>
+    <div class="content full-width">
+      <div
+        v-for="row in data"
+        :key="row.id"
+        class="flex flex-center full-width row"
+        @click="rowClick(row)"
+      >
+        <div
+          v-for="(column, index) in option.column"
+          :key="column.label"
+          class="full-width full-height"
+        >
+          <div
+            v-if="index === 0"
+            class="first full-height flex flex-center flex-justify-start"
+          >
+            <div
+              class="full-width full-height flex flex-justify-start flex-align-center"
+            >
+              <div class="level" />
+              <wt-tag />
+              {{ row[column.prop] }}
+            </div>
+          </div>
+          <div
+            v-else-if="index === 1"
+            class="flex-child-average full-height full-width flex flex-center"
+          >
+            <div>
+              <el-tag>新编</el-tag>
+              <el-tag class="ml-5">项目建议书</el-tag>
+            </div>
+          </div>
+          <div
+            v-else-if="index === 2"
+            class="flex-child-average full-height full-width flex flex-center"
+          >
+            <div>
+              <div>08-14 截止</div>
+            </div>
+          </div>
+          <div
+            v-else
+            class="flex-child-average full-height full-width flex flex-center"
+          >
+            <el-avatar
+              src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"
+            />
+            <el-avatar
+              src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"
+            /><el-avatar
+              src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"
+            />
+          </div>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import WtTag from '@/views/task/component/wt-tag.vue'
+
+export default {
+  components: { WtTag },
+  props: {
+    data: {
+      type: Array,
+      default: []
+    },
+    option: {
+      type: Object,
+      default: null
+    }
+  },
+  methods: {
+    rowClick(item) {
+      this.$emit('rowClick', item)
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.header {
+  border-bottom: #f7f8fa solid 1px;
+  padding: 10px 0;
+}
+
+.first {
+  width: 600px;
+}
+
+.row {
+  height: 60px;
+  border-bottom: #f7f8fa solid 1px;
+}
+.row:hover {
+  height: 60px;
+  background-color: #f7f9fc;
+}
+.level {
+  width: 5px;
+  height: 100%;
+  margin-right: 10px;
+  background-color: red;
+}
+</style>

+ 129 - 170
src/views/task/component/task.vue

@@ -1,188 +1,147 @@
 <template>
-  <avue-crud
-      :option="option"
-      :data="data"
-      ref="crud"
-      v-model="form"
-      v-model:page="page"
-      :before-open="beforeOpen"
-      @row-del="rowDel"
-      @current-change="currentChange"
-      @size-change="sizeChange"
-      @refresh-change="refreshChange"
-      @on-load="onLoad">
-    <template #menu-left="{}">
-      <el-button-group>
-        <el-button type='primary' :plain='query.type !== "0" ' @click='changeQueryType("0")'>待完成</el-button>
-        <el-button type='primary' :plain='query.type !== "1" ' @click='changeQueryType("1")'>已完成</el-button>
-        <el-button type='primary' :plain='query.type !== "" ' @click='changeQueryType("")'>全部</el-button>
-      </el-button-group>
+  <el-dialog v-model="showDialog">
+    <template #header>
+      <div class="full-width flex flex-center flex-justify-between">
+        <h4>任务详情</h4>
+      </div>
     </template>
-    <template #menu="{row}">
-      <el-button type='primary' text icon='CircleCheck' @click='taskCheck(row)'>确认</el-button>
-    </template>
-  </avue-crud>
+    <div>
+      <el-input v-model="form.title"></el-input>
+      <div class="mt-10">
+        <div class="flex flex-center flex-justify-start">
+          <span class="mr-10 title flex flex-justify-start">状态:</span>
+          <wt-tag :data="data" />
+        </div>
+
+        <div class="mt-10 flex flex-center flex-justify-start">
+          <span class="mr-10 title flex flex-justify-start">优先级:</span>
+          <wt-tag :data="data1" />
+        </div>
+
+        <div class="mt-10 flex flex-center flex-justify-start">
+          <span class="mr-10 title flex flex-justify-start">时间:</span>
+          <div class="flex flex-center">
+            <el-date-picker
+              v-model="value1"
+              type="date"
+              placeholder="设置开始日期"
+            >
+            </el-date-picker>
+            <div class="ml-5 mr-5">至</div>
+            <el-date-picker
+              v-model="value1"
+              type="date"
+              placeholder="设置截止日期"
+            >
+            </el-date-picker>
+          </div>
+        </div>
+
+        <div class="mt-10 flex flex-center flex-justify-start">
+          <span class="mr-10 title flex flex-justify-start">执行者:</span>
+          <div><tasker /></div>
+        </div>
+      </div>
+    </div>
+  </el-dialog>
 </template>
 
 <script>
+import WtTag from '@/views/task/component/wt-tag.vue'
+import Tasker from '@/views/task/component/tasker.vue'
+
 export default {
-  name: 'my-task',
-  data () {
-    return {
-      query: {
-        type: '0'
-      },
-      page: {
-        pageSize: 10,
-        currentPage: 1,
-        total: 10
+  components: { Tasker, WtTag },
+  props: {
+    task: {
+      type: Object,
+      default: {}
+    }
+  },
+  watch: {
+    task: {
+      handler(val) {
+        this.form = val
       },
-      data: [],
-      form: {},
-      option: {
-        align: 'center',
-        menuAlign: 'center',
-        menuWidth: 260,
-        size: 'mini',
-        addBtn: false,
-        viewBtn: true,
-        editBtn: false,
-        delBtn: false,
-        refreshBtn: false,
-        columnBtn: false,
-        labelWidth: 140,
-        border: true,
-        column: [
-          {
-            label: '任务名称',
-            prop: 'title'
-          },
-          {
-            label: '任务要求',
-            prop: 'remark'
-          },
-          {
-            label: '所属项目',
-            prop: 'projectName'
-          },
-          {
-            label: '接收人',
-            prop: 'dispatcherToUserName'
-          },
-          {
-            label: '下发时间',
-            prop: 'createTime'
-          },
-          {
-            label: '任务截止时间',
-            prop: 'taskEndTime'
-          },
-          {
-            label: '任务状态',
-            prop: 'isCompleted',
-            type: 'select',
-            dicData: [
-              {
-                label: '待完成',
-                value: 0
-              },
-              {
-                label: '已完成',
-                value: 1
-              }
-            ]
-          },
-          {
-            label: '是否确认',
-            prop: 'isConfirmed',
-            type: 'select',
-            dicData: [
-              {
-                label: '待确认',
-                value: 0
-              },
-              {
-                label: '已确认',
-                value: 1
-              }
-            ]
-          }
-        ]
-      }
+      immediate: true
     }
   },
-  methods: {
-    onLoad () {
-      this.loading = true
-      this.page.current = this.page.currentPage
-      this.page.size = this.page.pageSize
-      this.$api.task.issuedRecords(Object.assign(this.page, this.query)).then(res => {
-        this.loading = false
-        if (res.code === 200) {
-          this.data = res.data.records
-          this.page.total = res.data.total
+  data() {
+    return {
+      showDialog: false,
+      form: null,
+      data: [
+        {
+          title: '待确认',
+          value: 0,
+          color: '#D7D7D7'
+        },
+        {
+          title: '进行中',
+          value: 1,
+          color: '#47A6EA'
+        },
+        {
+          title: '已完成',
+          value: 2,
+          color: '#80B336'
+        },
+        {
+          title: '已关闭',
+          value: 3,
+          color: '#ECAB56'
+        },
+        {
+          title: '已取消',
+          value: 4,
+          color: '#C72A29'
         }
-      })
-    },
-    beforeOpen (done, type) {
-      if (type === 'view') {
-        this.$router.push({ path: '/task/detail', query: { id: this.form.id, taskId: this.form.taskId, view: true } })
-      } else {
-        done()
-      }
-    },
-    currentChange (currentPage) {
-      this.page.currentPage = currentPage
-    },
-    sizeChange (pageSize) {
-      this.page.size = pageSize
-    },
-    refreshChange () {
-      this.onLoad()
-    },
-    rowDel (row) {
-      this.$confirm('确定彻底删除所选择的文件?', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      })
-        .then(() => {
-          this.$api.recycle.recycleRemove({ ids: row.id }).then(res => {
-            if (res.code === 200) {
-              this.$message.success(res.msg)
-              this.onLoad()
-            } else {
-              this.$message.error(res.msg)
-            }
-          })
-        })
-    },
-    changeQueryType (type) {
-      this.query.type = type
-      this.onLoad()
-    },
-    taskCheck (row) {
-      if (row.isCompleted === 0) {
-        this.$message.error('该任务尚未完成,不能进行确认!')
-        return
-      }
-      if (row.isConfirmed === 1) {
-        this.$message.error('该任务已经确认!')
-        return
-      }
-      this.$api.task.taskConfirm({ taskId: row.taskId }).then(res => {
-        if (res.code === 200) {
-          this.$message.success(res.msg)
-          this.onLoad()
-        } else {
-          this.$message.error(res.msg)
+      ],
+      data1: [
+        {
+          title: 'P1',
+          value: 0,
+          color: '#C72A29'
+        },
+        {
+          title: 'P2',
+          value: 1,
+          color: '#E89D42'
+        },
+        {
+          title: 'P3',
+          value: 2,
+          color: '#47A6EA'
+        },
+        {
+          title: 'P4',
+          value: 3,
+          color: '#A0A0A0'
         }
-      })
+      ]
+    }
+  },
+  methods: {
+    show() {
+      this.showDialog = true
     }
   }
 }
 </script>
 
-<style scoped>
+<style lang="scss" scoped>
+.title {
+  min-width: 60px;
+}
+
+:deep(.el-input__wrapper) {
+  box-shadow: none;
+  font-weight: bold;
+  font-size: 16px;
+}
 
+:deep(.el-input__wrapper:hover) {
+  box-shadow: none;
+  background-color: #eeeeee;
+}
 </style>

+ 11 - 0
src/views/task/component/tasker.vue

@@ -0,0 +1,11 @@
+<template>
+  <div>
+    <div>33</div>
+  </div>
+</template>
+
+<script>
+export default {}
+</script>
+
+<style lang="scss" scoped></style>

+ 86 - 0
src/views/task/component/wt-tag.vue

@@ -0,0 +1,86 @@
+<template>
+  <el-dropdown @command="dropDown">
+    <span class="flex flex-center">
+      <div
+        class="tag flex flex-center"
+        :style="`background-color:` + current.color"
+        style="min-width: 60px"
+      >
+        <div class="font-12 bold black">{{ current.title }}</div>
+        <el-icon class="el-icon--right">
+          <arrow-down />
+        </el-icon>
+      </div>
+    </span>
+    <template #dropdown>
+      <el-dropdown-menu>
+        <el-dropdown-item
+          v-for="item in data"
+          :key="item.value"
+          :command="item"
+        >
+          <template #default>
+            <div
+              :style="`background-color:` + item.color"
+              class="black padding-left padding-right flex flex-center"
+              style="min-width: 50px"
+            >
+              {{ item.title }}
+            </div>
+          </template>
+        </el-dropdown-item>
+      </el-dropdown-menu>
+    </template>
+  </el-dropdown>
+</template>
+
+<script>
+export default {
+  props: {
+    data: {
+      type: Array,
+      default: []
+    }
+  },
+  watch: {
+    data: {
+      handler(val) {
+        if (val && val.length > 1) {
+          this.current = val[0]
+        }
+      },
+      immediate: true
+    }
+  },
+  data() {
+    return {
+      current: { color: '#D7D7D7', title: '待确认' }
+    }
+  },
+  methods: {
+    dropDown(res) {
+      console.log(res)
+      this.current = res
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.el-dropdown-link {
+  cursor: pointer;
+  color: #409eff;
+}
+
+.el-icon-arrow-down {
+  font-size: 12px;
+}
+
+.tag {
+  font-size: 12px;
+  background-color: #e7e7e7;
+  padding: 5px 12px;
+  border-radius: 2px;
+  margin-right: 10px;
+}
+</style>

+ 0 - 347
src/views/task/detail.vue

@@ -1,347 +0,0 @@
-<template>
-  <basic-container class='mt-10'>
-    <div class='flex flex-align-start flex flex-col'>
-      <span class='bold'>任务基本信息:</span>
-      <el-divider/>
-      <div v-if='taskInfo' class='flex flex-align-start flex-col '>
-        <div>
-          <span class='bold'>任务名称:</span>
-          <span>{{ taskInfo.title }}</span>
-        </div>
-        <div class='mt-10'>
-          <span class='bold'>任务说明:</span>
-          <span>{{ taskInfo.remark }}</span>
-        </div>
-        <div class='mt-10'>
-          <span class='bold'>任务时间:</span>
-          <span>{{ taskInfo.startTime }} - {{ taskInfo.endTime }}</span>
-        </div>
-        <div class='mt-10'>
-          <span class='bold'>任务状态:</span>
-          <el-tag>{{ taskInfo.isCompleted === 0 ? '未完成':'已完成' }}</el-tag>
-          <el-tag class='ml-10'>{{ taskInfo.isConfirmed === 0 ? '待确认':'已确认' }}</el-tag>
-        </div>
-      </div>
-    </div>
-  </basic-container>
-  <basic-container>
-    <div class='flex flex-align-start flex flex-col full-width '>
-      <span class='bold'>任务相关文件夹:</span>
-      <el-divider/>
-      <div class='full-width flex flex-justify-between'>
-        <el-button icon='back' type='primary'  @click='back'>
-          返回上一级
-        </el-button>
-        <el-button icon='Check' type='primary' v-if='this.folderList.length === 0 && taskInfo && taskInfo.isCompleted === 0 ' @click='completeTask'>
-          完成任务
-        </el-button>
-        <el-button icon='Check' type='primary' v-if='taskInfo && taskInfo.isConfirmed === 0 && view' @click='confirmTask'>
-          确认任务
-        </el-button>
-      </div>
-      <basic-curd class='full-width' :data='data' :option='taskOption' @row-view='rowDetail' @row-del='rowDel'>
-        <template #menu='{row}'>
-          <main-button title='提交文件' v-if='row.type === 2 && view !== true' icon='Position' @click='postFile(row)'/>
-        </template>
-      </basic-curd>
-    </div>
-<!--    upload-->
-    <el-dialog v-model='show' title='上传文件'>
-      <div>
-        <el-upload
-            drag
-            :action="action"
-            multiple
-            accept='.doc,.docx,.pdf,.xls,.xlsx,.png,.jpg,.jpeg,.ppt,pptx'
-            show-file-list
-            :headers="{'Authorization':`Basic ${clientId}`}"
-            :on-success='uploadSuccess'
-        >
-          <el-icon class="el-icon--upload">
-            <upload-filled/>
-          </el-icon>
-          <div class="el-upload__text">
-            拖拽或者 <em>点击上传文件</em>
-          </div>
-        </el-upload>
-        <el-divider/>
-        <div class='flex flex-justify-end'>
-          <el-button @click='show = false'>取 消</el-button>
-          <el-button type='primary' @click='saveFile'>确 定</el-button>
-        </div>
-      </div>
-    </el-dialog>
-    <el-image-viewer
-        v-if='showImage'
-        :url-list="imgList"
-        @close='showImage = false'
-    />
-  </basic-container>
-</template>
-<route>
-{
-name: '任务详情'
-}
-</route>
-
-<script>
-import BasicContainer from '@/components/basic-container/main.vue'
-import basicCurd from '@/components/basic-curd/index.vue'
-import MainButton from '@/components/main-button.vue'
-import api from '@/api/index.js'
-import { Base64 } from 'js-base64'
-import website from '@/config/website.js'
-
-export default {
-  name: 'detail',
-  components: { MainButton, BasicContainer, basicCurd },
-  data () {
-    return {
-      clientId: '',
-      view: false,
-      showImage: false,
-      imgList: [],
-      show: false,
-      action: api.uploadPath,
-      fileList: [],
-      id: '',
-      taskId: '',
-      page: {
-        pageSize: 10,
-        currentPage: 1,
-        total: 10
-      },
-      isAccess: 3,
-      current: null,
-      currentFolder: null,
-      taskInfo: null,
-      folderList: [],
-      resultFile: [],
-      data: [],
-      taskOption: {
-        viewBtn: true,
-        editBtn: false,
-        delBtn: false,
-        column: [
-          {
-            label: '文件夹',
-            prop: 'folderName'
-          },
-          {
-            label: '更新时间',
-            prop: 'updateTime'
-          },
-          {
-            label: '创建人',
-            prop: 'createUserName'
-          }
-        ]
-      }
-    }
-  },
-  created () {
-    this.id = this.$route.query.id
-    this.taskId = this.$route.query.taskId
-    this.clientId = Base64.encode(`${website.clientId}:${website.clientSecret}`)
-    const viewtemp = this.$route.query.view
-    if (viewtemp) {
-      this.view = true
-    }
-    if (this.view) {
-      this.confirmDetail()
-    } else {
-      this.detail()
-    }
-  },
-  methods: {
-    confirmDetail () {
-      const data = { taskId: this.taskId }
-      this.$api.task.confirmDetail(Object.assign(data, this.page)).then(res => {
-        if (res.code === 200) {
-          this.data = res.data.records.map(sub => {
-            sub.parentId = 0
-            sub.type = 2
-            return sub
-          })
-          this.current = this.data[0]
-          this.isAccess = this.data[0].isAccess
-          this.taskInfo = this.data[0]
-        } else {
-          this.$message.error(res.msg)
-        }
-      })
-    },
-    detail () {
-      const data = { taskId: this.taskId }
-      this.$api.task.detail(Object.assign(data, this.page)).then(res => {
-        if (res.code === 200) {
-          this.data = res.data.records.map(sub => {
-            sub.parentId = 0
-            sub.type = 2
-            return sub
-          })
-          this.current = this.data[0]
-          this.isAccess = this.data[0].isAccess
-          this.taskInfo = this.data[0]
-        } else {
-          this.$message.error(res.msg)
-        }
-      })
-    },
-    rowDel (row) {
-      this.$api.task.taskRemove({ taskId: this.taskId, ids: row.id }).then(res => {
-        if (res.code === 200) {
-          this.$message.success(res.msg)
-          this.data = this.data.filter(sub => sub.id !== row.id)
-        } else {
-          this.$message.error(res.msg)
-        }
-      })
-    },
-    rowDetail (row, index) {
-      if (row.type === 2) {
-        const data = { folderId: row.folderId, taskId: this.taskId }
-        this.folderList.push(row)
-        this.current = row
-        this.current.parentId = row.folderId
-        this.$api.task.fileList(data).then(res => {
-          if (res.code === 200) {
-            this.data = res.data.records.map(sub => {
-              sub.folderName = sub.title
-              // 继承上级的权限
-              sub.isAccess = row.isAccess
-              // rowDetail 需要folderId
-              sub.folderId = sub.id
-              return sub
-            })
-          } else {
-            this.$message.error(res.msg)
-          }
-        })
-      } else {
-        if (api.offices.includes(row.suffix)) {
-          const routeData = this.$router.resolve({ path: '/home/file_detail', query: { id: row.fileId } })
-          window.open(routeData.href, '_blank')
-        } else {
-          this.imgList = [row.url]
-          this.showImage = true
-        }
-      }
-    },
-    back () {
-      if (this.folderList.length === 0) {
-        this.$router.back()
-        return
-      }
-      this.folderList.pop()
-      this.current = this.folderList[this.folderList.length - 1]
-      if (this.folderList.length === 0) {
-        this.detail()
-      } else {
-        const data = { folderId: this.current.folderId }
-        this.$api.task.fileList(data).then(res => {
-          if (res.code === 200) {
-            this.data = res.data.records.map(sub => {
-              sub.folderName = sub.title
-              // 继承上级的权限
-              sub.isAccess = this.isAccess
-              // rowDetail 需要folderId
-              sub.folderId = sub.id
-              return sub
-            })
-          } else {
-            this.$message.error(res.msg)
-          }
-        })
-      }
-    },
-    postFile (row) {
-      console.log(row)
-      this.currentFolder = row
-      this.show = true
-    },
-    completeTask (row) {
-      this.$api.task.completeTask({ taskId: this.taskId }).then(res => {
-        if (res.code === 200) {
-          this.$message.success(res.msg)
-          this.taskInfo.isCompleted = 1
-        } else {
-          this.$message.error(res.msg)
-        }
-      })
-    },
-    uploadSuccess (res, file, files) {
-      this.fileList = files.map(sub => sub.response.data)
-    },
-    saveFile () {
-      if (this.fileList.length === 0) {
-        return
-      }
-      this.fileList.forEach(sub => {
-        if (['pdf', 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx'].includes(sub.suffix)) {
-          // save Library
-          const data = {
-            title: sub.originalFileName,
-            fileId: sub.id,
-            suffix: sub.suffix,
-            volume: sub.volume,
-            url: sub.filePath,
-            category: 4,
-            content: '',
-            parentId: this.currentFolder.folderId
-          }
-          this.$api.common.submit(data).then(res => {
-            if (res.code === 200) {
-              console.log(res.msg)
-            } else {
-              this.$message.error(res.msg)
-            }
-          })
-        }
-      })
-      this.addFile()
-    },
-    /**
-     * 上传文件
-     */
-    addFile () {
-      this.fileList = this.fileList.map(sub => {
-        sub.parentId = this.currentFolder.folderId
-        sub.projectId = this.currentFolder.projectId
-        sub.title = sub.originalFileName
-        sub.fileId = sub.id
-        sub.url = sub.filePath
-        return sub
-      })
-      const data = { taskId: this.taskId, dispatcherUser: this.currentFolder.dispatcherUser, folderId: this.currentFolder.folderId, files: this.fileList }
-      this.$api.task.uploadFile(data).then(res => {
-        if (res.code === 200) {
-          this.show = false
-        } else {
-          this.$message.error(res.msg)
-        }
-      })
-    },
-    confirmTask () {
-      this.$confirm('确认任务,并且向业主发送提醒', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(res => {
-        this.$api.task.taskConfirm({ taskId: this.taskId }).then(res => {
-          if (res.code === 200) {
-            this.$message.success(res.msg)
-            this.taskInfo.isConfirmed = 1
-          } else {
-            this.$message.error(res.msg)
-          }
-        })
-      })
-    }
-  }
-}
-</script>
-
-<style scoped>
-
-</style>

+ 3 - 3
vite.config.js

@@ -1,4 +1,4 @@
-import {defineConfig} from 'vite'
+import { defineConfig } from 'vite'
 import vue from '@vitejs/plugin-vue'
 import Pages from 'vite-plugin-pages'
 import Layouts from 'vite-plugin-vue-layouts'
@@ -57,8 +57,8 @@ export default defineConfig({
     proxy: {
       '/api': {
         // 正式环境地址
-        // target: 'https://dev.wutongresearch.club/api',
-        target: 'https://prod.wutongshucloud.com/api',
+        target: 'https://dev.wutongresearch.club/api',
+        // target: 'https://prod.wutongshucloud.com/api',
         // target: 'http://192.168.31.181:8110',
         changeOrigin: true,
         rewrite: path => path.replace(/^\/api/, '')