From f54f7e1608bd9868b5fdf83fa6c9d2e11d839a18 Mon Sep 17 00:00:00 2001 From: wwl Date: Thu, 13 Jun 2024 17:46:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=BD=AE=E9=A1=B6=E5=92=8C?= =?UTF-8?q?=E5=AE=9A=E6=97=B6=E5=8F=91=E5=B8=83=E5=8A=9F=E8=83=BD,?= =?UTF-8?q?=E5=85=B6=E4=BB=96=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components.d.ts | 1 + src/utils/index.ts | 51 +- src/views/extermal/Board/index.vue | 48 +- src/views/home/bcp/modify.vue | 914 ++++++++----- src/views/home/bcp/modify_new.vue | 1133 +++++++++++------ src/views/home/components/New.vue | 4 +- src/views/home/csr/CSRContent23.vue | 15 +- src/views/home/csr/modifyCSR2.vue | 1108 ++++++++-------- src/views/home/database/modify.vue | 35 + src/views/home/diffspace/fack.vue | 106 ++ src/views/home/diffspace/modifys.vue | 352 +++-- .../intelligence/components/InfosEdit.vue | 39 +- .../home/intelligence/process/ProcessInfo.vue | 34 + src/views/home/market/modify.vue | 305 +++-- src/views/home/market/modifys.vue | 304 +++-- src/views/home/quality/modify.vue | 205 ++- src/views/index.vue | 7 +- 17 files changed, 2969 insertions(+), 1692 deletions(-) diff --git a/components.d.ts b/components.d.ts index c789d9a..0ffb117 100644 --- a/components.d.ts +++ b/components.d.ts @@ -39,6 +39,7 @@ declare module 'vue' { ElRow: typeof import('element-plus/es')['ElRow'] ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] ElSelect: typeof import('element-plus/es')['ElSelect'] + ElSwitch: typeof import('element-plus/es')['ElSwitch'] ElTable: typeof import('element-plus/es')['ElTable'] ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] ElTabPane: typeof import('element-plus/es')['ElTabPane'] diff --git a/src/utils/index.ts b/src/utils/index.ts index ccd5606..e3f74ae 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -4,10 +4,51 @@ dayjs.extend(isSameOrAfter) // dayjs.extend(isBefore) function isNotOneWeekAgo(date: any) { - if (!date) return false - const oneWeekAgo = dayjs().subtract(1, 'week') - // console.log('🚀 ~ oneWeekAgo:', oneWeekAgo.format('YYYY-MM-DD')) - return dayjs(date).isSameOrAfter(oneWeekAgo, 'day') + if (!date) return false + const oneWeekAgo = dayjs().subtract(1, 'week') + // console.log('🚀 ~ oneWeekAgo:', oneWeekAgo.format('YYYY-MM-DD')) + return dayjs(date).isSameOrAfter(oneWeekAgo, 'day') } -export { isNotOneWeekAgo } +const pickerOptions = { + disabledDate(time) { + return time.getTime() < Date.now() + }, + valueFormat: 'YYYY-MM-dd HH:mm:ss', + shortcuts: [ + { + text: '3天后', + value: () => { + const date = new Date() + date.setTime(date.getTime() + 3600 * 1000 * 24 * 3) + return date + } + }, + { + text: '5天后', + value: () => { + const date = new Date() + date.setTime(date.getTime() + 3600 * 1000 * 24 * 5) + return date + } + }, + { + text: '7天后', + value: () => { + const date = new Date() + date.setTime(date.getTime() + 3600 * 1000 * 24 * 7) + return date + } + }, + { + text: '10天后', + value: () => { + const date = new Date() + date.setTime(date.getTime() + 3600 * 1000 * 24 * 10) + return date + } + } + ] +} + +export { isNotOneWeekAgo, pickerOptions } diff --git a/src/views/extermal/Board/index.vue b/src/views/extermal/Board/index.vue index 40542e9..e6f9cee 100755 --- a/src/views/extermal/Board/index.vue +++ b/src/views/extermal/Board/index.vue @@ -39,7 +39,9 @@ - 情报公开范围 + + 情报公开范围 +
文本内容预览 + + + + + + + + + + + 提交
@@ -99,6 +133,7 @@ import HomeHead from '@/views/home/components/HomeHead.vue' import { noticeld } from '@/stores/modules/noticeId' import { saveArticle, trendsAdd } from '@/api/daikin/base' import { useDate } from '@/views/home/hooks/useDate' +import { pickerOptions } from '@/utils/date' const editorContent = ref() const { push } = useRouter() const message = useMessage() @@ -116,7 +151,9 @@ let formValue: any = ref({ content: '', reviewSource: '3', isTop: 'N', - treeSource: '3' + treeSource: '3', + isPublish: 0, + publishTime: '' }) function escapeHTML(html: string): string { const tempElement = document.createElement('div') @@ -131,7 +168,8 @@ async function save() { let userIdList: any[] = [] const cont = editorContent.value const content = escapeHTML(cont) - const { title, reviewSource, tag, treeSource, source, type, isTop } = formValue.value + const { title, reviewSource, tag, treeSource, source, type, isTop, isPublish, publishTime } = + formValue.value const cate = not.article.cate // console.log(formValue.value, content,cate) if (dataList.value) { @@ -161,7 +199,9 @@ async function save() { cate, type, content, - userIdList + userIdList, + isPublish, + publishTime }) if (code === 200) { message.success('新增成功') diff --git a/src/views/home/bcp/modify.vue b/src/views/home/bcp/modify.vue index 306f7ba..9724715 100755 --- a/src/views/home/bcp/modify.vue +++ b/src/views/home/bcp/modify.vue @@ -6,7 +6,15 @@ import { useMessage, NModal } from 'naive-ui' import { useUserStore } from '@/stores/modules/user' import UserList from '@/views/home/intelligence/process/UserPages.vue' -import { getBPCUser, BPCSaveUser, getBPCEditList,updateBPC,updateBPCOne,delBPCActList, BPCDownload } from '@/api/daikin/base' +import { + getBPCUser, + BPCSaveUser, + getBPCEditList, + updateBPC, + updateBPCOne, + delBPCActList, + BPCDownload +} from '@/api/daikin/base' const message = useMessage() const store = useUserStore() @@ -24,7 +32,6 @@ const editC = ref() const editD = ref() const editE = ref() - const shomkA = ref(false) const shomkB = ref(false) const shomkC = ref(false) @@ -36,8 +43,8 @@ async function setDataFiles(arr, _row) { arr.value = _row.map((i: { filePathList: { name: any; originalFileName: any }[] }) => { if (i.filePathList && i.filePathList.length > 0) { i.filePathList.forEach((file: { name: any; originalFileName: any }) => { - file.name = file.originalFileName; - }); + file.name = file.originalFileName + }) } return i }) @@ -45,168 +52,180 @@ async function setDataFiles(arr, _row) { } async function getDataA() { - const {rows: dataArr} = await getBPCEditList({moduleId: 1}) - dataA.value = dataArr - setDataFiles(dataArr); + const { rows: dataArr } = await getBPCEditList({ moduleId: 1 }) + dataA.value = dataArr + setDataFiles(dataArr) } async function getDataB() { - const {rows: dataBrr} = await getBPCEditList({moduleId: 2}) - dataB.value = dataBrr - setDataFiles(dataBrr); + const { rows: dataBrr } = await getBPCEditList({ moduleId: 2 }) + dataB.value = dataBrr + setDataFiles(dataBrr) } async function getDataC() { - const {rows: dataCrr} = await getBPCEditList({moduleId: 3}) - dataC.value = dataCrr - setDataFiles(dataCrr); + const { rows: dataCrr } = await getBPCEditList({ moduleId: 3 }) + dataC.value = dataCrr + setDataFiles(dataCrr) } async function getDataD() { - const {rows: dataDrr} = await getBPCEditList({moduleId: 4}) - dataD.value = dataDrr - setDataFiles(dataDrr); + const { rows: dataDrr } = await getBPCEditList({ moduleId: 4 }) + dataD.value = dataDrr + setDataFiles(dataDrr) } async function getDataE() { - const {rows: dataErr} = await getBPCEditList({moduleId: 5}) - dataE.value = dataErr - setDataFiles(dataErr); + const { rows: dataErr } = await getBPCEditList({ moduleId: 5 }) + dataE.value = dataErr + setDataFiles(dataErr) } onMounted(async () => { - getDataA(); - getDataB(); - getDataC(); - getDataD(); - getDataE(); + getDataA() + getDataB() + getDataC() + getDataD() + getDataE() }) function computedName(title) { - let index = title.indexOf("."); + let index = title.indexOf('.') if (index > -1) { - return title.slice(0, index - 1); + return title.slice(0, index - 1) } - return title; + return title } -async function onSubmitA(row: { filePathList?: any; id?: any; indexId?: any; title?: any; proportion?: any; partSum?: any; badSum?: any }) { +async function onSubmitA(row: { + filePathList?: any + id?: any + indexId?: any + title?: any + proportion?: any + partSum?: any + badSum?: any +}) { console.log(row, 444) const { id, status, title, type } = row - let moduleId = 1; + let moduleId = 1 let sendData = [] if (row.fileList && row.fileList.length > 0) { - row.fileList.map(item => { - let obj = { id, status, moduleId }; - if(item.response) { - obj.filePath = item.response.url; - obj.title = title || computedName(item.response.originalFilename); - } - else { - obj.filePath = item.url; - obj.title = title || computedName(item.originalFilename); + row.fileList.map((item) => { + let obj = { id, status, moduleId } + if (item.response) { + obj.filePath = item.response.url + obj.title = title || computedName(item.response.originalFilename) + } else { + obj.filePath = item.url + obj.title = title || computedName(item.originalFilename) } sendData.push(obj) }) } - - if(type == 'add') { + + if (type == 'add') { var { code, msg } = await updateBPC(sendData) - }else { + } else { var { code, msg } = await updateBPCOne(sendData[0]) } - if (code === 200) { message.success("修改成功!") } - else { message.error(msg) } + if (code === 200) { + message.success('修改成功!') + } else { + message.error(msg) + } shomkA.value = false - getDataA(); + getDataA() } async function onSubmitB(row: { filePathList?: any; id?: any; cate?: any; title?: any }) { const { id, title, type } = row - let moduleId = 2; + let moduleId = 2 let sendData = [] if (row.fileList && row.fileList.length > 0) { - row.fileList.map(item => { - let obj = { id, status, moduleId }; - if(item.response) { - obj.filePath = item.response.url; - obj.title = title || computedName(item.response.originalFilename); - } - else { - obj.filePath = item.url; - obj.title = title || computedName(item.originalFilename); + row.fileList.map((item) => { + let obj = { id, status, moduleId } + if (item.response) { + obj.filePath = item.response.url + obj.title = title || computedName(item.response.originalFilename) + } else { + obj.filePath = item.url + obj.title = title || computedName(item.originalFilename) } sendData.push(obj) }) } - - if(type == 'add') { + + if (type == 'add') { var { code, msg } = await updateBPC(sendData) - }else { + } else { var { code, msg } = await updateBPCOne(sendData[0]) } - if (code === 200) { message.success("修改成功!") } - else { message.error(msg) } + if (code === 200) { + message.success('修改成功!') + } else { + message.error(msg) + } shomkB.value = false - getDataB(); + getDataB() } async function onSubmitC(row: { filePathList?: any; id?: any; source?: any; title?: any }) { const { id, title, type } = row - let moduleId = 3; + let moduleId = 3 let sendData = [] if (row.fileList && row.fileList.length > 0) { - row.fileList.map(item => { - let obj = { id, status, moduleId }; - if(item.response) { - obj.filePath = item.response.url; - obj.title = title || computedName(item.response.originalFilename); - } - else { - obj.filePath = item.url; - obj.title = title || computedName(item.originalFilename); + row.fileList.map((item) => { + let obj = { id, status, moduleId } + if (item.response) { + obj.filePath = item.response.url + obj.title = title || computedName(item.response.originalFilename) + } else { + obj.filePath = item.url + obj.title = title || computedName(item.originalFilename) } sendData.push(obj) }) } - - if(type == 'add') { + + if (type == 'add') { var { code, msg } = await updateBPC(sendData) - }else { + } else { var { code, msg } = await updateBPCOne(sendData[0]) } - if (code === 200) { message.success("修改成功!") } - else message.error(msg) + if (code === 200) { + message.success('修改成功!') + } else message.error(msg) shomkC.value = false getDataC() } async function onSubmitD(row: { filePathList?: any; id?: any; title?: any }) { const { id, title, type } = row - let moduleId = 4; + let moduleId = 4 let sendData = [] if (row.fileList && row.fileList.length > 0) { - row.fileList.map(item => { - let obj = { id, status, moduleId }; - if(item.response) { - obj.filePath = item.response.url; - obj.title = title || computedName(item.response.originalFilename); - } - else { - obj.filePath = item.url; - obj.title = title || computedName(item.originalFilename); + row.fileList.map((item) => { + let obj = { id, status, moduleId } + if (item.response) { + obj.filePath = item.response.url + obj.title = title || computedName(item.response.originalFilename) + } else { + obj.filePath = item.url + obj.title = title || computedName(item.originalFilename) } sendData.push(obj) }) } - - if(type == 'add') { + + if (type == 'add') { var { code, msg } = await updateBPC(sendData) - }else { + } else { var { code, msg } = await updateBPCOne(sendData[0]) } - if (code === 200) { message.success("修改成功!") } - else { + if (code === 200) { + message.success('修改成功!') + } else { message.error(msg) } shomkD.value = false @@ -214,53 +233,54 @@ async function onSubmitD(row: { filePathList?: any; id?: any; title?: any }) { } async function onSubmitE(row: { filePathList?: any; id?: any; title?: any }) { const { id, title, type } = row - let moduleId = 5; + let moduleId = 5 let sendData = [] if (row.fileList && row.fileList.length > 0) { - row.fileList.map(item => { - let obj = { id, status, moduleId }; - if(item.response) { - obj.filePath = item.response.url; - obj.title = title || computedName(item.response.originalFilename); - } - else { - obj.filePath = item.url; - obj.title = title || computedName(item.originalFilename); + row.fileList.map((item) => { + let obj = { id, status, moduleId } + if (item.response) { + obj.filePath = item.response.url + obj.title = title || computedName(item.response.originalFilename) + } else { + obj.filePath = item.url + obj.title = title || computedName(item.originalFilename) } sendData.push(obj) }) } - - if(type == 'add') { + + if (type == 'add') { var { code, msg } = await updateBPC(sendData) - }else { + } else { var { code, msg } = await updateBPCOne(sendData[0]) } - if (code === 200) { message.success("修改成功!") } - else { + if (code === 200) { + message.success('修改成功!') + } else { message.error(msg) } shomkE.value = false getDataE() } - const handleEditA = (type: string, row: any) => { editA.value = { type: type, status: '紧急', title: '', - fileList: [], + fileList: [] } shomkA.value = true if (!row) return editA.value = row - editA.value.type = type; - editA.value.fileList = [{ - name: row.title, - originalFilename: row.title, - url: row.filePath, - }] + editA.value.type = type + editA.value.fileList = [ + { + name: row.title, + originalFilename: row.title, + url: row.filePath + } + ] // BPCDownload({ id: row.id }).then(res => { // editA.value.fileList = [res.data] // }) @@ -269,17 +289,19 @@ const handleEditB = (type: string, row: any) => { editB.value = { type: type, title: '', - fileList: [], + fileList: [] } shomkB.value = true if (!row) return editB.value = row - editB.value.type = type; - editB.value.fileList = [{ - name: row.title, - originalFilename: row.title, - url: row.filePath, - }] + editB.value.type = type + editB.value.fileList = [ + { + name: row.title, + originalFilename: row.title, + url: row.filePath + } + ] // editB.value.fileList = [row.filePath] // BPCDownload({ id: row.id }).then(res => { // editB.value.fileList = [res.data] @@ -289,17 +311,19 @@ const handleEditC = (type: string, row: any) => { editC.value = { type: type, title: '', - fileList: [], + fileList: [] } shomkC.value = true if (!row) return editC.value = row - editC.value.type = type; - editC.value.fileList = [{ - name: row.title, - originalFilename: row.title, - url: row.filePath, - }] + editC.value.type = type + editC.value.fileList = [ + { + name: row.title, + originalFilename: row.title, + url: row.filePath + } + ] // editC.value.fileList = [row.filePath] // BPCDownload({ id: row.id }).then(res => { // editC.value.fileList = [res.data] @@ -309,17 +333,19 @@ const handleEditD = (type: string, row: any) => { editD.value = { type: type, title: '', - fileList: [], + fileList: [] } shomkD.value = true if (!row) return editD.value = row - editD.value.type = type; - editD.value.fileList = [{ - name: row.title, - originalFilename: row.title, - url: row.filePath, - }] + editD.value.type = type + editD.value.fileList = [ + { + name: row.title, + originalFilename: row.title, + url: row.filePath + } + ] // BPCDownload({ id: row.id }).then(res => { // editD.value.fileList = [res.data] // }) @@ -328,99 +354,142 @@ const handleEditE = (type: string, row: any) => { editE.value = { type: type, title: '', - fileList: [], + fileList: [] } shomkE.value = true if (!row) return editE.value = row - editE.value.type = type; - editE.value.fileList = [{ - name: row.title, - originalFilename: row.title, - url: row.filePath, - }] + editE.value.type = type + editE.value.fileList = [ + { + name: row.title, + originalFilename: row.title, + url: row.filePath + } + ] // BPCDownload({ id: row.id }).then(res => { // editE.value.fileList = [res.data] // }) } - async function handleDeleteA(index: number, row: any) { const { id } = row if (!id) return const { code, msg } = await delBPCActList({ id }) - if (code === 200) { message.success("删除成功!") } - else { message.error(msg) } - getDataA(); + if (code === 200) { + message.success('删除成功!') + } else { + message.error(msg) + } + getDataA() } async function handleDeleteB(index: number, row: any) { const { id } = row if (!id) return const { code, msg } = await delBPCActList({ id }) - if (code === 200) { message.success("删除成功!") } - else { message.error(msg) } - - getDataB(); + if (code === 200) { + message.success('删除成功!') + } else { + message.error(msg) + } + + getDataB() } async function handleDeleteC(index: number, row: any) { - const { id } = row if (!id) return const { code, msg } = await delBPCActList({ id }) - if (code === 200) { message.success("删除成功!") } - else { message.error(msg) } + if (code === 200) { + message.success('删除成功!') + } else { + message.error(msg) + } getDataC() } async function handleDeleteD(index: number, row: any) { const { id } = row if (!id) return const { code, msg } = await delBPCActList({ id }) - if (code === 200) { message.success("删除成功!") } - else { message.error(msg) } - getDataD(); + if (code === 200) { + message.success('删除成功!') + } else { + message.error(msg) + } + getDataD() } async function handleDeleteE(index: number, row: any) { const { id } = row if (!id) return const { code, msg } = await delBPCActList({ id }) - if (code === 200) { message.success("删除成功!") } - else { message.error(msg) } - getDataE(); + if (code === 200) { + message.success('删除成功!') + } else { + message.error(msg) + } + getDataE() } -const activeName = ref("first") +const activeName = ref('first') const userList = ref() const showModal = ref(false) const flg = ref() -const setUserList =ref() +const setUserList = ref() async function getUser(moduleId: any) { showModal.value = !showModal.value flg.value = moduleId - const {data: userArr} = await getBPCUser({moduleId}) + const { data: userArr } = await getBPCUser({ moduleId }) setUserList.value = userArr - } - // 获取子组件传过来的值 - const handleChild = (data: any) => { - console.log(data, 444); - const { showModal: show, multipleSelection } = data - showModal.value = unref(show) - // userList.value = multipleSelection - let userIdList: any[] =[] - multipleSelection.value.forEach((i: { userId: any })=>{ - // console.log(dataList.value) - userIdList.push(i.userId) - }) - - BPCSaveUser({ - moduleId: flg.value, - userIdList: userIdList - }) - } - const CloseThiss = (data: boolean)=>{ - showModal.value = data - } +// 获取子组件传过来的值 +const handleChild = (data: any) => { + console.log(data, 444) + const { showModal: show, multipleSelection } = data + showModal.value = unref(show) + // userList.value = multipleSelection + let userIdList: any[] = [] + multipleSelection.value.forEach((i: { userId: any }) => { + // console.log(dataList.value) + userIdList.push(i.userId) + }) + BPCSaveUser({ + moduleId: flg.value, + userIdList: userIdList + }) +} +const CloseThiss = (data: boolean) => { + showModal.value = data +} + +const pickerOptions = { + disabledDate(time) { + return time.getTime() > Date.now() + }, + shortcuts: [ + { + text: '今天', + onClick(picker) { + picker.$emit('pick', new Date()) + } + }, + { + text: '昨天', + onClick(picker) { + const date = new Date() + date.setTime(date.getTime() - 3600 * 1000 * 24) + picker.$emit('pick', date) + } + }, + { + text: '一周前', + onClick(picker) { + const date = new Date() + date.setTime(date.getTime() - 3600 * 1000 * 24 * 7) + picker.$emit('pick', date) + } + } + ] +} @@ -733,4 +975,4 @@ async function getUser(moduleId: any) { justify-content: center; margin: 0 auto; } - \ No newline at end of file + diff --git a/src/views/home/bcp/modify_new.vue b/src/views/home/bcp/modify_new.vue index de6e678..2bc2760 100755 --- a/src/views/home/bcp/modify_new.vue +++ b/src/views/home/bcp/modify_new.vue @@ -6,8 +6,21 @@ import { useMessage, NModal } from 'naive-ui' import { useUserStore } from '@/stores/modules/user' import UserList from '@/views/home/intelligence/process/UserPages.vue' import Editor from '@/views/home/intelligence/components/TinyECE.vue' +import { pickerOptions } from '@/utils/date' -import { getBPCUser, BPCSaveUser, getBPCEditList,updateBPC,updateBPCOne,delBPCActList, delActCate, BPCDownload, getCateTreeList, getBPCActList, updateActCate } from '@/api/daikin/base' +import { + getBPCUser, + BPCSaveUser, + getBPCEditList, + updateBPC, + updateBPCOne, + delBPCActList, + delActCate, + BPCDownload, + getCateTreeList, + getBPCActList, + updateActCate +} from '@/api/daikin/base' import { computed } from 'vue' const editorContent = ref() const handleEditorChild = (data: string) => { @@ -30,7 +43,6 @@ const editC = ref() const editD = ref() const editE = ref() - const shomkA = ref(false) const shomkB = ref(false) const shomkC = ref(false) @@ -42,8 +54,8 @@ async function setDataFiles(arr, _row) { arr.value = _row.map((i: { filePathList: { name: any; originalFileName: any }[] }) => { if (i.filePathList && i.filePathList.length > 0) { i.filePathList.forEach((file: { name: any; originalFileName: any }) => { - file.name = file.originalFileName; - }); + file.name = file.originalFileName + }) } return i }) @@ -51,98 +63,111 @@ async function setDataFiles(arr, _row) { } function getFileName(url) { - if (!url) return ""; - let lastSplashIndex = url.lastIndexOf("/"); - let lastDotIndex = url.lastIndexOf("."); - return url.slice(lastSplashIndex + 1, lastDotIndex); + if (!url) return '' + let lastSplashIndex = url.lastIndexOf('/') + let lastDotIndex = url.lastIndexOf('.') + return url.slice(lastSplashIndex + 1, lastDotIndex) } async function getDataA() { - const {rows: dataArr} = await getBPCActList({moduleId: 1,pageSize:100}) - dataA.value = dataArr.map(item => { - return { - ...item, - fileName: item.fileName || getFileName(item.filePath), - briefName: item.briefName || getFileName(item.briefingPath), - } - }) - setDataFiles(dataArr); -} -async function getDataB() { - const {rows: dataBrr} = await getBPCActList({moduleId: 4,pageSize:100}) - dataB.value = dataBrr - setDataFiles(dataBrr); -} -async function getDataC() { - const {rows: dataCrr} = await getBPCActList({moduleId: 3,pageSize:100}) - dataC.value = dataCrr - setDataFiles(dataCrr); -} -function computedTreeNode(item) { - console.log(item); - let childList = item.childList || [] - let fileList = item.fileList || []; - item.childList = [].concat(childList).concat(fileList).map(item => { + const { rows: dataArr } = await getBPCActList({ moduleId: 1, pageSize: 100 }) + dataA.value = dataArr.map((item) => { return { ...item, - name: item.name || item.title + fileName: item.fileName || getFileName(item.filePath), + briefName: item.briefName || getFileName(item.briefingPath) } - }).map(item => computedTreeNode(item)); - return item; + }) + setDataFiles(dataArr) +} +async function getDataB() { + const { rows: dataBrr } = await getBPCActList({ moduleId: 4, pageSize: 100 }) + dataB.value = dataBrr + setDataFiles(dataBrr) +} +async function getDataC() { + const { rows: dataCrr } = await getBPCActList({ moduleId: 3, pageSize: 100 }) + dataC.value = dataCrr + setDataFiles(dataCrr) +} +function computedTreeNode(item) { + console.log(item) + let childList = item.childList || [] + let fileList = item.fileList || [] + item.childList = [] + .concat(childList) + .concat(fileList) + .map((item) => { + return { + ...item, + name: item.name || item.title + } + }) + .map((item) => computedTreeNode(item)) + return item } async function getDataD() { - const {data: dataDrr} = await getCateTreeList({}); - dataD.value = dataDrr.map(item => computedTreeNode(item)); - console.log(dataD); - setDataFiles(dataDrr); + const { data: dataDrr } = await getCateTreeList({}) + dataD.value = dataDrr.map((item) => computedTreeNode(item)) + console.log(dataD) + setDataFiles(dataDrr) } async function getDataE() { - const {rows: dataErr} = await getBPCEditList({moduleId: 5}) - dataE.value = dataErr - setDataFiles(dataErr); + const { rows: dataErr } = await getBPCEditList({ moduleId: 5 }) + dataE.value = dataErr + setDataFiles(dataErr) } onMounted(async () => { - getDataA(); - getDataB(); - getDataC(); - getDataD(); -// getDataE(); + getDataA() + getDataB() + getDataC() + getDataD() + // getDataE(); }) function computedName(title) { - let index = title.indexOf("."); + let index = title.indexOf('.') if (index > -1) { - return title.slice(0, index - 1); + return title.slice(0, index - 1) } - return title; + return title } -async function onSubmitA(row: { jfileList ? : any; filePathList?: any; id?: any; indexId?: any; title?: any; proportion?: any; partSum?: any; badSum?: any }) { +async function onSubmitA(row: { + jfileList?: any + filePathList?: any + id?: any + indexId?: any + title?: any + proportion?: any + partSum?: any + badSum?: any + isTop?: any + isPublish?: any + publishTime?: any +}) { const { id, title, type, content } = row - let moduleId = 1; + let moduleId = 1 let sendData: any[] = [] - let url: any[] =[] - let obj = { id,moduleId }; + let url: any[] = [] + let obj = { id, moduleId } if (row.fileList && row.fileList.length > 0) { - row.fileList.map(item => { - - if(item.response) { + row.fileList.map((item) => { + if (item.response) { url.push(item.response.url) - obj.title = title || computedName(item.response.originalFilename); - } - else { + obj.title = title || computedName(item.response.originalFilename) + } else { url.push(item.url) - obj.title = title || computedName(item.originalFilename); + obj.title = title || computedName(item.originalFilename) } obj.filePath = url sendData.push(obj) }) - } - else { + } else { obj.title = title - obj.filePath=[] + obj.filePath = [] sendData.push(obj) } // else { @@ -151,13 +176,13 @@ async function onSubmitA(row: { jfileList ? : any; filePathList?: any; id?: any; // } if (row.jfileList && row.jfileList.length > 0) { - sendData[0].briefingPath = row.jfileList[0].url || row.jfileList[0].response.url; + sendData[0].briefingPath = row.jfileList[0].url || row.jfileList[0].response.url } - let editorValue = content || editorContent.value; + let editorValue = content || editorContent.value + // lujinli + sendData[0].content = editorValue + console.log(sendData) // lujinli - sendData[0].content = editorValue; -console.log(sendData) -// lujinli // if (editorValue) { // // console.log(editorValue) // sendData[0].content = editorValue; @@ -166,31 +191,44 @@ console.log(sendData) // message.error("内容字段为必填") // return; // } - sendData[0].cateId = 0; -var { code, msg } = await updateBPC(sendData[0]) - if (code === 200) { message.success("修改成功!") } - else { message.error(msg) } + sendData[0].cateId = 0 + sendData[0].isPublish = row.isPublish + sendData[0].publishTime = row.publishTime + sendData[0].isTop = row.isTop + var { code, msg } = await updateBPC(sendData[0]) + if (code === 200) { + message.success('修改成功!') + } else { + message.error(msg) + } shomkA.value = false - getDataA(); + getDataA() } -async function onSubmitB(row: { filePathList?: any; id?: any; cate?: any; title?: any }) { +async function onSubmitB(row: { + filePathList?: any + id?: any + cate?: any + title?: any + isTop?: any + isPublish?: any + publishTime?: any +}) { const { id, title, type } = row - let moduleId = 4; + let moduleId = 4 let sendData = [] - let url: any[] =[] - let obj + let url: any[] = [] + let obj = {} if (row.fileList && row.fileList.length > 0) { - row.fileList.map(item => { - obj = { id, moduleId }; - if(item.response) { + row.fileList.map((item) => { + obj = { id, moduleId } + if (item.response) { url.push(item.response.url) - obj.title = title || computedName(item.response.originalFilename); - } - else { + obj.title = title || computedName(item.response.originalFilename) + } else { url.push(item.url) - obj.title = title || computedName(item.originalFilename); + obj.title = title || computedName(item.originalFilename) } // if(item.response){ // url.push(item.response.url) @@ -198,67 +236,79 @@ async function onSubmitB(row: { filePathList?: any; id?: any; cate?: any; title? // else{ // url.push(item.url) // } - + obj.filePath = url - + // sendData.push(obj) }) } - + obj.isPublish = row.isPublish + obj.publishTime = row.publishTime + obj.isTop = row.isTop + var { code, msg } = await updateBPC(obj) - if (code === 200) { message.success("修改成功!") } - else { message.error(msg) } + if (code === 200) { + message.success('修改成功!') + } else { + message.error(msg) + } shomkB.value = false - getDataB(); + getDataB() } async function onSubmitC(row: { filePathList?: any; id?: any; source?: any; title?: any }) { const { id, title, type } = row - let moduleId = 3; + let moduleId = 3 let sendData = [] if (row.fileList && row.fileList.length > 0) { - row.fileList.map(item => { - let obj = { id, status, moduleId }; - if(item.response) { - obj.filePath = item.response.url; - obj.title = title || computedName(item.response.originalFilename); - } - else { - obj.filePath = item.url; - obj.title = title || computedName(item.originalFilename); + row.fileList.map((item) => { + let obj = { id, status, moduleId } + if (item.response) { + obj.filePath = item.response.url + obj.title = title || computedName(item.response.originalFilename) + } else { + obj.filePath = item.url + obj.title = title || computedName(item.originalFilename) } sendData.push(obj) }) } - - if(type == 'add') { + + if (type == 'add') { var { code, msg } = await updateBPC(sendData) - }else { + } else { var { code, msg } = await updateBPCOne(sendData[0]) } - if (code === 200) { message.success("修改成功!") } - else message.error(msg) + if (code === 200) { + message.success('修改成功!') + } else message.error(msg) shomkC.value = false getDataC() } -async function onSubmitD(row: { filePathList?: any; id?: any; title?: any }) { +async function onSubmitD(row: { + filePathList?: any + id?: any + title?: any + isTop?: any + isPublish?: any + publishTime?: any +}) { const { id, title, type, pid } = row - let moduleId = 4; + let moduleId = 4 let sendData = [] - let url: any[] =[] - let obj + let url: any[] = [] + let obj if (row.fileList && row.fileList.length > 0) { - row.fileList.map(item => { - obj ={ id, status, moduleId, cateId: pid }; - if(item.response) { + row.fileList.map((item) => { + obj = { id, status, moduleId, cateId: pid } + if (item.response) { url.push(item.response.url) - obj.title = title || computedName(item.response.originalFilename); - } - else { + obj.title = title || computedName(item.response.originalFilename) + } else { url.push(item.url) - obj.title = title || computedName(item.originalFilename); + obj.title = title || computedName(item.originalFilename) } // if(item.response){ // url.push(item.response.url) @@ -266,17 +316,21 @@ async function onSubmitD(row: { filePathList?: any; id?: any; title?: any }) { // else{ // url.push(item.url) // } - + obj.filePath = url - + // sendData.push(obj) }) } + obj.isPublish = row.isPublish + obj.publishTime = row.publishTime + obj.isTop = row.isTop // if(type == 'add') { - var { code, msg } = await updateBPC(obj) + var { code, msg } = await updateBPC(obj) // } - if (code === 200) { message.success("修改成功!") } - else { + if (code === 200) { + message.success('修改成功!') + } else { message.error(msg) } shomkD.value = false @@ -284,70 +338,76 @@ async function onSubmitD(row: { filePathList?: any; id?: any; title?: any }) { } async function onSubmitE(row: { filePathList?: any; id?: any; title?: any }) { const { id, title, type } = row - let moduleId = 5; + let moduleId = 5 let sendData = [] if (row.fileList && row.fileList.length > 0) { - row.fileList.map(item => { - let obj = { id, status, moduleId }; - if(item.response) { - obj.filePath = item.response.url; - obj.title = title || computedName(item.response.originalFilename); - } - else { - obj.filePath = item.url; - obj.title = title || computedName(item.originalFilename); + row.fileList.map((item) => { + let obj = { id, status, moduleId } + if (item.response) { + obj.filePath = item.response.url + obj.title = title || computedName(item.response.originalFilename) + } else { + obj.filePath = item.url + obj.title = title || computedName(item.originalFilename) } sendData.push(obj) }) } - - if(type == 'add') { + + if (type == 'add') { var { code, msg } = await updateBPC(sendData) - }else { + } else { var { code, msg } = await updateBPCOne(sendData[0]) } - if (code === 200) { message.success("修改成功!") } - else { + if (code === 200) { + message.success('修改成功!') + } else { message.error(msg) } shomkE.value = false getDataE() } - const handleEditA = (type: string, row: any) => { - console.log("xiaolu"); - console.log(row,"xiaolu"); - + console.log('xiaolu') + console.log(row, 'xiaolu') + editA.value = { type: type, // status: '紧急', title: '', - content: "", + content: '', fileList: [], jfileList: [] } shomkA.value = true if (!row) return editA.value = row - editA.value.type = type; - console.log(editA.value,"xiaolu") - if(row.filePath!=''){ - editA.value.fileList = [{ - name: getFileName(row.filePath), - originalFilename: row.filePath, - url: row.filePath, - }] - console.log(editA.value,"xiaolu") + editA.value.type = type + console.log(editA.value, 'xiaolu') + if (row.filePath != '') { + editA.value.fileList = [ + { + name: getFileName(row.filePath), + originalFilename: row.filePath, + url: row.filePath + } + ] + console.log(editA.value, 'xiaolu') } - if(row.briefingPath!=''){ - editA.value.jfileList = [{ - name: getFileName(row.briefingPath), - originalFilename: getFileName(row.briefingPath), - url: row.briefingPath, - }] - console.log(editA.value,"xiaolu") + if (row.briefingPath != '') { + editA.value.jfileList = [ + { + name: getFileName(row.briefingPath), + originalFilename: getFileName(row.briefingPath), + url: row.briefingPath + } + ] + console.log(editA.value, 'xiaolu') } + editA.value.isPublish = row.isPublish + editA.value.publishTime = row.publishTime + editA.value.isTop = row.isTop // BPCDownload({ id: row.id }).then(res => { // editA.value.fileList = [res.data] @@ -357,17 +417,22 @@ const handleEditB = (type: string, row: any) => { editB.value = { type: type, title: '', - fileList: [], + fileList: [] } shomkB.value = true if (!row) return editB.value = row - editB.value.type = type; - editB.value.fileList = [{ - name: row.title, - originalFilename: row.title, - url: row.filePath, - }] + editB.value.type = type + editB.value.fileList = [ + { + name: row.title, + originalFilename: row.title, + url: row.filePath + } + ] + editB.value.isPublish = row.isPublish + editB.value.publishTime = row.publishTime + editB.value.isTop = row.isTop // editB.value.fileList = [row.filePath] // BPCDownload({ id: row.id }).then(res => { // editB.value.fileList = [res.data] @@ -377,58 +442,64 @@ const handleEditC = (type: string, row: any) => { editC.value = { type: type, title: '', - fileList: [], + fileList: [] } shomkC.value = true if (!row) return editC.value = row - editC.value.type = type; - editC.value.fileList = [{ - name: row.title, - originalFilename: row.title, - url: row.filePath, - }] + editC.value.type = type + editC.value.fileList = [ + { + name: row.title, + originalFilename: row.title, + url: row.filePath + } + ] + // editC.value.isPublish = row.isPublish + // editC.value.publishTime = row.publishTime + // editC.value.isTop = row.isTop // editC.value.fileList = [row.filePath] // BPCDownload({ id: row.id }).then(res => { // editC.value.fileList = [res.data] // }) } // todo -const editTreeD = ref(); -const shomTreekD = ref(); +const editTreeD = ref() +const shomTreekD = ref() const handleTreeEditD = (type, row) => { - editTreeD.value = { - name: '' - } - shomTreekD.value = true - if (!row) return - editTreeD.value = row + editTreeD.value = { + name: '' + } + shomTreekD.value = true + if (!row) return + editTreeD.value = row } const addSubD = (type, row) => { - editTreeD.value = { - name: '', - pid: row.id - } - shomTreekD.value = true + editTreeD.value = { + name: '', + pid: row.id + } + shomTreekD.value = true } -const onSubmitTreeD = async(row) => { +const onSubmitTreeD = async (row) => { const { id, name, pid = 0 } = row let sendData = { pid, id, name } - - var { code, msg } = await updateActCate(sendData); - if (code === 200) { message.success("修改成功!") } - else { + + var { code, msg } = await updateActCate(sendData) + if (code === 200) { + message.success('修改成功!') + } else { message.error(msg) } shomTreekD.value = false getDataD() } -const handleEditSubD = async(typ,row) => { +const handleEditSubD = async (typ, row) => { editD.value = { pid: row.id, - title: "", + title: '', fileList: [], - type:typ + type: typ } shomkD.value = true } @@ -436,17 +507,22 @@ const handleEditD = (type: string, row: any) => { editD.value = { type: type, title: '', - fileList: [], + fileList: [] } shomkD.value = true if (!row) return editD.value = row - editD.value.type = type; - editD.value.fileList = [{ - name: row.title, - originalFilename: row.title, - url: row.filePath, - }] + editD.value.type = type + editD.value.fileList = [ + { + name: row.title, + originalFilename: row.title, + url: row.filePath + } + ] + editD.value.isPublish = row.isPublish + editD.value.publishTime = row.publishTime + editD.value.isTop = row.isTop // BPCDownload({ id: row.id }).then(res => { // editD.value.fileList = [res.data] // }) @@ -455,107 +531,123 @@ const handleEditE = (type: string, row: any) => { editE.value = { type: type, title: '', - fileList: [], + fileList: [] } shomkE.value = true if (!row) return editE.value = row - editE.value.type = type; - editE.value.fileList = [{ - name: row.title, - originalFilename: row.title, - url: row.filePath, - }] + editE.value.type = type + editE.value.fileList = [ + { + name: row.title, + originalFilename: row.title, + url: row.filePath + } + ] // BPCDownload({ id: row.id }).then(res => { // editE.value.fileList = [res.data] // }) } - async function handleDeleteA(index: number, row: any) { const { id } = row if (!id) return const { code, msg } = await delBPCActList({ id }) - if (code === 200) { message.success("删除成功!") } - else { message.error(msg) } - getDataA(); + if (code === 200) { + message.success('删除成功!') + } else { + message.error(msg) + } + getDataA() } async function handleDeleteB(index: number, row: any) { const { id } = row if (!id) return const { code, msg } = await delBPCActList({ id }) - if (code === 200) { message.success("删除成功!") } - else { message.error(msg) } - - getDataB(); + if (code === 200) { + message.success('删除成功!') + } else { + message.error(msg) + } + + getDataB() } async function handleDeleteC(index: number, row: any) { - const { id } = row if (!id) return const { code, msg } = await delBPCActList({ id }) - if (code === 200) { message.success("删除成功!") } - else { message.error(msg) } + if (code === 200) { + message.success('删除成功!') + } else { + message.error(msg) + } getDataC() } async function handleDeleteD(index: number, row: any) { const { id } = row if (!id) return const { code, msg } = await delBPCActList({ id }) - if (code === 200) { message.success("删除成功!") } - else { message.error(msg) } - getDataD(); + if (code === 200) { + message.success('删除成功!') + } else { + message.error(msg) + } + getDataD() } async function handleTreeDeleteD(index: number, row: any) { const { id } = row if (!id) return const { code, msg } = await delActCate({ id }) - if (code === 200) { message.success("删除成功!") } - else { message.error(msg) } - getDataD(); + if (code === 200) { + message.success('删除成功!') + } else { + message.error(msg) + } + getDataD() } async function handleDeleteE(index: number, row: any) { const { id } = row if (!id) return const { code, msg } = await delBPCActList({ id }) - if (code === 200) { message.success("删除成功!") } - else { message.error(msg) } - getDataE(); + if (code === 200) { + message.success('删除成功!') + } else { + message.error(msg) + } + getDataE() } -const activeName = ref("first") +const activeName = ref('first') const userList = ref() const showModal = ref(false) const flg = ref() -const setUserList =ref() +const setUserList = ref() async function getUser(moduleId: any) { showModal.value = !showModal.value flg.value = moduleId - const {data: userArr} = await getBPCUser({moduleId}) + const { data: userArr } = await getBPCUser({ moduleId }) setUserList.value = userArr - } - // 获取子组件传过来的值 - const handleChild = (data: any) => { - console.log(data, 444); - const { showModal: show, multipleSelection } = data - showModal.value = unref(show) - // userList.value = multipleSelection - let userIdList: any[] =[] - multipleSelection.value.forEach((i: { userId: any })=>{ - // console.log(dataList.value) - userIdList.push(i.userId) - }) - - BPCSaveUser({ - moduleId: flg.value, - userIdList: userIdList - }) - } - const CloseThiss = (data: boolean)=>{ - showModal.value = data - } +// 获取子组件传过来的值 +const handleChild = (data: any) => { + console.log(data, 444) + const { showModal: show, multipleSelection } = data + showModal.value = unref(show) + // userList.value = multipleSelection + let userIdList: any[] = [] + multipleSelection.value.forEach((i: { userId: any }) => { + // console.log(dataList.value) + userIdList.push(i.userId) + }) + BPCSaveUser({ + moduleId: flg.value, + userIdList: userIdList + }) +} +const CloseThiss = (data: boolean) => { + showModal.value = data +} @@ -887,4 +1198,4 @@ async function getUser(moduleId: any) { justify-content: center; margin: 0 auto; } - \ No newline at end of file + diff --git a/src/views/home/components/New.vue b/src/views/home/components/New.vue index 6e3ad21..7f20a5d 100755 --- a/src/views/home/components/New.vue +++ b/src/views/home/components/New.vue @@ -195,11 +195,11 @@ fetchNewDataList()
最近更新
-
+

{ const csrSupplierList = ref([]) const selMonth = ref('') const getCsrSupplierList = (index?: any) => { - const month = index || index === 0 ? query.value.year + '-' + months[index] : '' + const _m = +months[index] + const month = + index || index === 0 + ? (_m < 4 ? +query.value.year + 1 : query.value.year) + '-' + months[index] + : '' csrSupplierList.value = [] selMonth.value = '' const req = { pageNum: 1, pageSize: 10, ...query.value, month } + req.year = _m < 4 ? +req.year + 1 : req.year req.supplierName ? fetchCsrSupplierList(req).then((res: any) => { csrSupplierList.value = (res.rows || []).filter((item: any) => item.submitunCount > 0) }) - : fetchCsrSupplierTopList(req).then((res: any) => { + : fetchCsrSupplierTopList({ ...req }).then((res: any) => { csrSupplierList.value = (res.rows || []).filter((item: any) => item.submitunCount > 0) }) - selMonth.value = month ? +months[index] + '月' : '' + selMonth.value = month ? months[index] : '' } const getCsrSupplierTaskInfo = () => { @@ -326,7 +331,9 @@ getCsrSupplierTaskInfo()

-
未提交供应商明细({{ query.year }}年{{ selMonth }})
+
+ 未提交供应商明细({{ +selMonth < 4 ? +query.year + 1 : query.year }}年{{ selMonth }}月) +
更新时间:{{ updateTime }}
diff --git a/src/views/home/csr/modifyCSR2.vue b/src/views/home/csr/modifyCSR2.vue index 22d9348..5628fb5 100755 --- a/src/views/home/csr/modifyCSR2.vue +++ b/src/views/home/csr/modifyCSR2.vue @@ -1,281 +1,280 @@ diff --git a/src/views/home/database/modify.vue b/src/views/home/database/modify.vue index fea8a2b..9734e07 100755 --- a/src/views/home/database/modify.vue +++ b/src/views/home/database/modify.vue @@ -393,6 +393,40 @@
+ + + +
+ + + +
+ + + + +
确认
@@ -465,6 +499,7 @@ import { import { NModal, useMessage, NSelect } from 'naive-ui' import UserList from '@/views/home/intelligence/process/UserPages.vue' import { databaseld } from '@/stores/modules/database' +import { pickerOptions } from '@/utils/date' const { push } = useRouter() const database = databaseld() diff --git a/src/views/home/diffspace/fack.vue b/src/views/home/diffspace/fack.vue index af19feb..1c31360 100755 --- a/src/views/home/diffspace/fack.vue +++ b/src/views/home/diffspace/fack.vue @@ -225,6 +225,40 @@ 选择文件 +
+ + + +
+ + + +
+ + + +
@@ -342,6 +376,40 @@ 选择文件 +
+ + + +
+ + + +
+ + + +
@@ -394,6 +462,40 @@ 选择文件 +
+ + + +
+ + + +
+ + + +
@@ -420,6 +522,7 @@ import ModifyList from './component/modify.vue' import UserList from '@/views/home/intelligence/process/UserPages.vue' const ids = ref('') const { push } = useRouter() +import { pickerOptions } from '@/utils/date' const store = useUserStore() const message = useMessage() @@ -632,6 +735,9 @@ async function onSubmitB(row: { time: string files: never[] fileList: never[] + isTop?: any + isPublish?: any + publishTime?: any }) { // console.log(dataB.value, row.id) dataB.value.map((obj) => { diff --git a/src/views/home/diffspace/modifys.vue b/src/views/home/diffspace/modifys.vue index d05a6cd..343ba50 100755 --- a/src/views/home/diffspace/modifys.vue +++ b/src/views/home/diffspace/modifys.vue @@ -1,9 +1,20 @@