Browse Source

change file path

tags/v1.0.0^2
zhangtao 2 years ago
parent
commit
8d8e31b51a
32 changed files with 517 additions and 24 deletions
  1. +1
    -1
      src/api/system/role/index.js
  2. +1
    -1
      src/components/DataTable/tools/useDataSource.js
  3. +1
    -2
      src/components/Modal/index.vue
  4. +28
    -1
      src/router/routes/modules/index.js
  5. +5
    -5
      src/store/modules/permission.js
  6. +7
    -0
      src/utils/dictionary.js
  7. +17
    -0
      src/views/question-manage/question-distribution/index.vue
  8. +17
    -0
      src/views/question-manage/question-list/index.vue
  9. +17
    -0
      src/views/report-manage/all-report/index.vue
  10. +0
    -0
      src/views/system-manage/department-manage/components/DeptModal.vue
  11. +0
    -0
      src/views/system-manage/department-manage/index.vue
  12. +0
    -0
      src/views/system-manage/department-manage/info.js
  13. +0
    -0
      src/views/system-manage/department-manage/table.js
  14. +0
    -0
      src/views/system-manage/menu-manage/components/MenuModal.vue
  15. +0
    -0
      src/views/system-manage/menu-manage/index.vue
  16. +0
    -0
      src/views/system-manage/menu-manage/info.js
  17. +0
    -0
      src/views/system-manage/menu-manage/table.js
  18. +0
    -0
      src/views/system-manage/role-manage/components/ConfigModal.vue
  19. +0
    -0
      src/views/system-manage/role-manage/components/RoleModal.vue
  20. +0
    -0
      src/views/system-manage/role-manage/index.vue
  21. +0
    -0
      src/views/system-manage/role-manage/info.js
  22. +0
    -0
      src/views/system-manage/role-manage/table.js
  23. +0
    -0
      src/views/system-manage/user-manage/components/UserModal.vue
  24. +0
    -0
      src/views/system-manage/user-manage/index.vue
  25. +0
    -0
      src/views/system-manage/user-manage/info.js
  26. +0
    -0
      src/views/system-manage/user-manage/table.js
  27. +6
    -6
      src/views/task-manage/all-task/components/VerifyDrawer.vue
  28. +8
    -8
      src/views/task-manage/all-task/index.vue
  29. +175
    -0
      src/views/task-manage/question/components/ConfirmModal.vue
  30. +94
    -0
      src/views/task-manage/question/index.vue
  31. +21
    -0
      src/views/task-manage/question/tools/search.js
  32. +119
    -0
      src/views/task-manage/question/tools/table.js

+ 1
- 1
src/api/system/role/index.js View File

