main
王文龙 2023-12-07 11:39:38 +08:00
parent 9a040f9627
commit fa7ed63104
7 changed files with 774 additions and 469 deletions

View File

@ -1315,15 +1315,46 @@ export async function fetchMaterialAddInfo(data?: any){
/**
* https://console-docs.apipost.cn/preview/d9d2c859db1009cd/18265d950ad924e4?target_id=4c25a720-44f2-472e-be82-c2eaf41d9a43
*/
*/
export async function fetchGetViewScope(params?: any){
return http.get(`/common/getViewScope`,{params})
}
/**
* DB/ https://console-docs.apipost.cn/preview/9ac14c51f96ce4d8/75274687248efb1c?target_id=a11153dc-ab84-41ca-aa1c-45fda68c4156
*/
export async function fetchdbAuthAdd(data?: any){
return http.post(`/dbAuth/add`,data)
}
/**
* DB/ https://console-docs.apipost.cn/preview/9ac14c51f96ce4d8/75274687248efb1c?target_id=a11153dc-ab84-41ca-aa1c-45fda68c4156
*/
export async function fetchdbAuthGetInfo(params?: any){
return http.get(`/dbAuth/getInfo`,{params})
}
/**
* DB https://console-docs.apipost.cn/preview/9ac14c51f96ce4d8/75274687248efb1c?target_id=a11153dc-ab84-41ca-aa1c-45fda68c4156
*/
export async function fetchdbWithdraw(params?: any){
return http.get(`/db/withdraw`,{params})
}
/**
* DB https://console-docs.apipost.cn/preview/9ac14c51f96ce4d8/75274687248efb1c?target_id=a11153dc-ab84-41ca-aa1c-45fda68c4156
*/
export async function fetchdbReview(params?: any){
return http.get(`/db/review`,{params})
}
/**
* DB https://console-docs.apipost.cn/preview/9ac14c51f96ce4d8/75274687248efb1c?target_id=a11153dc-ab84-41ca-aa1c-45fda68c4156
*/
export async function fetchdbReviewFileList(params?: any){
return http.get(`/dbAuth/reviewFileList`,{params})
}

View File

@ -83,6 +83,9 @@ const goModeuls = (obj) => {
case 7:
push({ name: "Diffspace" });
break;
case 9:
push({ name: "DataBaseReview" });
break;
default:
push("/Home/intelligence");
break;

View File

@ -507,6 +507,11 @@ const router = createRouter({
name: 'DataBase',
component: () => import('@/views/home/database/guize/index.vue')
},
{
path: '/DataBase/review',
name: 'DataBaseReview',
component: () => import('@/views/home/database/Process.vue')
},
{
path: '/DataBase/Modify',
name: 'DataBaseModify',

View File

@ -31,6 +31,7 @@ const dszList = ref<any>([{}, {}, {}, {}]);
const dishList = ref<any>([{}, {}, {}, {}]);
const month_1 = ref();
const month_2 = ref();
const month_3 = ref();
let now = (new Date()).getMonth() + 13;
month_2.value = (now - 2) % 12;
month_1.value = (now - 1) % 12;
@ -48,6 +49,7 @@ const addDIS3 = ref()
const addDISH3 = ref()
const timeObj = ref<any>({})
onMounted(async () => {
try{
const { data: { ailist, culist, lastUTime },data } = await homePageMarket() //
const { data: { itemList, lastUTime: _lastUTime } } = await homePageRate() //
const { data: _disList } = await getHomeList({number: "DIS"}) //
@ -72,10 +74,12 @@ onMounted(async () => {
itemLists.value = itemList
timeA.value = lastUTime
timeB.value = _lastUTime
disList.value = _disList
dszList.value = _dszList
dishList.value = _dishList
month_1.value = _disList[0].monthDate?.split('-')[1]
month_2.value = _dszList[0].monthDate?.split('-')[1]
month_3.value = _dishList[0].monthDate?.split('-')[1]
addDIS1.value = _disList.reduce((previousValue: any, currentValue: { budget: any }) => {
const sum =parseFloat (currentValue.budget) +parseFloat(previousValue)
@ -85,7 +89,6 @@ onMounted(async () => {
addDIS1.value -= _disList[0].budget
addDIS1.value >0? addDIS1.value = addDIS1.value.toFixed(2):0
}
console.log("🚀 ~ file: Home.vue:86 ~ addDIS1:", addDIS1)
addDSZ1.value = _dszList.reduce((previousValue: any, currentValue: { budget: any }) => {
const sum = parseFloat(currentValue.budget) +parseFloat(previousValue)
return sum>0 ? sum.toFixed(2):0
@ -160,6 +163,9 @@ onMounted(async () => {
push({ name: 'modifys' })
})
}
}catch (error) {
}
})
const { push } = useRouter()
const route = useRoute()
@ -363,7 +369,7 @@ function formatNumber(num = 0) {
<td>年初予算</td>
<!-- <td>{{month_2}}</td> -->
<td>改订</td>
<td>{{month_1}}</td>
<td>{{+month_1}}</td>
</tr>
<tr>
<th colspan="2">合计</th>
@ -418,7 +424,7 @@ function formatNumber(num = 0) {
<td>年初予算</td>
<!-- <td>{{month_2}}</td> -->
<td>改订</td>
<td>{{month_1}}</td>
<td>{{+month_2}}</td>
</tr>
<tr>
<th colspan="2">合计</th>
@ -473,7 +479,7 @@ function formatNumber(num = 0) {
<td>年初予算</td>
<!-- <td>{{month_2}}</td> -->
<td>改订</td>
<td>{{month_1}}</td>
<td>{{+month_3}}</td>
</tr>
<tr>
<th colspan="2">合计</th>

View File

@ -5,13 +5,13 @@ import { useUserStore } from '@/stores/modules/user'
import { useMessage,NModal } from 'naive-ui'
const store = useUserStore()
const message = useMessage()
const userCode = ['admin','database_dandang','tech_service'].includes(store.user.roleCode)
const userCode = ['admin','database_dandang','tech_service'].includes(store.user.roleCode) || !!store.user?.isDbUpload || !!store.user?.isDbReview
const { push } = useRouter();
const title = ref("大金集团经营理念")
const prop = defineProps({
cateId:String,
cateId: Number,
title:String
})
const pageInfo = reactive({
@ -56,15 +56,18 @@ async function getTree() {
// // message.error('', error);
// }
// }
async function downloads(row) {
console.log(row)
async function downloads(row:any) {
console.log(row,'!!!!!!!!!!xiazai')
const {isSelect,filePath} = row
if(isSelect === 2) {
message.info("没有访问权限")
return
}
try{
downloadFile(filePath)
}catch(error){
window.open(filePath)
}
}
const lazyState = computed(() => [pageInfo.currentPage])
watch(
@ -121,7 +124,22 @@ function getLastSubstring(str: string): string {
return '';
}
}
function downloadFile(url: any) {
fetch(url)
.then((response) => response.blob())
.then((blob) => {
const downloadUrl = URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = downloadUrl
link.download = getFileName(url)
link.click()
})
}
function getFileName(url: string) {
let lastSplashIndex = url.lastIndexOf('/')
let lastDotIndex = url.lastIndexOf('.')
return url.slice(lastSplashIndex + 1, lastDotIndex)
}
</script>
<template>

View File

@ -1,106 +1,254 @@
<template>
<div>
<DataBaseHead />
<div class="w-full h-1px bg-#507FFD mt50px rd-b-20px"></div>
<div class="bg-#fff rd-15px px30px pt30px w-full h920px ">
<div class="bg-#fff rd-15px px30px pt30px w-full h920px">
<el-tabs v-model="activeName" class="demo-tabs">
<div class="float-right px20px py10px z-200 bg-#f5f5f5" @click="goBacks"> <el-icon class="text-red"><ArrowLeftBold size="18"/></el-icon> </div>
<div class="absolute z-200 right-0 flex items-center">
<el-button
v-if="hasReview || hasUpload"
type="warning"
@click="handleClick"
>
审批流程
</el-button>
<div
class="rounded-md ml-50px px20px py10px z-200 bg-#f5f5f5 flex items-center justify-center w-100px"
@click="goBacks"
>
<el-icon class="text-red"><ArrowLeftBold size="18" /></el-icon>
</div>
</div>
<el-tab-pane label="分类管理" name="first">
<el-button type="primary" @click="editClickA('add')" class="mb-20px">
新增
</el-button>
<div class="w100% h750px overflow-auto">
<el-table :data="tableData" style="width: 100%; margin-bottom: 20px" row-key="id" border
default-expand-all :header-cell-style="{textAlign: 'center',
background: '#2A7BF7', color: '#fff',
height: '60px', 'font-size': '24px'
}" :cell-style="{ 'overflow-y': 'auto' }"
:tree-props="{ children: 'childList', hasChildren: 'hasChildren'}">
<el-table-column prop="name" label="标题名称" align="left"/>
<el-table
:data="tableData"
style="width: 100%; margin-bottom: 20px"
row-key="id"
border
default-expand-all
:header-cell-style="{
textAlign: 'center',
background: '#2A7BF7',
color: '#fff',
height: '60px',
'font-size': '24px'
}"
:cell-style="{ 'overflow-y': 'auto' }"
:tree-props="{
children: 'childList',
hasChildren: 'hasChildren'
}"
>
<el-table-column prop="name" label="标题名称" align="left" />
<!-- <el-table-column prop="sort" label="排序" align="center"/> -->
<el-table-column prop="address" label="操作" align="center">
<template #default="scope">
<el-button type="primary" @click="editClickA('edit', scope.row)" class="mb-20px">
编辑</el-button>
<el-button type="success" v-if="scope.row.level === 1||scope.row.level === 2||scope.row.level === 3" @click="editClickA('add', scope.row)"
class="mb-20px"> 新增{{scope.row.level===1?'二':scope.row.level===2?'三':'四'}}</el-button>
<el-button type="danger" @click="deleteClickA(scope.row)" class="mb-20px"> 删除</el-button>
<el-button
type="primary"
@click="editClickA('edit', scope.row)"
class="mb-20px"
>
编辑</el-button
>
<el-button
type="success"
v-if="
scope.row.level === 1 ||
scope.row.level === 2 ||
scope.row.level === 3
"
@click="editClickA('add', scope.row)"
class="mb-20px"
>
新增{{
scope.row.level === 1
? '二'
: scope.row.level === 2
? '三'
: '四'
}}</el-button
>
<el-button
type="danger"
@click="deleteClickA(scope.row)"
class="mb-20px"
>
删除</el-button
>
</template>
</el-table-column>
</el-table>
</div>
</el-tab-pane>
<el-tab-pane label="内容管理" name="second">
<el-button type="primary" @click="editClickB('add')" class="mb-20px"> 新增</el-button>
<el-button type="primary" @click="getAll" class="mb-20px"> 查看所有</el-button>
<div class="w100% h750px overflow-auto" >
<el-table class="tableClass" :data="infoData" style="width: 100%; margin-bottom: 20px" row-key="id" border
default-expand-all :header-cell-style="{
background: '#2A7BF7', color: '#fff',
height: '60px', textAlign: 'center', 'font-size': '24px'
}" :cell-style="{ 'text-align': 'center', 'overflow-y': 'auto' }"
:tree-props="{ children: 'childList', hasChildren: 'hasChildren'}">
<el-table-column prop="cateName" label="所属分类" show-overflow-tooltip>
<el-button
v-if="hasUpload"
type="primary"
@click="editClickB('add')"
class="mb-20px"
>
新增</el-button
>
<el-button
v-if="userCode"
type="primary"
@click="getAll"
class="mb-20px"
>
查看所有</el-button
>
<el-button
v-if="userCode"
:type="setUpload ? 'success' : 'warning'"
:icon="setUpload ? 'Check' : ''"
@click="getUser({ type: 1 })"
class="mb-20px !ml-50px"
>
{{ setUpload ? '已设置上传人员' : '设置上传人员' }}</el-button
>
<el-button
v-if="userCode"
:type="setReview ? 'success' : 'warning'"
:icon="setReview ? 'Check' : ''"
@click="getUser({ type: 2 })"
class="mb-20px"
>
{{ setReview ? '已设置审批人员' : '设置审批人员' }}</el-button
>
<div class="w100% h750px overflow-auto">
<el-table
class="tableClass"
:data="infoData"
style="width: 100%; margin-bottom: 20px"
row-key="id"
border
default-expand-all
:header-cell-style="{
background: '#2A7BF7',
color: '#fff',
height: '60px',
lineHeight: '60px',
textAlign: 'center',
'font-size': '24px'
}"
:cell-style="{ 'text-align': 'center', 'overflow-y': 'auto' }"
:tree-props="{
children: 'childList',
hasChildren: 'hasChildren'
}"
>
<el-table-column
prop="cateName"
label="所属分类"
show-overflow-tooltip
>
<!-- <template #default="scope">
<span v-if="scope.row.cateId==="></span>
</template> -->
</el-table-column>
<el-table-column prop="title" label="标题名称" show-overflow-tooltip/>
<el-table-column
prop="title"
label="标题名称"
show-overflow-tooltip
/>
<!-- <el-table-column prop="deptName" label="排序" /> -->
<el-table-column label="文件列表" prop="filePath" show-overflow-tooltip/>
<el-table-column
label="文件列表"
prop="filePath"
show-overflow-tooltip
/>
<!-- <el-table-column label="排序" prop="sort" show-overflow-tooltip/> -->
<el-table-column label="查看范围" prop="userIdList" :show-overflow-tooltip="true">
<el-table-column
label="查看范围"
prop="userIdList"
>
<template #default="scope">
<!-- <el-button type="primary" class="button" @click="getUser(scope.row)"></el-button> -->
<!-- <span class="descStyle" v-if="scope.row.userList" v-for="it in scope.row.userList"> &nbsp;&nbsp; {{it.nickName}}</span> -->
<!-- <span>{{ scope.row.userList }}</span> -->
<span v-if="scope.row.userList" v-for="(it,e) in scope.row.userList">
<el-tooltip :content="it.nickName" placement="top">
<p class="descStyle">{{ it.nickName }} <span v-if="e=== 1 && scope.row.userList.length > 2" >...{{ scope.row.userList.length }}</span> </p>
<p v-if="scope.row.userList.length" >
<el-tooltip :content="handTooltip(scope.row.userList)" placement="top">
<div class="!h-50px descStyle">
<div class="descStyle max-w-60vw !h-46px ">
<p v-for="(it, e) in scope.row.userList" :class="scope.row.userList.length < 2 ? '!leading-46px' : ''">
{{ it.nickName }}
<span v-if="e == 1 && scope.row.userList.length > 2"
>...{{ scope.row.userList.length }}</span
>
</p>
</div>
</div>
</el-tooltip>
</span>
</p>
<span v-else>''</span>
</template>
</el-table-column>
<el-table-column prop="address" label="操作" show-overflow-tooltip>
<el-table-column
prop="address"
label="操作"
show-overflow-tooltip
>
<template #default="scope">
<div>
<el-button type="primary" @click="editClickB('edit', scope.row)" class="mb-20px w45px">
编辑</el-button>
<el-button type="danger" @click="deleteClickB(scope.row)" class="mb-20px w45px"> 删除</el-button>
<div style="float: right;" v-if="scope.$index !== 0 && scope.$index !==infoData.length-1">
<el-button style="color: #000;width: 45px;height: 33px;" @click="onUpload(scope.row)">
<el-button
type="primary"
@click="editClickB('edit', scope.row)"
class="mb-20px w45px"
>
编辑</el-button
>
<el-button
type="danger"
@click="deleteClickB(scope.row)"
class="mb-20px w45px"
>
删除</el-button
>
<div
style="float: right"
v-if="
scope.$index !== 0 &&
scope.$index !== infoData.length - 1
"
>
<el-button
style="color: #000; width: 45px; height: 33px"
@click="onUpload(scope.row)"
>
<el-icon><Upload /></el-icon>
</el-button>
<el-button style="color: #000;width: 45px;height: 33px;" @click="ondownloads(scope.row)">
<el-button
style="color: #000; width: 45px; height: 33px"
@click="ondownloads(scope.row)"
>
<el-icon><Download /></el-icon>
</el-button>
</div>
</div>
</template>
</el-table-column>
</el-table>
</div>
<div class="float-right absolute bottom-0px right-30px z-2000 bg-#fff">
<el-pagination v-model:current-page="pageInfo.currentPage" v-model:page-size="pageInfo.pageSize"
layout="prev, pager, next, jumper" :total="pageInfo.total"
@size-change="handleSizeChange" @current-change="handleCurrentChange" />
<div
class="float-right absolute bottom-0px right-30px z-2000 bg-#fff"
>
<el-pagination
v-model:current-page="pageInfo.currentPage"
v-model:page-size="pageInfo.pageSize"
layout="prev, pager, next, jumper"
:total="pageInfo.total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
</el-tab-pane>
</el-tabs>
</div>
<NModal v-model:show="shomkA">
<div class="bg-#FFF p30px">
@ -114,9 +262,10 @@
</el-form-item>
<br />
<div class="text-center">
<el-button type="primary" @click="addClickA(editA)" class="mb-20px"> 确认</el-button>
<el-button type="primary" @click="addClickA(editA)" class="mb-20px">
确认</el-button
>
</div>
</el-form>
</div>
</NModal>
@ -132,84 +281,128 @@
<el-input v-model="editB.sort" type="number" />
</el-form-item>
<br />
<el-form-item label="所属类别">
<el-cascader v-model="editB.cateId" :options="tableData" @change="handleChange"
:props="{ children: 'childList', label: 'name', value: 'id' }" />
<!-- <el-form-item label="所属类别">
<el-cascader
v-model="editB.cateId"
:options="tableData"
@change="handleChange"
:props="{ children: 'childList', label: 'name', value: 'id' }"
/>
</el-form-item>
<br />
<br /> -->
<el-form-item label="查看范围">
<el-button class="button" @click="getUser" :type="userData?'success':''" :icon="userData?'Check':''">{{userData?'已设置':'设置'}}</el-button>
<el-button
class="button"
@click="getUser"
:type="userData ? 'success' : ''"
:icon="userData ? 'Check' : ''"
>{{ userData ? '已设置' : '设置' }}</el-button
>
</el-form-item>
<br/>
<br />
<el-form-item label="文件">
<el-upload v-model:file-list="editB.fileList" class="upload-demo" :headers="header"
action="/test-api/common/upload" :on-exceed="handOnExceed" multiple="true">
<el-upload
v-model:file-list="editB.fileList"
class="upload-demo"
:headers="header"
action="/test-api/common/upload"
:on-exceed="handOnExceed"
multiple
>
<el-button type="primary">选择文件</el-button>
</el-upload>
</el-form-item>
<br />
<div class="text-center">
<el-button type="primary" @click="addClickB(editB)" class="mb-20px"> 确认</el-button>
<el-button type="primary" @click="addClickB(editB)" class="mb-20px">
确认</el-button
>
</div>
</el-form>
</div>
</NModal>
<n-modal v-model:show="showModal">
<UserList :userDataList="setUserList" @clickChild="handleChild" @CloseThis="CloseThiss"/>
<UserList
:userDataList="setUserList"
@clickChild="handleChild"
@CloseThis="CloseThiss"
/>
</n-modal>
</div>
</template>
<script setup lang="ts">
import DataBaseHead from "@/views/home/components/DataBaseHead.vue";
import DataBaseHead from '@/views/home/components/DataBaseHead.vue'
import { useUserStore } from '@/stores/modules/user'
import { cateAdd, cateUpdate, treeDbList, cateInfo, cateDel, cateFileUpdate, cateFileDel, cateFileList, download, dragFile } from '@/api/daikin/base'
import { NModal, useMessage, NSelect } from "naive-ui";
import {
cateAdd,
cateUpdate,
treeDbList,
cateInfo,
cateDel,
cateFileUpdate,
cateFileDel,
cateFileList,
download,
dragFile,
fetchdbAuthAdd,
fetchdbAuthGetInfo
} from '@/api/daikin/base'
import { NModal, useMessage, NSelect } from 'naive-ui'
import UserList from '@/views/home/intelligence/process/UserPages.vue'
import {databaseld} from "@/stores/modules/database"
import { databaseld } from '@/stores/modules/database'
const { push } = useRouter();
const database = databaseld()
const store = useUserStore()
const message = useMessage()
const userCode = ['admin', 'database_dandang', 'tech_service'].includes(
store.user.roleCode
)
const tableData = ref()
const infoData = ref()
const shomkA = ref()
const shomkA = ref(false)
const editA = ref()
const shomkB = ref()
const shomkB = ref(false)
const editB = ref()
const activeName = ref('first')
const pageInfo = reactive({
currentPage:1,
pageSize:10,
total:10
currentPage: 1,
pageSize: 10,
total: 10
})
async function getTree() {
const { data } = await treeDbList({})
tableData.value = data
}
let cateIds = ref()
watchEffect(()=>{
watchEffect(() => {
cateIds.value = database.database.id
console.log(database.database.id)
if(database.database.id){
if (database.database.id) {
getInfo(database.database.id)
getAuth()
}
})
async function getInfo(cateId: string | undefined) {
const { rows,total } = await cateFileList({ cateId:cateIds.value, pageNum: pageInfo.currentPage, pageSize: pageInfo.pageSize })
async function getInfo(cateId?: string | undefined) {
const { rows, total } = await cateFileList({
cateId: cateIds.value,
pageNum: pageInfo.currentPage,
pageSize: pageInfo.pageSize
})
infoData.value = rows
pageInfo.total = total
if(rows&&rows.length>0){
rows.map((item: { filePath: any; })=>Object.assign(item,{
if (rows && rows.length > 0) {
rows.map((item: { filePath: any }) =>
Object.assign(item, {
fileList: item.filePath
}))
})
)
}
}
const store = useUserStore()
const deptId = ref()
onMounted(() => {
// getTree()
@ -225,11 +418,9 @@ const editClickA = (edit: any, obj: any) => {
pid: obj.id,
type: edit
}
}
else if (obj && obj.id) {
} else if (obj && obj.id) {
editA.value = obj
}
else {
} else {
editA.value = {
name: '',
sort: '',
@ -238,15 +429,15 @@ const editClickA = (edit: any, obj: any) => {
}
}
console.log(editA.value)
shomkA.value = true
}
const deleteClickA = async (row: any) => {
if (row && row.id) {
const { code, msg } = await cateDel({ id: row.id })
if (code === 200) { message.success("删除成功") }
else message.warning(msg)
if (code === 200) {
message.success('删除成功')
} else message.warning(msg)
}
getTree()
}
@ -254,13 +445,14 @@ async function addClickA(row: any) {
if (!row) return
if (row.type === 'add') {
const { code, msg } = await cateAdd(row)
if (code === 200) { message.success("新增成功") }
else message.warning(msg)
}
else {
if (code === 200) {
message.success('新增成功')
} else message.warning(msg)
} else {
const { code, msg } = await cateUpdate(row)
if (code === 200) { message.success("修改成功") }
else message.warning(msg)
if (code === 200) {
message.success('修改成功')
} else message.warning(msg)
}
shomkA.value = false
getTree()
@ -272,48 +464,50 @@ const editClickB = (edit: any, obj: any) => {
title: '',
cateId: '',
deptId: deptId.value,
filePath:[],
filePath: [],
fileList: [],
type:edit,
userList:[],
sort:0
type: edit,
userList: [],
sort: 0
}
if(obj.filePath){
editB.value.fileList = [{
if (obj.filePath) {
editB.value.fileList = [
{
name: obj.title,
originalFilename: obj.title,
url: obj.filePath,
}]
url: obj.filePath
}
]
}
setUserList.value =obj.userList
}
else if (obj && obj.id) {
setUserList.value = obj.userList
} else if (obj && obj.id) {
editB.value = obj
if(obj.filePath){
editB.value.fileList = [{
if (obj.filePath) {
editB.value.fileList = [
{
name: obj.title,
originalFilename: obj.title,
url: obj.filePath,
}]
url: obj.filePath
}
]
}
setUserList.value =obj.userList
}
else {
setUserList.value = obj.userList
} else {
editB.value = {
cateId: '',
deptId: deptId.value,
title: '',
filePath: [],
fileList: [],
type:edit,
userList:[],
sort:0
type: edit,
userList: [],
sort: 0
}
setUserList.value = []
}
editB.value.cateId = database.database.id
userData.value = false
console.log(editB.value)
shomkB.value = true
@ -321,51 +515,50 @@ const editClickB = (edit: any, obj: any) => {
const deleteClickB = async (row: any) => {
if (row && row.id) {
const { code, msg } = await cateFileDel({ id: row.id })
if (code === 200) { message.success("删除成功") }
else message.warning(msg)
if (code === 200) {
message.success('删除成功')
} else message.warning(msg)
}
getInfo('')
}
async function addClickB(row: any) {
console.log(row,deptId.value)
console.log(row, deptId.value)
if (!row) return
let url: any[] =[]
if(row.fileList&&row.fileList.length>0){
row.fileList.forEach((index)=>{
if(index.response){
let url: any[] = []
if (row.fileList && row.fileList.length > 0) {
row.fileList.forEach((index) => {
if (index.response) {
url.push(index.response.url)
}
else{
} else {
url.push(index.url)
}
})
row.filePath = url
// console.log(url, row.filePath )
}
let list: any[] =[]
if(row.userList&&row.userList.length>0){
let list: any[] = []
if (row.userList && row.userList.length > 0) {
console.log(row)
row.userList.forEach((index) => {
list.push(index.userId)
})
row.userIdList =list
row.userIdList = list
}
if(!row.cateId){
message.error("所属类别不能为空!")
if (!row.cateId) {
message.error('所属类别不能为空!')
return
}
if (row.type === 'add') {
const { code, msg } = await cateFileUpdate(row)
if (code === 200) { message.success("新增成功") }
else message.warning(msg)
}
else {
if (code === 200) {
message.success('新增成功')
} else message.warning(msg)
} else {
const { code, msg } = await cateFileUpdate(row)
if (code === 200) { message.success("修改成功") }
else message.warning(msg)
if (code === 200) {
message.success('修改成功')
} else message.warning(msg)
}
shomkB.value = false
getInfo('')
@ -375,139 +568,187 @@ const handleChange = (e: string | any[]) => {
if (e && e.length == 1) {
// console.log(e, editB.value)
editB.value.cateId = e[0]
}
else if(e && e.length == 2){
} else if (e && e.length == 2) {
editB.value.cateId = e[1]
}
else if(e && e.length == 3){
} else if (e && e.length == 3) {
editB.value.cateId = e[2]
}
else if(e && e.length == 4){
} else if (e && e.length == 4) {
editB.value.cateId = e[3]
}
else {
} else {
editB.value.cateId = e[0]
}
// console.log(e,editB.value.cateId,99999)
}
const handOnExceed: UploadProps['onExceed'] = (uploadFile: any, uploadFiles: any) => {
message.warning("最多只能上传一个文件!")
const handOnExceed: UploadProps['onExceed'] = (
uploadFile: any,
uploadFiles: any
) => {
message.warning('最多只能上传一个文件!')
}
const header = { 'token': store.user.token }
const goBacks=(e)=>{
const header = { token: store.user.token }
const goBacks = (e) => {
// console.log(444)
history.back()
}
const showModal = ref(false)
const flg = ref()
const setUserList =ref()
async function getUser(row: { id: any; userList: any; }) {
console.log(row)
const setUserList = ref()
const dbAuthType = ref()
async function getUser(row: { id?: any; userList?: any; type?: number }) {
showModal.value = !showModal.value
flg.value = row
if(row.id&&row.userList){
if (row.id && row.userList) {
setUserList.value = row.userList
}
// const {data: userArr} = await getBPCUser({moduleId})
// setUserList.value = userArr
if (typeof row.type === 'number') {
dbAuthType.value = row.type
const { data: userArr } = await fetchdbAuthGetInfo({
cateId: cateIds.value,
type: row.type
})
setUserList.value = userArr
}
}
//
const userData = ref(false)
const handleChild = (data: any) => {
console.log(data, 444);
//
const userData = ref(false)
const handleChild = async (data: any) => {
console.log(data, 444)
const { showModal: show, multipleSelection } = data
showModal.value = unref(show)
let userIdList: any[] =[]
multipleSelection.value.forEach((i: { userId: any })=>{
showModal.value = unref(show) || false
let userIdList: any[] = []
multipleSelection.value.forEach((i: { userId: any }) => {
userIdList.push(i.userId)
})
if(flg.value.id){
if (dbAuthType.value) {
const { code }: any = await fetchdbAuthAdd({
cateId: cateIds.value,
type: dbAuthType.value,
userIdList
})
if (code == 200) {
message.success('设置成功!')
if (dbAuthType.value) {
dbAuthType.value = 0
getAuth()
}
}
return
}
if (flg.value.id) {
flg.value.userIdList = userIdList
// marketPreADD(flg.value)
// getDataA();
console.log(flg.value)
}
editB.value.userIdList = userIdList
if(userIdList.length>0){
if (userIdList.length > 0) {
userData.value = true
console.log(userIdList,8888)
}
else userData.value = false
}
const CloseThiss = (data: boolean)=>{
console.log(userIdList, 8888)
} else userData.value = false
}
const CloseThiss = (data: boolean) => {
showModal.value = data
// setUserList.value = []
if (dbAuthType.value) {
dbAuthType.value = 0
getAuth()
}
const getAll=()=>{
}
const getAll = () => {
// cateIds.value = ''
getInfo()
}
const lazyState = computed(() => [pageInfo.currentPage])
watch(
watch(
() => unref(lazyState),
async (v) => {
getTree()
},
{ immediate: true, deep: true },
)
{ immediate: true, deep: true }
)
const handleSizeChange=(e)=>{
const handleSizeChange = (e) => {
console.log(e)
}
const handleCurrentChange=(e)=>{
const handleCurrentChange = (e) => {
console.log(e)
}
//
async function onUpload(it){
console.log(infoData);
async function onUpload(it) {
console.log(infoData)
//
let index = infoData._rawValue.findIndex((value :any) => value.id === it.id);
index -= 1;
let index = infoData._rawValue.findIndex((value: any) => value.id === it.id)
index -= 1
const onUploaddate = await dragFile({
cateId:it.cateId,
curId:it.id,
lastId:infoData._rawValue[index].id,
});
getInfo();
cateId: it.cateId,
curId: it.id,
lastId: infoData._rawValue[index].id
})
getInfo()
console.log(infoData);
console.log(it.cateId,"分类id");
console.log(it.id, "当前位置的id");
console.log(infoData._rawValue[index].id,"上移位置的id");
// console.log(tableData._rawValue);
console.log(infoData)
console.log(it.cateId, '分类id')
console.log(it.id, '当前位置的id')
console.log(infoData._rawValue[index].id, '上移位置的id')
// console.log(tableData._rawValue);
}
//
async function ondownloads(it){
async function ondownloads(it) {
//
let index = infoData._rawValue.findIndex((value) => value.id === it.id);
index += 1;
let index = infoData._rawValue.findIndex((value) => value.id === it.id)
index += 1
// const {rows,total} = await cateFileList({cateId:prop.cateId,pageNum:currentPage,pageSize})
const ondownloads = await dragFile({
cateId:it.cateId,
curId:it.id,
lastId:infoData._rawValue[index].id,
});
getInfo();
console.log(ondownloads);
cateId: it.cateId,
curId: it.id,
lastId: infoData._rawValue[index].id
})
getInfo()
console.log(ondownloads)
}
//
const setUpload = ref(false)
const hasUpload = ref(false)
const setReview = ref(false)
const hasReview = ref(false)
async function getAuth() {
const { data: uploadUser = [] } = await fetchdbAuthGetInfo({
cateId: cateIds.value,
type: 1
})
setUpload.value = uploadUser.length > 0
hasUpload.value = uploadUser.findIndex((x:any) => x.userId === store.user?.id) > -1
const { data: reviewUser = [] } = await fetchdbAuthGetInfo({
cateId: cateIds.value,
type: 2
})
setReview.value = reviewUser.length > 0
hasReview.value = reviewUser.findIndex((x:any) => x.userId === store.user?.id) > -1
}
const handleClick = () => {
console.log(cateIds.value)
push({path:'/DataBase/review',query:{cateId:cateIds.value}})
}
const handTooltip = (data: any[] = []) => {
return data.map((item:any) => item.nickName)?.join(', ') || ''
}
</script>
<style lang="less">
<style lang="less" scoped>
::-webkit-scrollbar {
width: 1px;
}
.tableClass .cell{
padding: 0!important;
.tableClass .cell {
padding: 0 !important;
height: 50px;
line-height: 25px !important;
text-align: center;
}
.descStyle {
}
.descStyle {
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;

View File

@ -12,6 +12,7 @@ import { saveArticle } from '@/api/daikin/base'
import { useUserStore } from '@/stores/modules/user'
const store =useUserStore()
console.log("🚀 ~ file: Layout.vue:15 ~ store:", store.user)
const { day, week } = useDate()
const { push } = useRouter()
@ -29,10 +30,10 @@ const { push } = useRouter()
<div class="text-36px">外部情报</div>
<div class="text-18px ml40px mr25px">{{ day }}</div>
<div class="text-18px flex-1">{{ week }}</div>
<div style="margin-right: 8px" v-if="store.user.isPublish === 1">
<div style="margin-right: 8px" v-if="store.user.isPublish === 1 || store.user.roleCode === 'zhuxi'">
<div class="add text-18px px13px py11px cursor-pointer" @click="push({ path: '/Home/Process' })">情报流程</div>
</div>
<div style="margin-right: 8px" v-if="store.user.isPublish ===1">
<div style="margin-right: 8px" v-if="store.user.isPublish ===1 || store.user.roleCode === 'zhuxi'">
<div class="add text-18px px13px py11px cursor-pointer" @click="push({name:'messageSelect'})"></div>
</div>
<div v-if="store.user.isPublish ===1">