全部任务
This commit is contained in:
parent
500c1ddb15
commit
4ebdb8bae4
2
.env
2
.env
|
|
@ -5,7 +5,7 @@ VITE_APP_TITLE = '智慧河长'
|
||||||
VITE_PORT = 3000
|
VITE_PORT = 3000
|
||||||
|
|
||||||
|
|
||||||
# VITE_SERVER = "/hhz/admin/api"
|
#VITE_SERVER = "/hhz/admin/api"
|
||||||
VITE_SERVER = ""
|
VITE_SERVER = ""
|
||||||
|
|
||||||
VITE_PLATFORM = "tuoheng-hhz-admin"
|
VITE_PLATFORM = "tuoheng-hhz-admin"
|
||||||
|
|
@ -16,4 +16,4 @@ VITE_APP_GLOB_BASE_API_MOCK = '/api-mock'
|
||||||
VITE_AUTHORITY = 'http://192.168.11.11:8090'
|
VITE_AUTHORITY = 'http://192.168.11.11:8090'
|
||||||
VITE_CLIENT_ID = 'tuoheng-hhz-admin'
|
VITE_CLIENT_ID = 'tuoheng-hhz-admin'
|
||||||
VITE_CLIENT_SECRET = 'qsPaU8a2YGFsZfIa7HoGSz=='
|
VITE_CLIENT_SECRET = 'qsPaU8a2YGFsZfIa7HoGSz=='
|
||||||
VITE_REDIRECT_URI = 'http://192.168.12.8:3000/login'
|
VITE_REDIRECT_URI = 'http://192.168.12.6:3000/login'
|
||||||
|
|
@ -1,14 +1,34 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
所有任务
|
<n-card>
|
||||||
|
<headSearch :info="search" @search="handleSearch" @reset="handleSearch" />
|
||||||
|
<data-table
|
||||||
|
ref="tableRef"
|
||||||
|
:columns="columns"
|
||||||
|
:request="loadDataTable"
|
||||||
|
:row-key="(row) => row.id"
|
||||||
|
:scroll-x="2200"
|
||||||
|
size="large"
|
||||||
|
>
|
||||||
|
<template #tableTitle>
|
||||||
|
<n-button type="primary" @click="handleModal"> 新建 </n-button>
|
||||||
|
</template>
|
||||||
|
</data-table>
|
||||||
|
</n-card>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import headSearch from '@/components/Search/index.vue'
|
||||||
|
import dataTable from '@/components/DataTable/index.vue'
|
||||||
|
import { reactive } from '@vue/reactivity'
|
||||||
export default {
|
export default {
|
||||||
name: 'AllTask',
|
name: 'AllTask',
|
||||||
|
components: { headSearch, dataTable },
|
||||||
setup() {
|
setup() {
|
||||||
|
const data = reactive({
|
||||||
|
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,76 @@
|
||||||
|
import { h, ref, reactive } from 'vue'
|
||||||
|
import TableImage from '@/components/DataTable/tools/Image.vue'
|
||||||
|
import TableTags from '@/components/DataTable/tools/Tags.vue'
|
||||||
|
import TableAction from '@/components/DataTable/tools/Action.vue'
|
||||||
|
import TableSwitch from '@/components/DataTable/tools/Switch.vue'
|
||||||
|
/* 注册table */
|
||||||
|
const tableRef = ref()
|
||||||
|
const searchParams = ref()
|
||||||
|
|
||||||
|
function handleSearch(params) {
|
||||||
|
searchParams.value = { ...params }
|
||||||
|
tableRef.value.reFetch({ searchParams })
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @description: 获取数据及操作
|
||||||
|
* @param {*} row 单行数据
|
||||||
|
* @param {*} type 操作类型 create:创建,preview:预览,edit:编辑
|
||||||
|
* @return {*}
|
||||||
|
*/
|
||||||
|
function getRowData(row, type) {
|
||||||
|
data.rowData = type === 'create' ? { pid: row.id } : row
|
||||||
|
data.modalType = type
|
||||||
|
data.modalShow = true
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除方法
|
||||||
|
function deleteData(id) {
|
||||||
|
advertisingDelete(id)
|
||||||
|
.then((res) => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
handleSearch()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
console.log(e)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const data = reactive({
|
||||||
|
tableRef,
|
||||||
|
searchParams,
|
||||||
|
rowData: {},
|
||||||
|
modalType: 'create',
|
||||||
|
modalShow: false,
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
title: '序号',
|
||||||
|
key: 'key',
|
||||||
|
render: (_, index) => {
|
||||||
|
return `${index + 1}`
|
||||||
|
},
|
||||||
|
align: 'center',
|
||||||
|
width: 50
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '广告名称',
|
||||||
|
key: 'title',
|
||||||
|
align: 'center',
|
||||||
|
width: 200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '广告名称',
|
||||||
|
key: 'title',
|
||||||
|
align: 'center',
|
||||||
|
width: 200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '广告名称',
|
||||||
|
key: 'title',
|
||||||
|
align: 'center',
|
||||||
|
width: 200
|
||||||
|
}
|
||||||
|
]
|
||||||
|
})
|
||||||
|
|
||||||
|
export default data
|
||||||
Loading…
Reference in New Issue