@@ -77,7 +77,7 @@ export function deleteRole(data) {
*/
export function getRolePermission(id) {
return request({
url: `/role/getPermissionList/${id}`,
url: `/role/getMenuList/${id}`,
method: 'GET'
})
}

+ 1
- 1
src/components/DataTable/tools/useDataSource.js View File

@@ -45,7 +45,7 @@ export function useDataSource(propsRef, { getPaginationInfo, setPagination, setL
}
// 处理数据结构
const resultInfo = res[listField] ? res[listField] : res
dataSourceRef.value = dataType === 'tree' ? dealTree(resultInfo) : resultInfo
dataSourceRef.value = dataType === 'tree' ? dealTree(resultInfo.data) : resultInfo
setPagination({
[pageField]: currentPage,
[totalField]: Math.ceil(resultTotal / pageSize)

+ 1
- 2
src/components/Modal/index.vue View File

@@ -34,7 +34,7 @@ export default defineComponent({
return {
...props.options,
width: props.options.width || 600,
preset: props.options.preset || 'card',
preset: props.options.preset || 'dialog',
showIcon: !!props.options.showIcon
}
})
@@ -66,7 +66,6 @@ export default defineComponent({
// styL = +sty.left.replace(/\px/g, '')
// styT = +sty.top.replace(/\px/g, '')
// }

// document.onmousemove = function(e) {
// // 计算移动的距离
// const l = e.clientX - disX

+ 28
- 1
src/router/routes/modules/index.js View File

@@ -24,13 +24,40 @@ export default [
{
path: '/system',
component: Layout,
redirect: '/system/menu',
redirect: '/system/user',
name: 'System',
title: '系统管理',
meta: {
title: '系统管理'
},
children: [
{
path: 'user',
component: () => import('@/views/system/user/index.vue'),
name: 'SystemUser',
title: '用户管理',
meta: {
title: '用户管理'
}
},
{
path: 'role',
component: () => import('@/views/system/role/index.vue'),
name: 'SystemRole',
title: '角色管理',
meta: {
title: '角色管理'
}
},
{
path: 'dept',
component: () => import('@/views/system/dept/index.vue'),
name: 'SystemDept',
title: '部门管理',
meta: {
title: '部门管理'
}
},
{
path: 'menu',
component: () => import('@/views/system/menu/index.vue'),

+ 5
- 5
src/store/modules/permission.js View File

@@ -114,11 +114,11 @@ export const usePermissionStore = defineStore('permission', {
try {
const res = await getMenu()
if (res.code === 0) {
// const result = dataArrayToRoutes(res.data)
// this.accessRoutes = result
// return Promise.resolve(result)
this.accessRoutes = router
return Promise.resolve(router)
const result = dataArrayToRoutes(res.data)
this.accessRoutes = result
return Promise.resolve(result)
// this.accessRoutes = router
// return Promise.resolve(router)
} else {
return Promise.reject(res.message)
}

+ 7
- 0
src/utils/dictionary.js View File

@@ -13,3 +13,10 @@ export const TASK_TYPE = [
{ label: '日常巡检', value: 0 },
{ label: '应急巡检', value: 1 }
]

export const QUESTION_TYPE = [
{ label: '林场问题图斑', value: 1 },
{ label: '病虫树', value: 2 },
{ label: '人员活动', value: 3 },
{ label: '火灾隐患', value: 4 }
]

+ 17
- 0
src/views/question-manage/question-distribution/index.vue View File

@@ -0,0 +1,17 @@
<template>
<div>
问题分布
</div>
</template>

<script>
export default {
name: 'QuestionDistribution',
setup() {

}
}

</script>
<style scoped lang='scss'>
</style>

+ 17
- 0
src/views/question-manage/question-list/index.vue View File

@@ -0,0 +1,17 @@
<template>
<div>
问题列表
</div>
</template>

<script>
export default {
name: 'QuestionList',
setup() {

}
}

</script>
<style scoped lang='scss'>
</style>

+ 17
- 0
src/views/report-manage/all-report/index.vue View File

@@ -0,0 +1,17 @@
<template>
<div>
全部报告
</div>
</template>

<script>
export default {
name: 'AllReport',
setup() {

}
}

</script>
<style scoped lang='scss'>
</style>

src/views/system/dept/components/DeptModal.vue → src/views/system-manage/department-manage/components/DeptModal.vue View File


src/views/system/dept/index.vue → src/views/system-manage/department-manage/index.vue View File


src/views/system/dept/info.js → src/views/system-manage/department-manage/info.js View File


src/views/system/dept/table.js → src/views/system-manage/department-manage/table.js View File


src/views/system/menu/components/MenuModal.vue → src/views/system-manage/menu-manage/components/MenuModal.vue View File


src/views/system/menu/index.vue → src/views/system-manage/menu-manage/index.vue View File


src/views/system/menu/info.js → src/views/system-manage/menu-manage/info.js View File


src/views/system/menu/table.js → src/views/system-manage/menu-manage/table.js View File


src/views/system/role/components/ConfigModal.vue → src/views/system-manage/role-manage/components/ConfigModal.vue View File


src/views/system/role/components/RoleModal.vue → src/views/system-manage/role-manage/components/RoleModal.vue View File


src/views/system/role/index.vue → src/views/system-manage/role-manage/index.vue View File


src/views/system/role/info.js → src/views/system-manage/role-manage/info.js View File


src/views/system/role/table.js → src/views/system-manage/role-manage/table.js View File


src/views/system/user/components/UserModal.vue → src/views/system-manage/user-manage/components/UserModal.vue View File


src/views/system/user/index.vue → src/views/system-manage/user-manage/index.vue View File


src/views/system/user/info.js → src/views/system-manage/user-manage/info.js View File


src/views/system/user/table.js → src/views/system-manage/user-manage/table.js View File


+ 6
- 6
src/views/task-manage/all-task/components/VerifyDrawer.vue View File

@@ -1,16 +1,18 @@
<template>
<n-drawer v-bind="getDrawerOptions" @update:show="handleDrawerColse">
<n-drawer-content closable title="问题核实">
问题核实
<n-drawer-content closable title="疑似问题核实">
<QuestionPage />
</n-drawer-content>
</n-drawer>
</template>

<script>
import { h, defineComponent, computed, reactive, toRefs } from 'vue'
import QuestionPage from '@/views/task-manage/question/index.vue'
import { defineComponent, computed, reactive, toRefs } from 'vue'

export default defineComponent({
name: 'LiveDrawer',
components: { QuestionPage },
props: {
/* 可见 */
visible: {
@@ -27,9 +29,7 @@ export default defineComponent({
'update:visible': null
},
setup(props, { emit }) {
const data = reactive({

})
const data = reactive({})

/* 获取抽屉的信息 */
const getDrawerOptions = computed(() => {

+ 8
- 8
src/views/task-manage/all-task/index.vue View File

@@ -1,8 +1,8 @@
<template>
<div>
<n-card>
<headSearch :info="search" />
<data-table
<HeadSearch :info="search" />
<DataTable
ref="tableRef"
:columns="columns"
:data="data"
@@ -23,7 +23,7 @@
确认要删除选中数据吗?
</n-popconfirm> -->
</template>
</data-table>
</DataTable>
</n-card>
</div>

@@ -39,10 +39,10 @@
</template>

<script>
import headSearch from '@/components/Search/index.vue'
import table from './tools/table.js'
import search from './tools/search.js'
import dataTable from '@/components/DataTable/index.vue'
import HeadSearch from '@/components/Search/index.vue'
import DataTable from '@/components/DataTable/index.vue'
import TaskModal from './components/TaskModal.vue'
import LiveDrawer from './components/LiveDrawer.vue'
import DemandDrawer from './components/DemandDrawer.vue'
@@ -51,12 +51,12 @@ import { h, unref, ref, toRefs, reactive } from 'vue'

export default {
name: 'TaskAll',
components: { headSearch, dataTable, TaskModal, LiveDrawer, DemandDrawer, VerifyDrawer },
components: { HeadSearch, DataTable, TaskModal, LiveDrawer, DemandDrawer, VerifyDrawer },
setup() {
const data = reactive({
search,
...toRefs(table),
data: [{}],
search
data: [{}]
})

/**

+ 175
- 0
src/views/task-manage/question/components/ConfirmModal.vue View File

@@ -0,0 +1,175 @@
<template>
<Modal
:options="getModalOptions"
:on-positive-click="handleConfirm"
:on-negative-click="handleIgnore"
:on-close="handleClose"
>
<template #Context>
<div class="carousel__flex">
<n-icon size="26" color="#8A8A8A">
<LeftOutlined @click="handleCarousel('prev')" />
</n-icon>
<div class="carousel__container">
<label>问题描述</label>
<n-carousel ref="carouselRef" :show-dots="false">
<img
v-for="item in getCarouselInfo"
:key="item.id"
class="carousel-img"
:src="item.image"
>
</n-carousel>
</div>
<n-icon size="26" color="#8A8A8A">
<RightOutlined @click="handleCarousel('next')" />
</n-icon>
</div>
<div class="modal-form">
<label>问题类型</label>
<n-select
v-model:value="selectType"
:options="QUESTION_TYPE"
/>
</div>
</template>
</Modal>
</template>

<script>
import { QUESTION_TYPE } from '@/utils/dictionary.js'
import { LeftOutlined, RightOutlined } from '@vicons/antd'
import Modal from '@/components/Modal/index.vue'
import { defineComponent, computed, ref, reactive, toRefs } from 'vue'
export default defineComponent({
name: 'UserModal',
components: { Modal, LeftOutlined, RightOutlined },
props: {
visible: {
type: Boolean,
default: false
},
data: {
type: Array,
default: () => null
}
},
emits: {
'update:visible': null,
'update-data': null,
'done': null
},
setup(props, { emit }) {
const formRef = ref()
const data = reactive({
selectRow: props.data[0],
selectType: props.data[0].type,
QUESTION_TYPE
})
/* 获取弹窗的属性 */
const getModalOptions = computed(() => {
return {
show: props.visible,
title: '问题确认',
width: 700,
negativeText: '忽略',
positiveText: '确认'
}
})

const getCarouselInfo = computed(() => {
return props.data
})

const carouselRef = ref(null)

function handleCarousel(type) {
const currentIndex = carouselRef.value.getCurrentIndex()

switch (type) {
case 'prev':
if (currentIndex !== 0) {
carouselRef.value.prev()
data.selectRow = props.data[currentIndex - 1]
data.selectType = props.data[currentIndex - 1].type
}
break
case 'next':
if (currentIndex !== props.data.length - 1) {
carouselRef.value.next()
data.selectRow = props.data[currentIndex + 1]
data.selectType = props.data[currentIndex + 1].type
}
break
}
}

/**
* @description: 保存
* @return {*}
*/
const handleConfirm = () => {
emit('update-data')
}
const handleIgnore = () => {

}

/* 关闭弹窗 */
const handleClose = () => {
emit('update:visible', false)
}

return {
...toRefs(data),
formRef,
getModalOptions,
getCarouselInfo,
carouselRef,
handleCarousel,
handleConfirm,
handleIgnore,
handleClose
}
}

})
</script>
<style scoped lang='scss'>
.carousel__flex{
display: flex;
align-items: center;
justify-content: space-between;
.carousel__container{
width: calc(100% - 100px);
display: flex;
margin-right: 40px;
label{
width: 70px;
flex-shrink: 0;
}
}
.n-icon{
cursor: pointer;
}
.carousel-img{
width: 100%;
height: 280px;
object-fit: cover
}
}

.modal-form{
width: calc(100% - 60px);
display: flex;
align-items: center;
margin: 20px auto 0;
label{
width: 70px;
flex-shrink: 0;
}
.n-select{
width: 300px;
}
}
</style>

+ 94
- 0
src/views/task-manage/question/index.vue View File

@@ -0,0 +1,94 @@
<template>
<HeadSearch :info="search" />
<DataTable
ref="tableRef"
:columns="columns"
:row-key="(row) => row.id"
:data="data"
size="large"
scroll-x="1200"
@fetch-success="getTableData"
@update:checked-row-keys="handleRowsCheck"
>
<template #tableTitle>
<n-button @click="handleIgnoreBatch">忽略</n-button>
<n-button type="primary" @click="handleConfirmBatch">
确认
</n-button>
</template>
</DataTable>

<ConfirmModal v-if="confirmModal" v-model:visible="confirmModal" :data="pageData" @update-data="tableReload" />

</template>

<script>
import table from './tools/table.js'
import search from './tools/search.js'
import HeadSearch from '@/components/Search/index.vue'
import DataTable from '@/components/DataTable/index.vue'
import ConfirmModal from './components/ConfirmModal.vue'
import { h, computed, ref, reactive, toRefs } from 'vue'
export default {
name: 'QuestionPage',
components: { HeadSearch, DataTable, ConfirmModal },
setup() {
const data = reactive({
search,
...toRefs(table),
data: [
{ id: 1, image: 'https://naive-ui.oss-cn-beijing.aliyuncs.com/carousel-img/carousel1.jpeg', type: 1 },
{ id: 2, image: 'https://naive-ui.oss-cn-beijing.aliyuncs.com/carousel-img/carousel2.jpeg', type: 2 }
],
pageData: []
})

/**
* @description:
* @return {*}
*/
function getTableData(list) {
data.pageData = list
}

/**
* @description: 选中行的rowkey
* @param {*} rowKeys
* @return {*}
*/
function handleRowsCheck(rowKeys) {
console.log(rowKeys)
}

function handleIgnoreBatch() {

}

function handleConfirmBatch() {

}

const tableRef = ref()
/* 刷新表格数据 */
function tableReload(res) {
const _params = {
...res
}
tableRef.value.reFetch(_params)
}

return {
...toRefs(data),
tableRef,
getTableData,
handleRowsCheck,
handleIgnoreBatch,
handleConfirmBatch,
tableReload
}
}
}

</script>
<style scoped lang='scss'>
</style>

+ 21
- 0
src/views/task-manage/question/tools/search.js View File

@@ -0,0 +1,21 @@
import { reactive } from 'vue'
import { QUESTION_TYPE } from '@/utils/dictionary.js'

const data = reactive([
{
label: '任务状态',
key: 'status',
type: 'select',
value: 'all',
props: {
placeholder: '请选择任务状态',
options: [
{ label: '全部', value: 'all' },
...QUESTION_TYPE
]
}
}
])

export default data


+ 119
- 0
src/views/task-manage/question/tools/table.js View File

@@ -0,0 +1,119 @@
// import TableTags from '@/components/DataTable/tools/Tags.vue'
import TableImage from '@/components/DataTable/tools/Image.vue'
import TableAction from '@/components/DataTable/tools/Action.vue'
import { h, reactive } from 'vue'

/* 问题忽略 */
function handleRowIgnore(row) {
data.rowData = row
console.log('问题忽略')
}

/* 问题确认 */
function handleRowConfirm(row) {
data.rowData = row
console.log('问题确认')
}

function handleImgPreview() {
data.confirmModal = true
}

const data = reactive({
rowData: {},
confirmModal: false,
columns: [
{
type: 'selection'
},
{
title: '序号',
key: 'name',
align: 'center'
},
{
title: '问题类型',
key: 'name',
align: 'center'
},
{
title: '问题图片',
key: 'image',
align: 'center',
render(row) {
return h(TableImage, {
images: {
width: 36,
height: 36,
src: row.image,
previewDisabled: true,
onClick: handleImgPreview.bind(null, row)
}
})
}
},
{
title: '经纬度',
key: 'name',
align: 'center'
},
{
title: '位置',
key: 'name',
align: 'center'
},
{
title: '备注',
key: 'name',
align: 'center'
},
{
title: '状态',
key: 'name',
align: 'center'
},

{
title: '操作',
align: 'center',
width: 150,
fixed: 'right',
render(row) {
return h(TableAction, {
actions: [
{
label: '忽略',
type: 'popconfirm',
tip: '是否忽略该数据?',
props: {
onClick: handleRowIgnore.bind(null, row)
},
ButtonProps: {
text: true,
type: 'primary'
},
auth: 'basic_list'
},
{
label: '确认',
type: 'popconfirm',
tip: '是否确认该数据?',
props: {
onClick: handleRowConfirm.bind(null, row)
},
ButtonProps: {
text: true,
type: 'primary'
},
auth: 'basic_list'
}
],
align: 'center'
})
}
}

]
})

export default data

Loading…
Cancel
Save