新增置顶和定时发布功能,其他优化

main
wwl 2024-06-13 17:46:47 +08:00
parent 06d4d33eb5
commit f54f7e1608
17 changed files with 2969 additions and 1692 deletions

1
components.d.ts vendored
View File

@ -39,6 +39,7 @@ declare module 'vue' {
ElRow: typeof import('element-plus/es')['ElRow'] ElRow: typeof import('element-plus/es')['ElRow']
ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
ElSelect: typeof import('element-plus/es')['ElSelect'] ElSelect: typeof import('element-plus/es')['ElSelect']
ElSwitch: typeof import('element-plus/es')['ElSwitch']
ElTable: typeof import('element-plus/es')['ElTable'] ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
ElTabPane: typeof import('element-plus/es')['ElTabPane'] ElTabPane: typeof import('element-plus/es')['ElTabPane']

View File

@ -10,4 +10,45 @@ function isNotOneWeekAgo(date: any) {
return dayjs(date).isSameOrAfter(oneWeekAgo, 'day') 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 }

View File

@ -39,7 +39,9 @@
<n-form-item label="内容" path="title"> <n-form-item label="内容" path="title">
<Editor @getChildData="handleChild" class="bg-#fff" /> <Editor @getChildData="handleChild" class="bg-#fff" />
</n-form-item> </n-form-item>
<n-button @click="thisClick" v-if="formValue.cate == 8"> </n-button> <n-button class="w-120px" @click="thisClick" v-if="formValue.cate == 8">
情报公开范围
</n-button>
<div class="mt15px h150px overflow-y-auto" v-if="formValue.cate == 8"> <div class="mt15px h150px overflow-y-auto" v-if="formValue.cate == 8">
<el-tag <el-tag
v-for="i in dataList" v-for="i in dataList"
@ -57,6 +59,38 @@
<n-form-item> <n-form-item>
<n-button @click="showModal1 = true"> 文本内容预览</n-button> <n-button @click="showModal1 = true"> 文本内容预览</n-button>
</n-form-item> </n-form-item>
<n-form-item v-if="formValue.cate != 8" label="是否置顶">
<el-switch
v-model="formValue.isTop"
active-text="置顶"
inactive-text="不置顶"
inactive-value="Y"
active-value="N"
></el-switch>
</n-form-item>
<n-form-item label="是否定时发送">
<el-switch
v-model="formValue.isPublish"
active-text="是"
inactive-text="否"
:inactive-value="0"
:active-value="1"
@change="(val) => (formValue.publishTime = val ? pickerOptions.day : '')"
></el-switch>
</n-form-item>
<n-form-item label="发布时间" v-if="formValue.isPublish == 1">
<el-date-picker
v-model="formValue.publishTime"
align="right"
type="date"
placeholder="选择日期"
:disabledDate="pickerOptions.disabledDate"
:shortcuts="pickerOptions.shortcuts"
:value-format="pickerOptions.valueFormat"
>
</el-date-picker>
</n-form-item>
<el-button type="primary" class="mt20px w-100px" @click="saveThis"></el-button> <el-button type="primary" class="mt20px w-100px" @click="saveThis"></el-button>
</div> </div>
<n-modal v-model:show="showModal1"> <n-modal v-model:show="showModal1">
@ -99,6 +133,7 @@ import HomeHead from '@/views/home/components/HomeHead.vue'
import { noticeld } from '@/stores/modules/noticeId' import { noticeld } from '@/stores/modules/noticeId'
import { saveArticle, trendsAdd } from '@/api/daikin/base' import { saveArticle, trendsAdd } from '@/api/daikin/base'
import { useDate } from '@/views/home/hooks/useDate' import { useDate } from '@/views/home/hooks/useDate'
import { pickerOptions } from '@/utils/date'
const editorContent = ref() const editorContent = ref()
const { push } = useRouter() const { push } = useRouter()
const message = useMessage() const message = useMessage()
@ -116,7 +151,9 @@ let formValue: any = ref({
content: '', content: '',
reviewSource: '3', reviewSource: '3',
isTop: 'N', isTop: 'N',
treeSource: '3' treeSource: '3',
isPublish: 0,
publishTime: ''
}) })
function escapeHTML(html: string): string { function escapeHTML(html: string): string {
const tempElement = document.createElement('div') const tempElement = document.createElement('div')
@ -131,7 +168,8 @@ async function save() {
let userIdList: any[] = [] let userIdList: any[] = []
const cont = editorContent.value const cont = editorContent.value
const content = escapeHTML(cont) 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 const cate = not.article.cate
// console.log(formValue.value, content,cate) // console.log(formValue.value, content,cate)
if (dataList.value) { if (dataList.value) {
@ -161,7 +199,9 @@ async function save() {
cate, cate,
type, type,
content, content,
userIdList userIdList,
isPublish,
publishTime
}) })
if (code === 200) { if (code === 200) {
message.success('新增成功') message.success('新增成功')

View File

@ -6,7 +6,15 @@ import { useMessage, NModal } from 'naive-ui'
import { useUserStore } from '@/stores/modules/user' import { useUserStore } from '@/stores/modules/user'
import UserList from '@/views/home/intelligence/process/UserPages.vue' 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 message = useMessage()
const store = useUserStore() const store = useUserStore()
@ -24,7 +32,6 @@ const editC = ref()
const editD = ref() const editD = ref()
const editE = ref() const editE = ref()
const shomkA = ref(false) const shomkA = ref(false)
const shomkB = ref(false) const shomkB = ref(false)
const shomkC = 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 }[] }) => { arr.value = _row.map((i: { filePathList: { name: any; originalFileName: any }[] }) => {
if (i.filePathList && i.filePathList.length > 0) { if (i.filePathList && i.filePathList.length > 0) {
i.filePathList.forEach((file: { name: any; originalFileName: any }) => { i.filePathList.forEach((file: { name: any; originalFileName: any }) => {
file.name = file.originalFileName; file.name = file.originalFileName
}); })
} }
return i return i
}) })
@ -47,61 +54,68 @@ async function setDataFiles(arr, _row) {
async function getDataA() { async function getDataA() {
const { rows: dataArr } = await getBPCEditList({ moduleId: 1 }) const { rows: dataArr } = await getBPCEditList({ moduleId: 1 })
dataA.value = dataArr dataA.value = dataArr
setDataFiles(dataArr); setDataFiles(dataArr)
} }
async function getDataB() { async function getDataB() {
const { rows: dataBrr } = await getBPCEditList({ moduleId: 2 }) const { rows: dataBrr } = await getBPCEditList({ moduleId: 2 })
dataB.value = dataBrr dataB.value = dataBrr
setDataFiles(dataBrr); setDataFiles(dataBrr)
} }
async function getDataC() { async function getDataC() {
const { rows: dataCrr } = await getBPCEditList({ moduleId: 3 }) const { rows: dataCrr } = await getBPCEditList({ moduleId: 3 })
dataC.value = dataCrr dataC.value = dataCrr
setDataFiles(dataCrr); setDataFiles(dataCrr)
} }
async function getDataD() { async function getDataD() {
const { rows: dataDrr } = await getBPCEditList({ moduleId: 4 }) const { rows: dataDrr } = await getBPCEditList({ moduleId: 4 })
dataD.value = dataDrr dataD.value = dataDrr
setDataFiles(dataDrr); setDataFiles(dataDrr)
} }
async function getDataE() { async function getDataE() {
const { rows: dataErr } = await getBPCEditList({ moduleId: 5 }) const { rows: dataErr } = await getBPCEditList({ moduleId: 5 })
dataE.value = dataErr dataE.value = dataErr
setDataFiles(dataErr); setDataFiles(dataErr)
} }
onMounted(async () => { onMounted(async () => {
getDataA(); getDataA()
getDataB(); getDataB()
getDataC(); getDataC()
getDataD(); getDataD()
getDataE(); getDataE()
}) })
function computedName(title) { function computedName(title) {
let index = title.indexOf("."); let index = title.indexOf('.')
if (index > -1) { 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) console.log(row, 444)
const { id, status, title, type } = row const { id, status, title, type } = row
let moduleId = 1; let moduleId = 1
let sendData = [] let sendData = []
if (row.fileList && row.fileList.length > 0) { if (row.fileList && row.fileList.length > 0) {
row.fileList.map(item => { row.fileList.map((item) => {
let obj = { id, status, moduleId }; let obj = { id, status, moduleId }
if (item.response) { if (item.response) {
obj.filePath = item.response.url; obj.filePath = item.response.url
obj.title = title || computedName(item.response.originalFilename); obj.title = title || computedName(item.response.originalFilename)
} } else {
else { obj.filePath = item.url
obj.filePath = item.url; obj.title = title || computedName(item.originalFilename)
obj.title = title || computedName(item.originalFilename);
} }
sendData.push(obj) sendData.push(obj)
}) })
@ -112,27 +126,29 @@ async function onSubmitA(row: { filePathList?: any; id?: any; indexId?: any; tit
} else { } else {
var { code, msg } = await updateBPCOne(sendData[0]) var { code, msg } = await updateBPCOne(sendData[0])
} }
if (code === 200) { message.success("修改成功!") } if (code === 200) {
else { message.error(msg) } message.success('修改成功!')
} else {
message.error(msg)
}
shomkA.value = false 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 }) {
const { id, title, type } = row const { id, title, type } = row
let moduleId = 2; let moduleId = 2
let sendData = [] let sendData = []
if (row.fileList && row.fileList.length > 0) { if (row.fileList && row.fileList.length > 0) {
row.fileList.map(item => { row.fileList.map((item) => {
let obj = { id, status, moduleId }; let obj = { id, status, moduleId }
if (item.response) { if (item.response) {
obj.filePath = item.response.url; obj.filePath = item.response.url
obj.title = title || computedName(item.response.originalFilename); obj.title = title || computedName(item.response.originalFilename)
} } else {
else { obj.filePath = item.url
obj.filePath = item.url; obj.title = title || computedName(item.originalFilename)
obj.title = title || computedName(item.originalFilename);
} }
sendData.push(obj) sendData.push(obj)
}) })
@ -143,28 +159,30 @@ async function onSubmitB(row: { filePathList?: any; id?: any; cate?: any; title?
} else { } else {
var { code, msg } = await updateBPCOne(sendData[0]) var { code, msg } = await updateBPCOne(sendData[0])
} }
if (code === 200) { message.success("修改成功!") } if (code === 200) {
else { message.error(msg) } message.success('修改成功!')
} else {
message.error(msg)
}
shomkB.value = false shomkB.value = false
getDataB(); getDataB()
} }
async function onSubmitC(row: { filePathList?: any; id?: any; source?: any; title?: any }) { async function onSubmitC(row: { filePathList?: any; id?: any; source?: any; title?: any }) {
const { id, title, type } = row const { id, title, type } = row
let moduleId = 3; let moduleId = 3
let sendData = [] let sendData = []
if (row.fileList && row.fileList.length > 0) { if (row.fileList && row.fileList.length > 0) {
row.fileList.map(item => { row.fileList.map((item) => {
let obj = { id, status, moduleId }; let obj = { id, status, moduleId }
if (item.response) { if (item.response) {
obj.filePath = item.response.url; obj.filePath = item.response.url
obj.title = title || computedName(item.response.originalFilename); obj.title = title || computedName(item.response.originalFilename)
} } else {
else { obj.filePath = item.url
obj.filePath = item.url; obj.title = title || computedName(item.originalFilename)
obj.title = title || computedName(item.originalFilename);
} }
sendData.push(obj) sendData.push(obj)
}) })
@ -175,26 +193,26 @@ async function onSubmitC(row: { filePathList?: any; id?: any; source?: any; titl
} else { } else {
var { code, msg } = await updateBPCOne(sendData[0]) var { code, msg } = await updateBPCOne(sendData[0])
} }
if (code === 200) { message.success("修改成功!") } if (code === 200) {
else message.error(msg) message.success('修改成功!')
} else message.error(msg)
shomkC.value = false shomkC.value = false
getDataC() getDataC()
} }
async function onSubmitD(row: { filePathList?: any; id?: any; title?: any }) { async function onSubmitD(row: { filePathList?: any; id?: any; title?: any }) {
const { id, title, type } = row const { id, title, type } = row
let moduleId = 4; let moduleId = 4
let sendData = [] let sendData = []
if (row.fileList && row.fileList.length > 0) { if (row.fileList && row.fileList.length > 0) {
row.fileList.map(item => { row.fileList.map((item) => {
let obj = { id, status, moduleId }; let obj = { id, status, moduleId }
if (item.response) { if (item.response) {
obj.filePath = item.response.url; obj.filePath = item.response.url
obj.title = title || computedName(item.response.originalFilename); obj.title = title || computedName(item.response.originalFilename)
} } else {
else { obj.filePath = item.url
obj.filePath = item.url; obj.title = title || computedName(item.originalFilename)
obj.title = title || computedName(item.originalFilename);
} }
sendData.push(obj) sendData.push(obj)
}) })
@ -205,8 +223,9 @@ async function onSubmitD(row: { filePathList?: any; id?: any; title?: any }) {
} else { } else {
var { code, msg } = await updateBPCOne(sendData[0]) var { code, msg } = await updateBPCOne(sendData[0])
} }
if (code === 200) { message.success("修改成功!") } if (code === 200) {
else { message.success('修改成功!')
} else {
message.error(msg) message.error(msg)
} }
shomkD.value = false shomkD.value = false
@ -214,18 +233,17 @@ async function onSubmitD(row: { filePathList?: any; id?: any; title?: any }) {
} }
async function onSubmitE(row: { filePathList?: any; id?: any; title?: any }) { async function onSubmitE(row: { filePathList?: any; id?: any; title?: any }) {
const { id, title, type } = row const { id, title, type } = row
let moduleId = 5; let moduleId = 5
let sendData = [] let sendData = []
if (row.fileList && row.fileList.length > 0) { if (row.fileList && row.fileList.length > 0) {
row.fileList.map(item => { row.fileList.map((item) => {
let obj = { id, status, moduleId }; let obj = { id, status, moduleId }
if (item.response) { if (item.response) {
obj.filePath = item.response.url; obj.filePath = item.response.url
obj.title = title || computedName(item.response.originalFilename); obj.title = title || computedName(item.response.originalFilename)
} } else {
else { obj.filePath = item.url
obj.filePath = item.url; obj.title = title || computedName(item.originalFilename)
obj.title = title || computedName(item.originalFilename);
} }
sendData.push(obj) sendData.push(obj)
}) })
@ -236,31 +254,33 @@ async function onSubmitE(row: { filePathList?: any; id?: any; title?: any }) {
} else { } else {
var { code, msg } = await updateBPCOne(sendData[0]) var { code, msg } = await updateBPCOne(sendData[0])
} }
if (code === 200) { message.success("修改成功!") } if (code === 200) {
else { message.success('修改成功!')
} else {
message.error(msg) message.error(msg)
} }
shomkE.value = false shomkE.value = false
getDataE() getDataE()
} }
const handleEditA = (type: string, row: any) => { const handleEditA = (type: string, row: any) => {
editA.value = { editA.value = {
type: type, type: type,
status: '紧急', status: '紧急',
title: '', title: '',
fileList: [], fileList: []
} }
shomkA.value = true shomkA.value = true
if (!row) return if (!row) return
editA.value = row editA.value = row
editA.value.type = type; editA.value.type = type
editA.value.fileList = [{ editA.value.fileList = [
{
name: row.title, name: row.title,
originalFilename: row.title, originalFilename: row.title,
url: row.filePath, url: row.filePath
}] }
]
// BPCDownload({ id: row.id }).then(res => { // BPCDownload({ id: row.id }).then(res => {
// editA.value.fileList = [res.data] // editA.value.fileList = [res.data]
// }) // })
@ -269,17 +289,19 @@ const handleEditB = (type: string, row: any) => {
editB.value = { editB.value = {
type: type, type: type,
title: '', title: '',
fileList: [], fileList: []
} }
shomkB.value = true shomkB.value = true
if (!row) return if (!row) return
editB.value = row editB.value = row
editB.value.type = type; editB.value.type = type
editB.value.fileList = [{ editB.value.fileList = [
{
name: row.title, name: row.title,
originalFilename: row.title, originalFilename: row.title,
url: row.filePath, url: row.filePath
}] }
]
// editB.value.fileList = [row.filePath] // editB.value.fileList = [row.filePath]
// BPCDownload({ id: row.id }).then(res => { // BPCDownload({ id: row.id }).then(res => {
// editB.value.fileList = [res.data] // editB.value.fileList = [res.data]
@ -289,17 +311,19 @@ const handleEditC = (type: string, row: any) => {
editC.value = { editC.value = {
type: type, type: type,
title: '', title: '',
fileList: [], fileList: []
} }
shomkC.value = true shomkC.value = true
if (!row) return if (!row) return
editC.value = row editC.value = row
editC.value.type = type; editC.value.type = type
editC.value.fileList = [{ editC.value.fileList = [
{
name: row.title, name: row.title,
originalFilename: row.title, originalFilename: row.title,
url: row.filePath, url: row.filePath
}] }
]
// editC.value.fileList = [row.filePath] // editC.value.fileList = [row.filePath]
// BPCDownload({ id: row.id }).then(res => { // BPCDownload({ id: row.id }).then(res => {
// editC.value.fileList = [res.data] // editC.value.fileList = [res.data]
@ -309,17 +333,19 @@ const handleEditD = (type: string, row: any) => {
editD.value = { editD.value = {
type: type, type: type,
title: '', title: '',
fileList: [], fileList: []
} }
shomkD.value = true shomkD.value = true
if (!row) return if (!row) return
editD.value = row editD.value = row
editD.value.type = type; editD.value.type = type
editD.value.fileList = [{ editD.value.fileList = [
{
name: row.title, name: row.title,
originalFilename: row.title, originalFilename: row.title,
url: row.filePath, url: row.filePath
}] }
]
// BPCDownload({ id: row.id }).then(res => { // BPCDownload({ id: row.id }).then(res => {
// editD.value.fileList = [res.data] // editD.value.fileList = [res.data]
// }) // })
@ -328,67 +354,82 @@ const handleEditE = (type: string, row: any) => {
editE.value = { editE.value = {
type: type, type: type,
title: '', title: '',
fileList: [], fileList: []
} }
shomkE.value = true shomkE.value = true
if (!row) return if (!row) return
editE.value = row editE.value = row
editE.value.type = type; editE.value.type = type
editE.value.fileList = [{ editE.value.fileList = [
{
name: row.title, name: row.title,
originalFilename: row.title, originalFilename: row.title,
url: row.filePath, url: row.filePath
}] }
]
// BPCDownload({ id: row.id }).then(res => { // BPCDownload({ id: row.id }).then(res => {
// editE.value.fileList = [res.data] // editE.value.fileList = [res.data]
// }) // })
} }
async function handleDeleteA(index: number, row: any) { async function handleDeleteA(index: number, row: any) {
const { id } = row const { id } = row
if (!id) return if (!id) return
const { code, msg } = await delBPCActList({ id }) const { code, msg } = await delBPCActList({ id })
if (code === 200) { message.success("删除成功!") } if (code === 200) {
else { message.error(msg) } message.success('删除成功!')
getDataA(); } else {
message.error(msg)
}
getDataA()
} }
async function handleDeleteB(index: number, row: any) { async function handleDeleteB(index: number, row: any) {
const { id } = row const { id } = row
if (!id) return if (!id) return
const { code, msg } = await delBPCActList({ id }) const { code, msg } = await delBPCActList({ id })
if (code === 200) { message.success("删除成功!") } if (code === 200) {
else { message.error(msg) } message.success('删除成功!')
} else {
message.error(msg)
}
getDataB(); getDataB()
} }
async function handleDeleteC(index: number, row: any) { async function handleDeleteC(index: number, row: any) {
const { id } = row const { id } = row
if (!id) return if (!id) return
const { code, msg } = await delBPCActList({ id }) const { code, msg } = await delBPCActList({ id })
if (code === 200) { message.success("删除成功!") } if (code === 200) {
else { message.error(msg) } message.success('删除成功!')
} else {
message.error(msg)
}
getDataC() getDataC()
} }
async function handleDeleteD(index: number, row: any) { async function handleDeleteD(index: number, row: any) {
const { id } = row const { id } = row
if (!id) return if (!id) return
const { code, msg } = await delBPCActList({ id }) const { code, msg } = await delBPCActList({ id })
if (code === 200) { message.success("删除成功!") } if (code === 200) {
else { message.error(msg) } message.success('删除成功!')
getDataD(); } else {
message.error(msg)
}
getDataD()
} }
async function handleDeleteE(index: number, row: any) { async function handleDeleteE(index: number, row: any) {
const { id } = row const { id } = row
if (!id) return if (!id) return
const { code, msg } = await delBPCActList({ id }) const { code, msg } = await delBPCActList({ id })
if (code === 200) { message.success("删除成功!") } if (code === 200) {
else { message.error(msg) } message.success('删除成功!')
getDataE(); } else {
message.error(msg)
}
getDataE()
} }
const activeName = ref("first") const activeName = ref('first')
const userList = ref() const userList = ref()
const showModal = ref(false) const showModal = ref(false)
const flg = ref() const flg = ref()
@ -398,11 +439,10 @@ async function getUser(moduleId: any) {
flg.value = moduleId flg.value = moduleId
const { data: userArr } = await getBPCUser({ moduleId }) const { data: userArr } = await getBPCUser({ moduleId })
setUserList.value = userArr setUserList.value = userArr
} }
// //
const handleChild = (data: any) => { const handleChild = (data: any) => {
console.log(data, 444); console.log(data, 444)
const { showModal: show, multipleSelection } = data const { showModal: show, multipleSelection } = data
showModal.value = unref(show) showModal.value = unref(show)
// userList.value = multipleSelection // userList.value = multipleSelection
@ -421,6 +461,35 @@ async function getUser(moduleId: any) {
showModal.value = data 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)
}
}
]
}
</script> </script>
<template> <template>
<HomeHead class="top"> <HomeHead class="top">
@ -433,20 +502,35 @@ async function getUser(moduleId: any) {
<!-- <img src="./images/logo.svg" class="h56px mr21px" /> --> <!-- <img src="./images/logo.svg" class="h56px mr21px" /> -->
<div class="text-36px text-#000">BCP内容管理</div> <div class="text-36px text-#000">BCP内容管理</div>
</div> </div>
<el-tabs type="card" v-model="activeName" class="demo-tabs mt30px text-20px" @tab-click="handleClick"> <el-tabs
type="card"
v-model="activeName"
class="demo-tabs mt30px text-20px"
@tab-click="handleClick"
>
<el-tab-pane name="first"> <el-tab-pane name="first">
<template #label> <template #label>
<span class="custom-tabs-label"> <span class="custom-tabs-label">
<span class="text-20px">BCP今日简报模块</span> <span class="text-20px">BCP今日简报模块</span>
</span> </span>
</template> </template>
<div class="cont relative w100% h800px overflow-y-auto"> <div class="cont relative w100% h800px overflow-y-auto">
<el-button type="primary" @click="handleEditA('add')" class="my20px">BCP今日简报新增</el-button> <el-button type="primary" @click="handleEditA('add')" class="my20px"
>BCP今日简报新增</el-button
>
<el-button type="primary" @click="getUser(1)"> </el-button> <el-button type="primary" @click="getUser(1)"> </el-button>
<el-table :data="dataA" style="width: 95%" <el-table
:header-cell-style="{ background: '#2A7BF7', color: '#fff', height: '60px', textAlign: 'center', 'font-size': '24px' }" :data="dataA"
:cell-style="{ 'text-align': 'center' }"> style="width: 95%"
:header-cell-style="{
background: '#2A7BF7',
color: '#fff',
height: '60px',
textAlign: 'center',
'font-size': '24px'
}"
:cell-style="{ 'text-align': 'center' }"
>
<el-table-column label="级别" prop="status" /> <el-table-column label="级别" prop="status" />
<el-table-column label="名称" prop="title" /> <el-table-column label="名称" prop="title" />
<!-- <!--
@ -462,7 +546,12 @@ async function getUser(moduleId: any) {
<el-table-column label="操作" width="180px"> <el-table-column label="操作" width="180px">
<template #default="scope"> <template #default="scope">
<el-button size="small" @click="handleEditA('edit', scope.row)">编辑</el-button> <el-button size="small" @click="handleEditA('edit', scope.row)">编辑</el-button>
<el-button size="small" type="danger" @click="handleDeleteA(scope.$index, scope.row)">删除</el-button> <el-button
size="small"
type="danger"
@click="handleDeleteA(scope.$index, scope.row)"
>删除</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -476,10 +565,22 @@ async function getUser(moduleId: any) {
</span> </span>
</template> </template>
<div> <div>
<el-button type="primary" @click="handleEditB('add')" class="my20px">运营守则新增</el-button> <el-button type="primary" @click="handleEditB('add')" class="my20px"
>运营守则新增</el-button
>
<el-button type="primary" @click="getUser(2)"> </el-button> <el-button type="primary" @click="getUser(2)"> </el-button>
<el-table :data="dataB" style="width: 95%" :header-cell-style="{ background:'#2A7BF7',color:'#fff',height:'60px',textAlign: 'center','font-size':'24px'}" :cell-style="{ 'text-align': 'center'}"> <el-table
:data="dataB"
style="width: 95%"
:header-cell-style="{
background: '#2A7BF7',
color: '#fff',
height: '60px',
textAlign: 'center',
'font-size': '24px'
}"
:cell-style="{ 'text-align': 'center' }"
>
<el-table-column label="名称" prop="title" /> <el-table-column label="名称" prop="title" />
<!-- <el-table-column label="文件列表" prop="filePathList" > <!-- <el-table-column label="文件列表" prop="filePathList" >
<template #default="scope"> <template #default="scope">
@ -493,7 +594,12 @@ async function getUser(moduleId: any) {
<el-table-column label="操作" width="180px"> <el-table-column label="操作" width="180px">
<template #default="scope"> <template #default="scope">
<el-button size="small" @click="handleEditB('edit', scope.row)">编辑</el-button> <el-button size="small" @click="handleEditB('edit', scope.row)">编辑</el-button>
<el-button size="small" type="danger" @click="handleDeleteB(scope.$index, scope.row)">删除</el-button> <el-button
size="small"
type="danger"
@click="handleDeleteB(scope.$index, scope.row)"
>删除</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -503,17 +609,27 @@ async function getUser(moduleId: any) {
<el-tab-pane name="third"> <el-tab-pane name="third">
<template #label> <template #label>
<span class="custom-tabs-label"> <span class="custom-tabs-label">
<span class="text-20px">供方SCM模块</span> <span class="text-20px">供方SCM模块</span>
</span> </span>
</template> </template>
<div> <div>
<el-button type="primary" @click="handleEditC('add')" class="my20px">供方SCM新增</el-button> <el-button type="primary" @click="handleEditC('add')" class="my20px"
>供方SCM新增</el-button
>
<el-button type="primary" @click="getUser(3)"> </el-button> <el-button type="primary" @click="getUser(3)"> </el-button>
<el-table :data="dataC" style="width: 95%" <el-table
:header-cell-style="{ background: '#2A7BF7', color: '#fff', height: '60px', textAlign: 'center', 'font-size': '24px' }" :data="dataC"
:cell-style="{ 'text-align': 'center' }"> style="width: 95%"
:header-cell-style="{
background: '#2A7BF7',
color: '#fff',
height: '60px',
textAlign: 'center',
'font-size': '24px'
}"
:cell-style="{ 'text-align': 'center' }"
>
<el-table-column label="名称" prop="title" /> <el-table-column label="名称" prop="title" />
<!-- <el-table-column label="文件列表" prop="fileList"> <!-- <el-table-column label="文件列表" prop="fileList">
<template #default="scope"> <template #default="scope">
@ -527,7 +643,12 @@ async function getUser(moduleId: any) {
<el-table-column label="操作" width="180px"> <el-table-column label="操作" width="180px">
<template #default="scope"> <template #default="scope">
<el-button size="small" @click="handleEditC('edit', scope.row)">编辑</el-button> <el-button size="small" @click="handleEditC('edit', scope.row)">编辑</el-button>
<el-button size="small" type="danger" @click="handleDeleteC(scope.$index, scope.row)">删除</el-button> <el-button
size="small"
type="danger"
@click="handleDeleteC(scope.$index, scope.row)"
>删除</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -541,13 +662,22 @@ async function getUser(moduleId: any) {
</span> </span>
</template> </template>
<div> <div>
<el-button type="primary" @click="handleEditD('add')" class="my20px">BCP情报新增</el-button> <el-button type="primary" @click="handleEditD('add')" class="my20px"
>BCP情报新增</el-button
>
<el-button type="primary" @click="getUser(4)"> </el-button> <el-button type="primary" @click="getUser(4)"> </el-button>
<el-table :data="dataD" style="width: 95%" <el-table
:header-cell-style="{ background: '#2A7BF7', color: '#fff', height: '60px', textAlign: 'center', 'font-size': '24px' }" :data="dataD"
:cell-style="{ 'text-align': 'center' }"> style="width: 95%"
:header-cell-style="{
background: '#2A7BF7',
color: '#fff',
height: '60px',
textAlign: 'center',
'font-size': '24px'
}"
:cell-style="{ 'text-align': 'center' }"
>
<el-table-column label="名称" prop="title" /> <el-table-column label="名称" prop="title" />
<!-- <el-table-column label="文件列表" prop="filePathList"> <!-- <el-table-column label="文件列表" prop="filePathList">
<template #default="scope"> <template #default="scope">
@ -561,7 +691,12 @@ async function getUser(moduleId: any) {
<el-table-column label="操作" width="180px"> <el-table-column label="操作" width="180px">
<template #default="scope"> <template #default="scope">
<el-button size="small" @click="handleEditD('edit', scope.row)">编辑</el-button> <el-button size="small" @click="handleEditD('edit', scope.row)">编辑</el-button>
<el-button size="small" type="danger" @click="handleDeleteD(scope.$index, scope.row)">删除</el-button> <el-button
size="small"
type="danger"
@click="handleDeleteD(scope.$index, scope.row)"
>删除</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -575,13 +710,22 @@ async function getUser(moduleId: any) {
</span> </span>
</template> </template>
<div> <div>
<el-button type="primary" @click="handleEditE('add')" class="my20px">底部滚动新增</el-button> <el-button type="primary" @click="handleEditE('add')" class="my20px"
>底部滚动新增</el-button
>
<el-button type="primary" @click="getUser(5)"> </el-button> <el-button type="primary" @click="getUser(5)"> </el-button>
<el-table :data="dataE" style="width: 95%" <el-table
:header-cell-style="{ background: '#2A7BF7', color: '#fff', height: '60px', textAlign: 'center', 'font-size': '24px' }" :data="dataE"
:cell-style="{ 'text-align': 'center' }"> style="width: 95%"
:header-cell-style="{
background: '#2A7BF7',
color: '#fff',
height: '60px',
textAlign: 'center',
'font-size': '24px'
}"
:cell-style="{ 'text-align': 'center' }"
>
<el-table-column label="名称" prop="title" /> <el-table-column label="名称" prop="title" />
<!-- <el-table-column label="文件列表" prop="filePathList"> <!-- <el-table-column label="文件列表" prop="filePathList">
<template #default="scope"> <template #default="scope">
@ -595,15 +739,19 @@ async function getUser(moduleId: any) {
<el-table-column label="操作" width="180px"> <el-table-column label="操作" width="180px">
<template #default="scope"> <template #default="scope">
<el-button size="small" @click="handleEditE('edit', scope.row)">编辑</el-button> <el-button size="small" @click="handleEditE('edit', scope.row)">编辑</el-button>
<el-button size="small" type="danger" @click="handleDeleteE(scope.$index, scope.row)">删除</el-button> <el-button
size="small"
type="danger"
@click="handleDeleteE(scope.$index, scope.row)"
>删除</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<el-form-item> <el-form-item> </el-form-item>
</el-form-item>
</AppBlock> </AppBlock>
<n-modal v-model:show="shomkA"> <n-modal v-model:show="shomkA">
@ -616,19 +764,26 @@ async function getUser(moduleId: any) {
<el-radio label="New" size="large">New</el-radio> <el-radio label="New" size="large">New</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<br> <br />
<el-form-item v-if="editA.type !== 'add'" label="标题"> <el-form-item v-if="editA.type !== 'add'" label="标题">
<el-input v-model="editA.title" /> <el-input v-model="editA.title" />
</el-form-item> </el-form-item>
<br> <br />
<el-form-item label="文件"> <el-form-item label="文件">
<el-upload v-model:file-list="editA.fileList" class="upload-demo" :headers="header" <el-upload
action="/test-api/common/upload" multiple :limit="editA.type == 'add' ? 3 : 1" :on-exceed="handleExceed"> v-model:file-list="editA.fileList"
class="upload-demo"
:headers="header"
action="/test-api/common/upload"
multiple
:limit="editA.type == 'add' ? 3 : 1"
:on-exceed="handleExceed"
>
<el-button type="primary">选择文件</el-button> <el-button type="primary">选择文件</el-button>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
</el-form> </el-form>
<hr class="mb15px border-#f1f1f1"> <hr class="mb15px border-#f1f1f1" />
<el-button class="flex-center" type="primary" @click="onSubmitA(editA)"></el-button> <el-button class="flex-center" type="primary" @click="onSubmitA(editA)"></el-button>
</div> </div>
@ -639,15 +794,22 @@ async function getUser(moduleId: any) {
<el-form-item v-if="editB.type !== 'add'" label="标题"> <el-form-item v-if="editB.type !== 'add'" label="标题">
<el-input v-model="editB.title" /> <el-input v-model="editB.title" />
</el-form-item> </el-form-item>
<br> <br />
<el-form-item label="文件"> <el-form-item label="文件">
<el-upload v-model:file-list="editB.fileList" class="upload-demo" :headers="header" <el-upload
action="/test-api/common/upload" multiple :limit="editB.type == 'add' ? 3 : 1" :on-exceed="handleExceed"> v-model:file-list="editB.fileList"
class="upload-demo"
:headers="header"
action="/test-api/common/upload"
multiple
:limit="editB.type == 'add' ? 3 : 1"
:on-exceed="handleExceed"
>
<el-button type="primary">选择文件</el-button> <el-button type="primary">选择文件</el-button>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
</el-form> </el-form>
<hr class="mb15px border-#f1f1f1"> <hr class="mb15px border-#f1f1f1" />
<el-button class="flex-center" type="primary" @click="onSubmitB(editB)"></el-button> <el-button class="flex-center" type="primary" @click="onSubmitB(editB)"></el-button>
</div> </div>
@ -658,15 +820,22 @@ async function getUser(moduleId: any) {
<el-form-item v-if="editC.type !== 'add'" label="标题"> <el-form-item v-if="editC.type !== 'add'" label="标题">
<el-input v-model="editC.title" /> <el-input v-model="editC.title" />
</el-form-item> </el-form-item>
<br> <br />
<el-form-item label="文件"> <el-form-item label="文件">
<el-upload v-model:file-list="editC.fileList" class="upload-demo" :headers="header" <el-upload
action="/test-api/common/upload" multiple :limit="editC.type == 'add' ? 3 : 1" :on-exceed="handleExceed"> v-model:file-list="editC.fileList"
class="upload-demo"
:headers="header"
action="/test-api/common/upload"
multiple
:limit="editC.type == 'add' ? 3 : 1"
:on-exceed="handleExceed"
>
<el-button type="primary">选择文件</el-button> <el-button type="primary">选择文件</el-button>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
</el-form> </el-form>
<hr class="mb15px border-#f1f1f1"> <hr class="mb15px border-#f1f1f1" />
<el-button class="flex-center" type="primary" @click="onSubmitC(editC)"></el-button> <el-button class="flex-center" type="primary" @click="onSubmitC(editC)"></el-button>
</div> </div>
@ -677,16 +846,52 @@ async function getUser(moduleId: any) {
<el-form-item v-if="editD.type !== 'add'" label="标题"> <el-form-item v-if="editD.type !== 'add'" label="标题">
<el-input v-model="editD.title" /> <el-input v-model="editD.title" />
</el-form-item> </el-form-item>
<br> <br />
<el-form-item label="文件"> <el-form-item label="文件">
<el-upload v-model:file-list="editD.fileList" class="upload-demo" :headers="header" <el-upload
action="/test-api/common/upload" multiple :limit="editD.type == 'add' ? 3 : 1" :on-exceed="handleExceed"> v-model:file-list="editD.fileList"
class="upload-demo"
:headers="header"
action="/test-api/common/upload"
multiple
:limit="editD.type == 'add' ? 3 : 1"
:on-exceed="handleExceed"
>
<el-button type="primary">选择文件</el-button> <el-button type="primary">选择文件</el-button>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item label="是否置顶">
<el-switch
v-model="editD.isTop"
active-text="置顶"
inactive-text="不置顶"
:inactive-value="0"
:active-value="1"
></el-switch>
</el-form-item>
<br />
<el-form-item label="是否定时发送">
<el-switch
v-model="editD.isPublish"
active-text="是"
inactive-text="否"
:inactive-value="0"
:active-value="1"
></el-switch>
</el-form-item>
<br />
<el-form-item label="发布时间" v-if="editD.isPublish == 1">
<el-date-picker
v-model="editD.publishTime"
align="right"
type="date"
placeholder="选择日期"
:picker-options="pickerOptions"
>
</el-date-picker>
</el-form-item>
</el-form> </el-form>
<hr class="mb15px border-#f1f1f1"> <hr class="mb15px border-#f1f1f1" />
<el-button class="flex-center" type="primary" @click="onSubmitD(editD)"></el-button> <el-button class="flex-center" type="primary" @click="onSubmitD(editD)"></el-button>
</div> </div>
@ -697,16 +902,53 @@ async function getUser(moduleId: any) {
<el-form-item v-if="editE.type !== 'add'" label="标题"> <el-form-item v-if="editE.type !== 'add'" label="标题">
<el-input v-model="editE.title" /> <el-input v-model="editE.title" />
</el-form-item> </el-form-item>
<br> <br />
<el-form-item label="文件"> <el-form-item label="文件">
<el-upload v-model:file-list="editE.fileList" class="upload-demo" :headers="header" <el-upload
action="/test-api/common/upload" multiple :limit="editE.type == 'add' ? 3 : 1" :on-exceed="handleExceed"> v-model:file-list="editE.fileList"
class="upload-demo"
:headers="header"
action="/test-api/common/upload"
multiple
:limit="editE.type == 'add' ? 3 : 1"
:on-exceed="handleExceed"
>
<el-button type="primary">选择文件</el-button> <el-button type="primary">选择文件</el-button>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<br />
<el-form-item label="是否置顶">
<el-switch
v-model="editE.isTop"
active-text="置顶"
inactive-text="不置顶"
:inactive-value="0"
:active-value="1"
></el-switch>
</el-form-item>
<br />
<el-form-item label="是否定时发送">
<el-switch
v-model="editE.isPublish"
active-text="是"
inactive-text="否"
:inactive-value="0"
:active-value="1"
></el-switch>
</el-form-item>
<br />
<el-form-item label="发布时间" v-if="editE.isPublish == 1">
<el-date-picker
v-model="editE.publishTime"
align="right"
type="date"
placeholder="选择日期"
:picker-options="pickerOptions"
>
</el-date-picker>
</el-form-item>
</el-form> </el-form>
<hr class="mb15px border-#f1f1f1"> <hr class="mb15px border-#f1f1f1" />
<el-button class="flex-center" type="primary" @click="onSubmitE(editE)"></el-button> <el-button class="flex-center" type="primary" @click="onSubmitE(editE)"></el-button>
</div> </div>

File diff suppressed because it is too large Load Diff

View File

@ -195,11 +195,11 @@ fetchNewDataList()
<div <div
class="text-black p-20px text-28px w-1/3 transition-all" class="text-black p-20px text-28px w-1/3 transition-all"
:class="[{ 'text-#fff': curTab == 1 }]" :class="[{ 'text-#fff': curTab == 1 }]"
@click="curTab = 0" @mouseenter="curTab = 0"
> >
最近更新 最近更新
</div> </div>
<div class="card_title !pt-10px !pl-30px flex-1 !pb-10px" @click="curTab = 1"> <div class="card_title !pt-10px !pl-30px flex-1 !pb-10px" @mouseenter="curTab = 1">
<div class="flex justify-between items-center"> <div class="flex justify-between items-center">
<p <p
class="text-22px cursor-pointer hover:underline transition-all" class="text-22px cursor-pointer hover:underline transition-all"

View File

@ -71,18 +71,23 @@ const getCsrSupplier = () => {
const csrSupplierList = ref<any>([]) const csrSupplierList = ref<any>([])
const selMonth = ref('') const selMonth = ref('')
const getCsrSupplierList = (index?: any) => { 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 = [] csrSupplierList.value = []
selMonth.value = '' selMonth.value = ''
const req = { pageNum: 1, pageSize: 10, ...query.value, month } const req = { pageNum: 1, pageSize: 10, ...query.value, month }
req.year = _m < 4 ? +req.year + 1 : req.year
req.supplierName req.supplierName
? fetchCsrSupplierList(req).then((res: any) => { ? fetchCsrSupplierList(req).then((res: any) => {
csrSupplierList.value = (res.rows || []).filter((item: any) => item.submitunCount > 0) 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) csrSupplierList.value = (res.rows || []).filter((item: any) => item.submitunCount > 0)
}) })
selMonth.value = month ? +months[index] + '月' : '' selMonth.value = month ? months[index] : ''
} }
const getCsrSupplierTaskInfo = () => { const getCsrSupplierTaskInfo = () => {
@ -326,7 +331,9 @@ getCsrSupplierTaskInfo()
</div> </div>
</div> </div>
<div class="cards"> <div class="cards">
<div class="cards_title relative">未提交供应商明细({{ query.year }}{{ selMonth }})</div> <div class="cards_title relative">
未提交供应商明细({{ +selMonth < 4 ? +query.year + 1 : query.year }}{{ selMonth }})
</div>
<div class="absolute top-24px !text-18px right-20px pt30px text-#4E7EE8"> <div class="absolute top-24px !text-18px right-20px pt30px text-#4E7EE8">
<span class="text-#ababab">更新时间{{ updateTime }}</span> <span class="text-#ababab">更新时间{{ updateTime }}</span>
</div> </div>

View File

@ -12,9 +12,7 @@
<el-icon class="text-red"><ArrowLeftBold size="18" /></el-icon> <el-icon class="text-red"><ArrowLeftBold size="18" /></el-icon>
</el-button> </el-button>
<el-tab-pane label="banner管理" name="first"> <el-tab-pane label="banner管理" name="first">
<el-button type="primary" @click="editClickA('add')" class="mb-20px"> <el-button type="primary" @click="editClickA('add')" class="mb-20px"> 新增 </el-button>
新增
</el-button>
<el-button <el-button
class="button mt--20px" class="button mt--20px"
@ -72,19 +70,11 @@
</el-table-column> </el-table-column>
<el-table-column prop="address" label="操作" align="center"> <el-table-column prop="address" label="操作" align="center">
<template #default="scope"> <template #default="scope">
<el-button <el-button type="primary" @click="editClickA('edit', scope.row)" class="mb-20px">
type="primary"
@click="editClickA('edit', scope.row)"
class="mb-20px"
>
编辑</el-button 编辑</el-button
> >
<el-button <el-button type="danger" @click="deleteClickA(scope.row)" class="mb-20px">
type="danger"
@click="deleteClickA(scope.row)"
class="mb-20px"
>
删除</el-button 删除</el-button
> >
</template> </template>
@ -93,9 +83,7 @@
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="足迹管理" name="second"> <el-tab-pane label="足迹管理" name="second">
<el-button type="primary" @click="editClickB('add')" class="mb-20px"> <el-button type="primary" @click="editClickB('add')" class="mb-20px"> 新增 </el-button>
新增
</el-button>
<el-button <el-button
class="button mt--20px" class="button mt--20px"
@ -130,11 +118,7 @@
</el-table-column> --> </el-table-column> -->
<el-table-column prop="title" label="标题" align="center" /> <el-table-column prop="title" label="标题" align="center" />
<el-table-column <el-table-column prop="createTime" label="上传时间" align="center" />
prop="createTime"
label="上传时间"
align="center"
/>
<el-table-column prop="filePath" label="文件列表" align="center"> <el-table-column prop="filePath" label="文件列表" align="center">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.filePath" v-for="i in scope.row.filePath" <span v-if="scope.row.filePath" v-for="i in scope.row.filePath"
@ -144,19 +128,11 @@
</el-table-column> </el-table-column>
<el-table-column prop="address" label="操作" align="center"> <el-table-column prop="address" label="操作" align="center">
<template #default="scope"> <template #default="scope">
<el-button <el-button type="primary" @click="editClickB('edit', scope.row)" class="mb-20px">
type="primary"
@click="editClickB('edit', scope.row)"
class="mb-20px"
>
编辑</el-button 编辑</el-button
> >
<el-button <el-button type="danger" @click="deleteClickB(scope.row)" class="mb-20px">
type="danger"
@click="deleteClickB(scope.row)"
class="mb-20px"
>
删除</el-button 删除</el-button
> >
</template> </template>
@ -209,20 +185,14 @@
</el-form-item> </el-form-item>
<br /> <br />
<div class="text-center"> <div class="text-center">
<el-button type="primary" @click="addClickA(editA)" class="mb-20px"> <el-button type="primary" @click="addClickA(editA)" class="mb-20px"> 确认</el-button>
确认</el-button
>
</div> </div>
</el-form> </el-form>
</div> </div>
</NModal> </NModal>
<NModal v-model:show="dialogVisible" :z-index="999999"> <NModal v-model:show="dialogVisible" :z-index="999999">
<img <img class="object-contain max-w-65%" :src="dialogImageUrl" alt="选择图片" />
class="object-contain max-w-65%"
:src="dialogImageUrl"
alt="选择图片"
/>
</NModal> </NModal>
<NModal v-model:show="shomkB"> <NModal v-model:show="shomkB">
@ -246,21 +216,49 @@
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<br /> <br />
<div class="text-center"> <el-form-item label="是否置顶">
<el-button type="primary" @click="addClickB(editB)" class="mb-20px"> <el-switch
确认</el-button v-model="editB.isTop"
active-text="置顶"
inactive-text="不置顶"
:inactive-value="0"
:active-value="1"
></el-switch>
</el-form-item>
<br />
<el-form-item label="是否定时发送">
<el-switch
v-model="editB.isPublish"
active-text="是"
inactive-text="否"
:inactive-value="0"
:active-value="1"
@change="(val) => (editB.publishTime = val ? pickerOptions.day : '')"
></el-switch>
</el-form-item>
<br />
<el-form-item label="发布时间" v-if="editB.isPublish == 1">
<el-date-picker
v-model="editB.publishTime"
align="right"
type="date"
placeholder="选择日期"
:disabledDate="pickerOptions.disabledDate"
:shortcuts="pickerOptions.shortcuts"
:value-format="pickerOptions.valueFormat"
> >
</el-date-picker>
</el-form-item>
<br />
<div class="text-center">
<el-button type="primary" @click="addClickB(editB)" class="mb-20px"> 确认</el-button>
</div> </div>
</el-form> </el-form>
</div> </div>
</NModal> </NModal>
<n-modal v-model:show="showModal"> <n-modal v-model:show="showModal">
<UserList <UserList :userDataList="setUserList" @clickChild="handleChild" @CloseThis="CloseThiss" />
:userDataList="setUserList"
@clickChild="handleChild"
@CloseThis="CloseThiss"
/>
</n-modal> </n-modal>
</template> </template>
@ -276,6 +274,7 @@ import {
} from '@/api/daikin/base' } from '@/api/daikin/base'
import { NModal, useMessage, NSelect } from 'naive-ui' import { NModal, useMessage, NSelect } from 'naive-ui'
import UserList from '@/views/home/intelligence/process/UserPages.vue' import UserList from '@/views/home/intelligence/process/UserPages.vue'
import { pickerOptions } from '@/utils/date'
const store = useUserStore() const store = useUserStore()
const message = useMessage() const message = useMessage()
@ -526,7 +525,7 @@ const deleteClickB = async (row: any) => {
async function addClickB(row: any) { async function addClickB(row: any) {
console.log(row) console.log(row)
if (!row) return if (!row) return
const { id, moduleId, title, fileList, imgFile } = row const { id, moduleId, title, fileList, imgFile, isPublish, publishTime, isTop } = row
let filePath: any[] = [] let filePath: any[] = []
let url: any[] = [] let url: any[] = []
if (fileList && fileList.length > 0) { if (fileList && fileList.length > 0) {
@ -548,7 +547,10 @@ async function addClickB(row: any) {
id, id,
moduleId, moduleId,
title, title,
filePath filePath,
isPublish,
publishTime,
isTop
}) })
if (code === 200) { if (code === 200) {
message.success('新增成功') message.success('新增成功')
@ -558,7 +560,10 @@ async function addClickB(row: any) {
id, id,
moduleId, moduleId,
title, title,
filePath filePath,
isPublish,
publishTime,
isTop
}) })
if (code === 200) { if (code === 200) {
message.success('修改成功') message.success('修改成功')
@ -579,10 +584,7 @@ const handleChange = (e: string | any[]) => {
} }
// console.log(e,editB.value.cateId,99999) // console.log(e,editB.value.cateId,99999)
} }
const handOnExceed: UploadProps['onExceed'] = ( const handOnExceed: UploadProps['onExceed'] = (uploadFile: any, uploadFiles: any) => {
uploadFile: any,
uploadFiles: any
) => {
message.warning('最多只能上传5张图片') message.warning('最多只能上传5张图片')
} }

View File

@ -393,6 +393,40 @@
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<br /> <br />
<el-form-item label="是否置顶">
<el-switch
v-model="editB.isTop"
active-text="置顶"
inactive-text="不置顶"
:inactive-value="0"
:active-value="1"
></el-switch>
</el-form-item>
<br />
<el-form-item label="是否定时发送">
<el-switch
v-model="editB.isPublish"
active-text="是"
inactive-text="否"
:inactive-value="0"
:active-value="1"
@change="(val) => (editB.publishTime = val ? pickerOptions.day : '')"
></el-switch>
</el-form-item>
<br />
<el-form-item label="发布时间" v-if="editB.isPublish == 1">
<el-date-picker
v-model="editB.publishTime"
align="right"
type="date"
placeholder="选择日期"
:disabledDate="pickerOptions.disabledDate"
:shortcuts="pickerOptions.shortcuts"
:value-format="pickerOptions.valueFormat"
>
</el-date-picker>
</el-form-item>
<br />
<div class="text-center"> <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> </div>
@ -465,6 +499,7 @@ import {
import { NModal, useMessage, NSelect } from 'naive-ui' import { NModal, useMessage, NSelect } from 'naive-ui'
import UserList from '@/views/home/intelligence/process/UserPages.vue' import UserList from '@/views/home/intelligence/process/UserPages.vue'
import { databaseld } from '@/stores/modules/database' import { databaseld } from '@/stores/modules/database'
import { pickerOptions } from '@/utils/date'
const { push } = useRouter() const { push } = useRouter()
const database = databaseld() const database = databaseld()

View File

@ -225,6 +225,40 @@
<el-button type="primary">选择文件</el-button> <el-button type="primary">选择文件</el-button>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<br />
<el-form-item label="是否置顶">
<el-switch
v-model="editC.isTop"
active-text="置顶"
inactive-text="不置顶"
:inactive-value="0"
:active-value="1"
></el-switch>
</el-form-item>
<br />
<el-form-item label="是否定时发送">
<el-switch
v-model="editC.isPublish"
active-text="是"
inactive-text="否"
:inactive-value="0"
:active-value="1"
@change="(val) => (editC.publishTime = val ? pickerOptions.day : '')"
></el-switch>
</el-form-item>
<br />
<el-form-item label="发布时间" v-if="editC.isPublish == 1">
<el-date-picker
v-model="editC.publishTime"
align="right"
type="date"
placeholder="选择日期"
:disabledDate="pickerOptions.disabledDate"
:shortcuts="pickerOptions.shortcuts"
:value-format="pickerOptions.valueFormat"
>
</el-date-picker>
</el-form-item>
</el-form> </el-form>
<hr class="mb15px border-#f1f1f1" /> <hr class="mb15px border-#f1f1f1" />
<el-form-item> <el-form-item>
@ -342,6 +376,40 @@
<el-button type="primary">选择文件</el-button> <el-button type="primary">选择文件</el-button>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<br />
<el-form-item label="是否置顶">
<el-switch
v-model="editA.isTop"
active-text="置顶"
inactive-text="不置顶"
:inactive-value="0"
:active-value="1"
></el-switch>
</el-form-item>
<br />
<el-form-item label="是否定时发送">
<el-switch
v-model="editA.isPublish"
active-text="是"
inactive-text="否"
:inactive-value="0"
:active-value="1"
@change="(val) => (editA.publishTime = val ? pickerOptions.day : '')"
></el-switch>
</el-form-item>
<br />
<el-form-item label="发布时间" v-if="editA.isPublish == 1">
<el-date-picker
v-model="editA.publishTime"
align="right"
type="date"
placeholder="选择日期"
:disabledDate="pickerOptions.disabledDate"
:shortcuts="pickerOptions.shortcuts"
:value-format="pickerOptions.valueFormat"
>
</el-date-picker>
</el-form-item>
</el-form> </el-form>
<hr class="mb15px border-#f1f1f1" /> <hr class="mb15px border-#f1f1f1" />
<el-form-item class=""> <el-form-item class="">
@ -394,6 +462,40 @@
<el-button type="primary">选择文件</el-button> <el-button type="primary">选择文件</el-button>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<br />
<el-form-item label="是否置顶">
<el-switch
v-model="editB.isTop"
active-text="置顶"
inactive-text="不置顶"
:inactive-value="0"
:active-value="1"
></el-switch>
</el-form-item>
<br />
<el-form-item label="是否定时发送">
<el-switch
v-model="editB.isPublish"
active-text="是"
inactive-text="否"
:inactive-value="0"
:active-value="1"
@change="(val) => (editB.publishTime = val ? pickerOptions.day : '')"
></el-switch>
</el-form-item>
<br />
<el-form-item label="发布时间" v-if="editB.isPublish == 1">
<el-date-picker
v-model="editB.publishTime"
align="right"
type="date"
placeholder="选择日期"
:disabledDate="pickerOptions.disabledDate"
:shortcuts="pickerOptions.shortcuts"
:value-format="pickerOptions.valueFormat"
>
</el-date-picker>
</el-form-item>
</el-form> </el-form>
<hr class="mb15px border-#f1f1f1" /> <hr class="mb15px border-#f1f1f1" />
<el-form-item> <el-form-item>
@ -420,6 +522,7 @@ import ModifyList from './component/modify.vue'
import UserList from '@/views/home/intelligence/process/UserPages.vue' import UserList from '@/views/home/intelligence/process/UserPages.vue'
const ids = ref('') const ids = ref('')
const { push } = useRouter() const { push } = useRouter()
import { pickerOptions } from '@/utils/date'
const store = useUserStore() const store = useUserStore()
const message = useMessage() const message = useMessage()
@ -632,6 +735,9 @@ async function onSubmitB(row: {
time: string time: string
files: never[] files: never[]
fileList: never[] fileList: never[]
isTop?: any
isPublish?: any
publishTime?: any
}) { }) {
// console.log(dataB.value, row.id) // console.log(dataB.value, row.id)
dataB.value.map((obj) => { dataB.value.map((obj) => {

View File

@ -1,9 +1,20 @@
<script setup lang="ts"> <script setup lang="ts">
import { useMessage, NModal, NSelect } from 'naive-ui' import { useMessage, NModal, NSelect } from 'naive-ui'
import { useUserStore } from '@/stores/modules/user' import { useUserStore } from '@/stores/modules/user'
import { getLabCsrActList, updateLab, getCateList, addLab, getLabActList,actLABDel,updateActOne,deleteCateItem ,editCateItem} from '@/api/daikin/base' import {
import { time } from 'echarts'; getLabCsrActList,
updateLab,
getCateList,
addLab,
getLabActList,
actLABDel,
updateActOne,
deleteCateItem,
editCateItem
} from '@/api/daikin/base'
import { time } from 'echarts'
import UserList from '@/views/home/intelligence/process/UserPages.vue' import UserList from '@/views/home/intelligence/process/UserPages.vue'
import { pickerOptions } from '@/utils/date'
const ids = ref('') const ids = ref('')
const { push } = useRouter() const { push } = useRouter()
@ -19,7 +30,7 @@ onBeforeMount(async () => {
const { data: dataBot1 } = await getCateList({ indexId: 1 }) const { data: dataBot1 } = await getCateList({ indexId: 1 })
const { data: dataBot3 } = await getCateList({ indexId: 3 }) const { data: dataBot3 } = await getCateList({ indexId: 3 })
options.value = dataBot options.value = dataBot
list.value.map(item => { list.value.map((item) => {
if (item.id === 2) { if (item.id === 2) {
item.options = dataBot item.options = dataBot
} }
@ -53,11 +64,9 @@ onBeforeMount(async () => {
// console.log( swiperList.value ) // console.log( swiperList.value )
}) })
const store = useUserStore() const store = useUserStore()
const message = useMessage() const message = useMessage()
async function onSubmitAdd() { async function onSubmitAdd() {
console.log(swiperList.value) console.log(swiperList.value)
let newData = swiperList.value.map((item) => { let newData = swiperList.value.map((item) => {
@ -65,37 +74,36 @@ async function onSubmitAdd() {
const urls = item.fileList.map((file) => { const urls = item.fileList.map((file) => {
if (file.response) { if (file.response) {
return file.response.url return file.response.url
} } else {
else {
return file.url return file.url
} }
}); })
return { ...item, filePath: urls.join(",") }; return { ...item, filePath: urls.join(',') }
}); })
newData.forEach((item) => { newData.forEach((item) => {
delete item.fileList; delete item.fileList
}); })
// const data = JSON.stringify(newData) // const data = JSON.stringify(newData)
console.log(newData) console.log(newData)
const { code, msg } = await updateLab(newData) const { code, msg } = await updateLab(newData)
// const { code, msg } = await editCateItem(newData) // const { code, msg } = await editCateItem(newData)
if (code === 200) { message.success("修改成功") } if (code === 200) {
else message.warning(msg) message.success('修改成功')
} else message.warning(msg)
// getSwiperList() // getSwiperList()
// push({name:'Diffspace'}) // push({name:'Diffspace'})
} }
async function onSubmit(row) { async function onSubmit(row) {
// swiperList.value.push(row) // swiperList.value.push(row)
console.log(row) console.log(row)
if (row.indexId === '') { if (row.indexId === '') {
message.info("请选择分类选项!") message.info('请选择分类选项!')
return return
} }
if (!row.catId || row.catId === '') { if (!row.catId || row.catId === '') {
message.info("请选择所属模块!") message.info('请选择所属模块!')
return return
} }
@ -104,14 +112,13 @@ async function onSubmit(row) {
if (row.fileList && row.fileList.length > 0) { if (row.fileList && row.fileList.length > 0) {
if (row.fileList[0].response) { if (row.fileList[0].response) {
row.filePath = row.fileList[0].response.url row.filePath = row.fileList[0].response.url
} } else {
else {
row.filePath = row.fileList[0].url row.filePath = row.fileList[0].url
} }
} }
const { msg, code } = await updateActOne(row) const { msg, code } = await updateActOne(row)
if (code === 200) { if (code === 200) {
message.success("操作成功") message.success('操作成功')
getSwiperList() getSwiperList()
} }
// else message.warning(msg) // else message.warning(msg)
@ -130,19 +137,41 @@ async function onSubmit(row) {
// } // }
shomkB.value = false shomkB.value = false
console.log(swiperList.value) console.log(swiperList.value)
} }
async function onSubmitAdds() { async function onSubmitAdds() {
const actTopUserList = unref(actTopUserLists.value) const actTopUserList = unref(actTopUserLists.value)
const actMidUserList = unref(actMidUserLists.value) const actMidUserList = unref(actMidUserLists.value)
const actDownUserList = unref(actDownUserLists.value) const actDownUserList = unref(actDownUserLists.value)
const { id, bannerUserList, leftUserList, rightUserList, memberUserList, bannerContent, leftContent, rightContent, memberContent } = Data.value const {
const { code, msg } = await addLab({ id, bannerUserList, leftUserList, rightUserList, memberUserList, bannerContent, leftContent, rightContent, memberContent, actTopUserList, actMidUserList, actDownUserList }) id,
if (code === 200) { message.success("修改成功") } bannerUserList,
else message.warning(msg) leftUserList,
rightUserList,
memberUserList,
bannerContent,
leftContent,
rightContent,
memberContent
} = Data.value
const { code, msg } = await addLab({
id,
bannerUserList,
leftUserList,
rightUserList,
memberUserList,
bannerContent,
leftContent,
rightContent,
memberContent,
actTopUserList,
actMidUserList,
actDownUserList
})
if (code === 200) {
message.success('修改成功')
} else message.warning(msg)
} }
const shomkB = ref(false) const shomkB = ref(false)
@ -151,20 +180,16 @@ const shomksB = () => {
console.log(shomkB.value) console.log(shomkB.value)
} }
let swiperList = ref([])
let swiperList = ref([
])
const editList = ref() const editList = ref()
const handleEdit = (index: number, row: any) => { const handleEdit = (index: number, row: any) => {
console.log(row) console.log(row)
if (row && row.url) { if (row && row.url) {
console.log(row.files.length) console.log(row.files.length)
if (row.files.length <= 0) { if (row.files.length <= 0) {
row.files.push({ url: row.url }); row.files.push({ url: row.url })
} }
} } else {
else {
editList.value = { editList.value = {
id: '', id: '',
indexId: '1', indexId: '1',
@ -180,43 +205,53 @@ const handleEdit = (index: number, row: any) => {
console.log(row) console.log(row)
} }
const list = ref([{ const list = ref([
{
id: 1, id: 1,
title: '部品业种', title: '部品业种',
options: [{ id: '1', cateName: 'DEVICE' }, { id: '2', cateName: '加工品' }, { id: '3', cateName: '原材料' }] options: [
{ id: '1', cateName: 'DEVICE' },
{ id: '2', cateName: '加工品' },
{ id: '3', cateName: '原材料' }
]
}, },
{ {
id: 3, id: 3,
title: '走访类型', title: '走访类型',
options: [{ id: '1', cateName: '供方走访' }, { id: '2', cateName: '展会走访' }, { id: '3', cateName: '企业走访' }] options: [
{ id: '1', cateName: '供方走访' },
{ id: '2', cateName: '展会走访' },
{ id: '3', cateName: '企业走访' }
]
}, },
{ {
id: 2, id: 2,
title: '探索方向', title: '探索方向',
options: [] options: []
}, }
]) ])
const opt = ref() const opt = ref()
const radioClick = (e) => { const radioClick = (e) => {
opt.value = list.value.find(item => item.id == e) opt.value = list.value.find((item) => item.id == e)
// console.log(ll) // console.log(ll)
} }
const handleDelete = async (index: number, row: any) => { const handleDelete = async (index: number, row: any) => {
swiperList.value = swiperList.value.filter(item => item.id !== row.id); swiperList.value = swiperList.value.filter((item) => item.id !== row.id)
const id = row.id const id = row.id
if (!id) return if (!id) return
const { code, msg } = await actLABDel({ id }) const { code, msg } = await actLABDel({ id })
if(code===200){message.info("操作成功!")} if (code === 200) {
else{ message.info('操作成功!')
} else {
message.error(msg) message.error(msg)
} }
getSwiperList() getSwiperList()
} }
const handOnExceed: UploadProps['onExceed'] = (uploadFile: any, uploadFiles: any) => { const handOnExceed: UploadProps['onExceed'] = (uploadFile: any, uploadFiles: any) => {
message.warning("最多只能上传一个文件!") message.warning('最多只能上传一个文件!')
} }
const header = { 'token': store.user.token } const header = { 'token': store.user.token }
@ -232,7 +267,6 @@ const getUser = (id: any) => {
} }
} }
// //
const handleChild = (data: any) => { const handleChild = (data: any) => {
const { showModal: show, multipleSelection } = data const { showModal: show, multipleSelection } = data
@ -240,32 +274,31 @@ const handleChild = (data: any) => {
// userList.value = multipleSelection // userList.value = multipleSelection
let userIdList: any[] = [] let userIdList: any[] = []
multipleSelection.value.forEach((i: { userId: any }) => { multipleSelection.value.forEach((i: { userId: any }) => {
userIdList.push(i.userId) userIdList.push(i.userId)
}) })
if (flg.value === 1) { if (flg.value === 1) {
actTopUserLists.value = userIdList actTopUserLists.value = userIdList
// actDownUserLists.value = userIdList // actDownUserLists.value = userIdList
// actMidUserLists.value = userIdList // actMidUserLists.value = userIdList
} } else {
else {
actMidUserLists.value = userIdList actMidUserLists.value = userIdList
} }
console.log(userIdList) console.log(userIdList)
onSubmitAdds() onSubmitAdds()
} }
const CloseThiss = (data: boolean) => { const CloseThiss = (data: boolean) => {
console.log(data) console.log(data)
showModal.value = data showModal.value = data
} }
const value = ref() const value = ref()
const optt = [{ id: '1', cateName: '核心部品强化' }, { id: '2', cateName: '新领域部材探索' }, { id: '3', cateName: '外部调研报告' }] const optt = [
{ id: '1', cateName: '核心部品强化' },
{ id: '2', cateName: '新领域部材探索' },
{ id: '3', cateName: '外部调研报告' }
]
const listData = ref() const listData = ref()
const thisSelect = (e) => { const thisSelect = (e) => {
pageInfo.index = e pageInfo.index = e
} }
const thisSelects = () => { const thisSelects = () => {
pageInfo.index = '' pageInfo.index = ''
@ -278,29 +311,36 @@ const pageInfo = reactive({
index: '' index: ''
}) })
const ss = computed(() => [pageInfo.index, pageInfo.currentPage]) const ss = computed(() => [pageInfo.index, pageInfo.currentPage])
watch(() => unref(ss), watch(
() => unref(ss),
async (v) => { async (v) => {
getSwiperList() getSwiperList()
}, },
{ immediate: true, deep: true }, { immediate: true, deep: true }
) )
async function getSwiperList() { async function getSwiperList() {
const indexId = pageInfo.index const indexId = pageInfo.index
const { rows,total } = await getLabCsrActList({ indexId,pageNum:pageInfo.currentPage,pageSize:pageInfo.pageSize }) const { rows, total } = await getLabCsrActList({
indexId,
pageNum: pageInfo.currentPage,
pageSize: pageInfo.pageSize
})
pageInfo.total = total pageInfo.total = total
if (!rows) return if (!rows) return
const datas = rows.map((item: any) => Object.assign(item, { const datas = rows.map((item: any) =>
indexId: item.indexId + '', Object.assign(item, {
})) indexId: item.indexId + ''
})
)
swiperList.value = datas swiperList.value = datas
swiperList.value = datas.map((item: { filePathList: any[] }) => { swiperList.value = datas.map((item: { filePathList: any[] }) => {
const fileList = item.filePathList.map((itt: any) => Object.assign(itt, { const fileList = item.filePathList.map((itt: any) =>
Object.assign(itt, {
name: itt.originalFileName, name: itt.originalFileName,
url: itt.url url: itt.url
})) })
)
return { ...item, fileList } return { ...item, fileList }
}) })
} }
@ -311,24 +351,40 @@ const handleSizeChange=(e)=>{
const handleCurrentChange = (e) => { const handleCurrentChange = (e) => {
console.log(e) console.log(e)
} }
</script> </script>
<template> <template>
<div class="relative w-full h-full"> <div class="relative w-full h-full">
<div class="flex my20px"> <div class="flex my20px">
<el-button type="primary" @click="handleEdit" class="mr-20px">新增研究方向内容</el-button> <el-button type="primary" @click="handleEdit" class="mr-20px">新增研究方向内容</el-button>
<div class="leading-30px w125px h50px ml20px">请选择类别</div> <div class="leading-30px w125px h50px ml20px">请选择类别</div>
<n-select class="w250px" size="large" v-if="optt" :show-arrow="false" :show-checkmark="false" v-model:value="value" :options="optt" label-field="cateName" <n-select
value-field="id" @update:value="thisSelect" /> class="w250px"
size="large"
v-if="optt"
:show-arrow="false"
:show-checkmark="false"
v-model:value="value"
:options="optt"
label-field="cateName"
value-field="id"
@update:value="thisSelect"
/>
<el-button type="primary" @click="thisSelects" class="ml-20px mt5px">重置</el-button> <el-button type="primary" @click="thisSelects" class="ml-20px mt5px">重置</el-button>
</div> </div>
<el-table :data="swiperList" style="width: 100%,height: 600px;overflow-y: auto;" <el-table
:header-cell-style="{ background: '#2A7BF7', color: '#fff', height: '60px', textAlign: 'center', 'font-size': '24px' }" :data="swiperList"
:cell-style="{ 'text-align': 'center','overflow-y':'auto' }"> style="width: 100%,height: 600px;overflow-y: auto;"
:header-cell-style="{
background: '#2A7BF7',
color: '#fff',
height: '60px',
textAlign: 'center',
'font-size': '24px'
}"
:cell-style="{ 'text-align': 'center', 'overflow-y': 'auto' }"
>
<el-table-column label="标题" prop="title" /> <el-table-column label="标题" prop="title" />
<el-table-column label="分类选项" width="280"> <el-table-column label="分类选项" width="280">
<template #default="scope"> <template #default="scope">
@ -345,7 +401,6 @@ const handleCurrentChange=(e)=>{
{{ it.name }} {{ it.name }}
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column label="通知范围" prop="fileList" > <!-- <el-table-column label="通知范围" prop="fileList" >
<template #default="scope"> <template #default="scope">
@ -358,14 +413,14 @@ const handleCurrentChange=(e)=>{
<el-table-column label="操作" :header-style="{ background: 'red' }"> <el-table-column label="操作" :header-style="{ background: 'red' }">
<template #default="scope"> <template #default="scope">
<el-button size="small" @click="handleEdit(scope.$index, scope.row)">编辑</el-button> <el-button size="small" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
<el-button size="small" type="danger" @click="handleDelete(scope.$index, scope.row)">删除</el-button> <el-button size="small" type="danger" @click="handleDelete(scope.$index, scope.row)"
>删除</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<el-form-item> <el-form-item>
<div class="my20px fixed bottom-25px left-20% z-2000 h50px w-200px"> <div class="my20px fixed bottom-25px left-20% z-2000 h50px w-200px">
<!-- <el-button type="primary" @click="onSubmitAdd"></el-button> --> <!-- <el-button type="primary" @click="onSubmitAdd"></el-button> -->
@ -375,16 +430,17 @@ const handleCurrentChange=(e)=>{
</div> </div>
</el-form-item> </el-form-item>
<div class="fixed bottom-65px right-100px"> <div class="fixed bottom-65px right-100px">
<el-pagination v-model:current-page="pageInfo.currentPage" v-model:page-size="pageInfo.pageSize" <el-pagination
layout="prev, pager, next, jumper" :total="pageInfo.total" v-model:current-page="pageInfo.currentPage"
@size-change="handleSizeChange" @current-change="handleCurrentChange" /> v-model:page-size="pageInfo.pageSize"
layout="prev, pager, next, jumper"
:total="pageInfo.total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div> </div>
<n-modal v-model:show="shomkB"> <n-modal v-model:show="shomkB">
<div class="bg-#FFF p30px"> <div class="bg-#FFF p30px">
<el-form :model="editList" label-width="120px" :inline="true"> <el-form :model="editList" label-width="120px" :inline="true">
<el-form-item label="分类选项"> <el-form-item label="分类选项">
@ -394,26 +450,72 @@ const handleCurrentChange=(e)=>{
<el-radio label="3" size="large">外部调研报告</el-radio> <el-radio label="3" size="large">外部调研报告</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<br> <br />
<el-form-item :label="opt.title"> <el-form-item :label="opt.title">
<n-select class="min-w220px" size="large" v-if="opt.options" v-model:value="editList.catId" <n-select
:options="opt.options" label-field="cateName" value-field="cateName" /> class="min-w220px"
v-if="opt.options"
v-model:value="editList.catId"
:options="opt.options"
label-field="cateName"
value-field="cateName"
/>
</el-form-item> </el-form-item>
<br> <br />
<el-form-item label="标题"> <el-form-item label="标题">
<el-input v-model="editList.title" /> <el-input v-model="editList.title" />
</el-form-item> </el-form-item>
<br> <br />
<el-form-item label="文件"> <el-form-item label="文件">
<el-upload v-model:file-list="editList.fileList" class="upload-demo" :headers="header" <el-upload
action="/test-api/common/upload" :on-change="handleChange" :on-exceed="handOnExceed" :limit="1"> v-model:file-list="editList.fileList"
class="upload-demo"
:headers="header"
action="/test-api/common/upload"
:on-change="handleChange"
:on-exceed="handOnExceed"
:limit="1"
>
<el-button type="primary">选择文件</el-button> <el-button type="primary">选择文件</el-button>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<br />
<el-form-item label="是否置顶">
<el-switch
v-model="editList.isTop"
active-text="置顶"
inactive-text="不置顶"
:inactive-value="0"
:active-value="1"
></el-switch>
</el-form-item>
<br />
<el-form-item label="是否定时发送">
<el-switch
v-model="editList.isPublish"
active-text="是"
inactive-text="否"
:inactive-value="0"
:active-value="1"
@change="(val) => (editList.publishTime = val ? pickerOptions.day : '')"
></el-switch>
</el-form-item>
<br />
<el-form-item label="发布时间" v-if="editList.isPublish == 1">
<el-date-picker
v-model="editList.publishTime"
align="right"
type="date"
placeholder="选择日期"
:disabledDate="pickerOptions.disabledDate"
:shortcuts="pickerOptions.shortcuts"
:value-format="pickerOptions.valueFormat"
>
</el-date-picker>
</el-form-item>
</el-form> </el-form>
<hr class="mb15px border-#f1f1f1"> <hr class="mb15px border-#f1f1f1" />
<el-form-item> <el-form-item>
<el-button type="primary" @click="onSubmit(editList)"></el-button> <el-button type="primary" @click="onSubmit(editList)"></el-button>
</el-form-item> </el-form-item>

View File

@ -21,6 +21,7 @@ import {
import { saveArticle, trendsDetail } from '@/api/daikin/base' import { saveArticle, trendsDetail } from '@/api/daikin/base'
import Editor from '../components/TinyECE.vue' import Editor from '../components/TinyECE.vue'
import { useUserStore } from '@/stores/modules/user' import { useUserStore } from '@/stores/modules/user'
import { pickerOptions } from '@/utils/date'
import { useRoute } from 'vue-router' import { useRoute } from 'vue-router'
const { day, week } = useDate() const { day, week } = useDate()
const { push } = useRouter() const { push } = useRouter()
@ -172,7 +173,7 @@ async function save() {
}) })
} }
const { title, tag, source, cate, type } = formValue.value const { title, tag, source, cate, type, isTop, isPublish, publishTime } = formValue.value
console.log(cate) console.log(cate)
const { msg, code } = await saveArticle({ const { msg, code } = await saveArticle({
title, title,
@ -183,7 +184,10 @@ async function save() {
type, type,
content, content,
bannerImg, bannerImg,
userIdList userIdList,
isTop,
isPublish,
publishTime
}) })
if (code === 200) { if (code === 200) {
message.success('新增成功') message.success('新增成功')
@ -370,6 +374,37 @@ const handleClose = (tag: any) => {
{{ i.nickName }} {{ i.nickName }}
</el-tag> </el-tag>
</div> </div>
<n-form-item label="是否置顶">
<el-switch
v-model="formValue.isTop"
active-text="置顶"
inactive-text="不置顶"
inactive-value="N"
active-value="Y"
></el-switch>
</n-form-item>
<n-form-item label="是否定时发送">
<el-switch
v-model="formValue.isPublish"
active-text="是"
inactive-text="否"
:inactive-value="0"
:active-value="1"
@change="(val) => (formValue.publishTime = val ? pickerOptions.day : '')"
></el-switch>
</n-form-item>
<n-form-item label="发布时间" v-if="formValue.isPublish == 1">
<el-date-picker
v-model="formValue.publishTime"
align="right"
type="date"
placeholder="选择日期"
:disabledDate="pickerOptions.disabledDate"
:shortcuts="pickerOptions.shortcuts"
:value-format="pickerOptions.valueFormat"
>
</el-date-picker>
</n-form-item>
<n-form-item> <n-form-item>
<div> <div>
<n-button @click="showModal = true"> 文本内容预览</n-button> <n-button @click="showModal = true"> 文本内容预览</n-button>

View File

@ -6,6 +6,7 @@ import HomeHeadSearch from '@/views/home/components/HomeHeadSearch.vue'
import UserPage from './UserPages.vue' import UserPage from './UserPages.vue'
import { useDate } from '@/views/home/hooks/useDate' import { useDate } from '@/views/home/hooks/useDate'
import { getArticleDetail, review } from '@/api/daikin/base' import { getArticleDetail, review } from '@/api/daikin/base'
import { pickerOptions } from '@/utils/date'
import { import {
NModal, NModal,
NCard, NCard,
@ -59,6 +60,8 @@ let formValue: any = ref({
source: '', source: '',
content: '', content: '',
isTop: 'N', isTop: 'N',
isPublish: 0,
publishTime: '',
bannerImg: '' bannerImg: ''
}) })
@ -422,6 +425,37 @@ const showModalRefs = ref(false)
{{ i.nickName }} {{ i.nickName }}
</el-tag> </el-tag>
</div> </div>
<!-- <n-form-item label="是否置顶">
<el-switch
v-model="formValue.isTop"
active-text="置顶"
inactive-text="不置顶"
:inactive-value="0"
:active-value="1"
></el-switch>
</n-form-item> -->
<n-form-item label="是否定时发送">
<el-switch
v-model="formValue.isPublish"
active-text="是"
inactive-text="否"
:inactive-value="0"
:active-value="1"
@change="(val) => (formValue.publishTime = val ? pickerOptions.day : '')"
></el-switch>
</n-form-item>
<n-form-item label="发布时间" v-if="formValue.isPublish == 1">
<el-date-picker
v-model="formValue.publishTime"
align="right"
type="date"
placeholder="选择日期"
:disabledDate="pickerOptions.disabledDate"
:shortcuts="pickerOptions.shortcuts"
:value-format="pickerOptions.valueFormat"
>
</el-date-picker>
</n-form-item>
<div class="text-end float-right block h50px pt10px"> <div class="text-end float-right block h50px pt10px">
<n-form-item> <n-form-item>
<n-button attr-type="button" style="padding: 0 20px" @click="submitSave(2)"> <n-button attr-type="button" style="padding: 0 20px" @click="submitSave(2)">

View File

@ -5,6 +5,7 @@ import HomeHead from '@/views/home/components/HomeHead.vue'
import { useMessage, NModal } from 'naive-ui' import { useMessage, NModal } from 'naive-ui'
import { useUserStore } from '@/stores/modules/user' import { useUserStore } from '@/stores/modules/user'
import UserList from '@/views/home/intelligence/process/UserPages.vue' import UserList from '@/views/home/intelligence/process/UserPages.vue'
import { pickerOptions } from '@/utils/date'
import { getList, marketPreDelete, marketPreADD } from '@/api/daikin/base' import { getList, marketPreDelete, marketPreADD } from '@/api/daikin/base'
@ -15,7 +16,6 @@ const header = { 'token': store.user.token }
const dataA = ref([]) const dataA = ref([])
const editA = ref() const editA = ref()
const shomkA = ref(false) const shomkA = ref(false)
async function setDataFiles(arr, _row) { async function setDataFiles(arr, _row) {
@ -23,8 +23,8 @@ async function setDataFiles(arr, _row) {
arr.value = _row.map((i: { filePathList: { name: any; originalFileName: any }[] }) => { arr.value = _row.map((i: { filePathList: { name: any; originalFileName: any }[] }) => {
if (i.filePathList && i.filePathList.length > 0) { if (i.filePathList && i.filePathList.length > 0) {
i.filePathList.forEach((file: { name: any; originalFileName: any }) => { i.filePathList.forEach((file: { name: any; originalFileName: any }) => {
file.name = file.originalFileName; file.name = file.originalFileName
}); })
} }
return i return i
}) })
@ -37,85 +37,106 @@ async function getDataA() {
// setDataFiles(dataArr); // setDataFiles(dataArr);
} }
onMounted(async () => { onMounted(async () => {
getDataA(); getDataA()
}) })
function computedName(title) { function computedName(title) {
let index = title.indexOf("."); let index = title.indexOf('.')
if (index > -1) { if (index > -1) {
return title.slice(0, index - 1); return title.slice(0, index - 1)
} }
return title; return title
} }
async function onSubmitA(row: { id: any; fileList?: any; title?: any }) { async function onSubmitA(row: {
id: any
fileList?: any
title?: any
isTop?: any
isPublish?: any
publishTime?: any
}) {
console.log(row, 555) console.log(row, 555)
const { id, title } = row const { id, title, isTop, isPublish, publishTime } = row
// let moduleId = 1; // let moduleId = 1;
let sendData = {} let sendData = {}
if (!row.id) { if (!row.id) {
sendData = { title,type:type.value,userIdList:userData.value }; sendData = {
if (row.fileList && row.fileList.length > 0) { title,
row.fileList.map(item => { type: type.value,
userIdList: userData.value,
if(item.response) { isTop,
sendData.filePath = item.response.url; isPublish,
// obj.title = title || computedName(item.response.originalFilename); publishTime
} }
else { if (row.fileList && row.fileList.length > 0) {
sendData.filePath = item.url; row.fileList.map((item) => {
if (item.response) {
sendData.filePath = item.response.url
// obj.title = title || computedName(item.response.originalFilename);
} else {
sendData.filePath = item.url
// obj.title = title || computedName(item.originalFilename); // obj.title = title || computedName(item.originalFilename);
} }
}) })
} }
} else {
sendData = {
id,
title,
type: type.value,
userIdList: userData.value,
isTop,
isPublish,
publishTime
} }
else{
sendData = {id, title,type:type.value,userIdList:userData.value };
} }
console.log(sendData) console.log(sendData)
const { code, msg } = await marketPreADD(sendData) const { code, msg } = await marketPreADD(sendData)
if (code === 200) { message.success("修改成功!") } if (code === 200) {
else { message.error(msg) } message.success('修改成功!')
shomkA.value = false } else {
getDataA(); message.error(msg)
}
shomkA.value = false
getDataA()
} }
const handleEditA = (type: string, row: any) => { const handleEditA = (type: string, row: any) => {
console.log(row) console.log(row)
editA.value = { editA.value = {
title: '', title: '',
fileList: [], fileList: []
} }
setUserList.value = [] setUserList.value = []
shomkA.value = true shomkA.value = true
if (!row) return if (!row) return
editA.value = row editA.value = row
editA.value.fileList = [{ editA.value.fileList = [
{
name: row.title, name: row.title,
originalFilename: row.title, originalFilename: row.title,
url: row.filePath, url: row.filePath
}] }
]
setUserList.value = row.userIdList setUserList.value = row.userIdList
} }
async function handleDeleteA(index: number, row: any) { async function handleDeleteA(index: number, row: any) {
const { id } = row const { id } = row
if (!id) return if (!id) return
const { code, msg } = await marketPreDelete({ id, type: type.value }) const { code, msg } = await marketPreDelete({ id, type: type.value })
if (code === 200) { message.success("删除成功!") } if (code === 200) {
else { message.error(msg) } message.success('删除成功!')
getDataA(); } else {
message.error(msg)
}
getDataA()
} }
const activeName = ref('first')
const activeName = ref("first")
const userList = ref() const userList = ref()
const showModal = ref(false) const showModal = ref(false)
const flg = ref() const flg = ref()
@ -129,12 +150,11 @@ async function getUser(row) {
} }
// const {data: userArr} = await getBPCUser({moduleId}) // const {data: userArr} = await getBPCUser({moduleId})
// setUserList.value = userArr // setUserList.value = userArr
} }
// //
const userData = ref() const userData = ref()
const handleChild = (data: any) => { const handleChild = (data: any) => {
console.log(data, 444); console.log(data, 444)
const { showModal: show, multipleSelection } = data const { showModal: show, multipleSelection } = data
showModal.value = unref(show) showModal.value = unref(show)
let userIdList: any[] = [] let userIdList: any[] = []
@ -144,7 +164,7 @@ async function getUser(row) {
if (flg.value.id) { if (flg.value.id) {
flg.value.userIdList = userIdList flg.value.userIdList = userIdList
marketPreADD(flg.value) marketPreADD(flg.value)
getDataA(); getDataA()
console.log(flg.value) console.log(flg.value)
} }
userData.value = userIdList userData.value = userIdList
@ -152,7 +172,6 @@ async function getUser(row) {
const CloseThiss = (data: boolean) => { const CloseThiss = (data: boolean) => {
showModal.value = data showModal.value = data
} }
</script> </script>
<template> <template>
<HomeHead class="top"> <HomeHead class="top">
@ -169,9 +188,18 @@ async function getUser(row) {
<div class="cont relative w100% h800px overflow-y-auto"> <div class="cont relative w100% h800px overflow-y-auto">
<el-button type="primary" @click="handleEditA" class="my20px">汇率内容新增</el-button> <el-button type="primary" @click="handleEditA" class="my20px">汇率内容新增</el-button>
<el-table :data="dataA" style="width: 95%" <el-table
:header-cell-style="{ background: '#2A7BF7', color: '#fff', height: '60px', textAlign: 'center', 'font-size': '24px' }" :data="dataA"
:cell-style="{ 'text-align': 'center' }"> style="width: 95%"
:header-cell-style="{
background: '#2A7BF7',
color: '#fff',
height: '60px',
textAlign: 'center',
'font-size': '24px'
}"
:cell-style="{ 'text-align': 'center' }"
>
<!-- <el-table-column label="级别" prop="status" /> --> <!-- <el-table-column label="级别" prop="status" /> -->
<el-table-column label="名称" prop="title" /> <el-table-column label="名称" prop="title" />
<!-- <!--
@ -187,19 +215,21 @@ async function getUser(row) {
<el-table-column label="查看范围" prop="userIdList"> <el-table-column label="查看范围" prop="userIdList">
<template #default="scope"> <template #default="scope">
<!-- <el-button type="primary" class="button" @click="getUser(scope.row)"></el-button> --> <!-- <el-button type="primary" class="button" @click="getUser(scope.row)"></el-button> -->
<span v-if="scope.row.userIdList" v-for="it in scope.row.userIdList"> &nbsp;&nbsp; {{it.nickName}}</span> <span v-if="scope.row.userIdList" v-for="it in scope.row.userIdList">
&nbsp;&nbsp; {{ it.nickName }}</span
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="180px"> <el-table-column label="操作" width="180px">
<template #default="scope"> <template #default="scope">
<el-button size="small" @click="handleEditA('edit', scope.row)">编辑</el-button> <el-button size="small" @click="handleEditA('edit', scope.row)">编辑</el-button>
<el-button size="small" type="danger" @click="handleDeleteA(scope.$index, scope.row)">删除</el-button> <el-button size="small" type="danger" @click="handleDeleteA(scope.$index, scope.row)"
>删除</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
</AppBlock> </AppBlock>
<n-modal v-model:show="shomkA"> <n-modal v-model:show="shomkA">
@ -212,23 +242,64 @@ async function getUser(row) {
<el-radio label="New" size="large">New</el-radio> <el-radio label="New" size="large">New</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> --> </el-form-item> -->
<br> <br />
<el-form-item label="标题"> <el-form-item label="标题">
<el-input v-model="editA.title" /> <el-input v-model="editA.title" />
</el-form-item> </el-form-item>
<br> <br />
<el-form-item label="查看范围"> <el-form-item label="查看范围">
<el-button class="button" @click="getUser(2)"></el-button> <el-button class="button" @click="getUser(2)"></el-button>
</el-form-item> </el-form-item>
<br> <br />
<el-form-item label="文件"> <el-form-item label="文件">
<el-upload v-model:file-list="editA.fileList" class="upload-demo" :headers="header" <el-upload
action="/test-api/common/upload" multiple :limit="editA.type == 'add' ? 3 : 1" :on-exceed="handleExceed"> v-model:file-list="editA.fileList"
class="upload-demo"
:headers="header"
action="/test-api/common/upload"
multiple
:limit="editA.type == 'add' ? 3 : 1"
:on-exceed="handleExceed"
>
<el-button type="primary">选择文件</el-button> <el-button type="primary">选择文件</el-button>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<br />
<el-form-item label="是否置顶">
<el-switch
v-model="editA.isTop"
active-text="置顶"
inactive-text="不置顶"
:inactive-value="0"
:active-value="1"
></el-switch>
</el-form-item>
<br />
<el-form-item label="是否定时发送">
<el-switch
v-model="editA.isPublish"
active-text="是"
inactive-text="否"
:inactive-value="0"
:active-value="1"
@change="(val) => (editA.publishTime = val ? pickerOptions.day : '')"
></el-switch>
</el-form-item>
<br />
<el-form-item label="发布时间" v-if="editA.isPublish == 1">
<el-date-picker
v-model="editA.publishTime"
align="right"
type="date"
placeholder="选择日期"
:disabledDate="pickerOptions.disabledDate"
:shortcuts="pickerOptions.shortcuts"
:value-format="pickerOptions.valueFormat"
>
</el-date-picker>
</el-form-item>
</el-form> </el-form>
<hr class="mb15px border-#f1f1f1"> <hr class="mb15px border-#f1f1f1" />
<el-button class="flex-center" type="primary" @click="onSubmitA(editA)"></el-button> <el-button class="flex-center" type="primary" @click="onSubmitA(editA)"></el-button>
</div> </div>

View File

@ -5,7 +5,7 @@ import HomeHead from '@/views/home/components/HomeHead.vue'
import { useMessage, NModal } from 'naive-ui' import { useMessage, NModal } from 'naive-ui'
import { useUserStore } from '@/stores/modules/user' import { useUserStore } from '@/stores/modules/user'
import UserList from '@/views/home/intelligence/process/UserPages.vue' import UserList from '@/views/home/intelligence/process/UserPages.vue'
import { pickerOptions } from '@/utils/date'
import { getList, marketPreDelete, marketPreADD } from '@/api/daikin/base' import { getList, marketPreDelete, marketPreADD } from '@/api/daikin/base'
const message = useMessage() const message = useMessage()
@ -15,7 +15,6 @@ const header = { 'token': store.user.token }
const dataA = ref([]) const dataA = ref([])
const editA = ref() const editA = ref()
const shomkA = ref(false) const shomkA = ref(false)
async function setDataFiles(arr, _row) { async function setDataFiles(arr, _row) {
@ -23,8 +22,8 @@ async function setDataFiles(arr, _row) {
arr.value = _row.map((i: { filePathList: { name: any; originalFileName: any }[] }) => { arr.value = _row.map((i: { filePathList: { name: any; originalFileName: any }[] }) => {
if (i.filePathList && i.filePathList.length > 0) { if (i.filePathList && i.filePathList.length > 0) {
i.filePathList.forEach((file: { name: any; originalFileName: any }) => { i.filePathList.forEach((file: { name: any; originalFileName: any }) => {
file.name = file.originalFileName; file.name = file.originalFileName
}); })
} }
return i return i
}) })
@ -37,85 +36,106 @@ async function getDataA() {
// setDataFiles(dataArr); // setDataFiles(dataArr);
} }
onMounted(async () => { onMounted(async () => {
getDataA(); getDataA()
}) })
function computedName(title) { function computedName(title) {
let index = title.indexOf("."); let index = title.indexOf('.')
if (index > -1) { if (index > -1) {
return title.slice(0, index - 1); return title.slice(0, index - 1)
} }
return title; return title
} }
async function onSubmitA(row: { id: any; fileList?: any; title?: any }) { async function onSubmitA(row: {
id: any
fileList?: any
title?: any
isTop?: any
isPublish?: any
publishTime?: any
}) {
console.log(row, 555) console.log(row, 555)
const { id, title } = row const { id, title, isTop, isPublish, publishTime } = row
// let moduleId = 1; // let moduleId = 1;
let sendData = {} let sendData = {}
if (!row.id) { if (!row.id) {
sendData = { title,type:type.value,userIdList:userData.value }; sendData = {
if (row.fileList && row.fileList.length > 0) { title,
row.fileList.map(item => { type: type.value,
userIdList: userData.value,
if(item.response) { isTop,
sendData.filePath = item.response.url; isPublish,
// obj.title = title || computedName(item.response.originalFilename); publishTime
} }
else { if (row.fileList && row.fileList.length > 0) {
sendData.filePath = item.url; row.fileList.map((item) => {
if (item.response) {
sendData.filePath = item.response.url
// obj.title = title || computedName(item.response.originalFilename);
} else {
sendData.filePath = item.url
// obj.title = title || computedName(item.originalFilename); // obj.title = title || computedName(item.originalFilename);
} }
}) })
} }
} else {
sendData = {
id,
title,
type: type.value,
userIdList: userData.value,
isTop,
isPublish,
publishTime
} }
else{
sendData = {id, title,type:type.value,userIdList:userData.value };
} }
console.log(sendData) console.log(sendData)
const { code, msg } = await marketPreADD(sendData) const { code, msg } = await marketPreADD(sendData)
if (code === 200) { message.success("修改成功!") } if (code === 200) {
else { message.error(msg) } message.success('修改成功!')
shomkA.value = false } else {
getDataA(); message.error(msg)
}
shomkA.value = false
getDataA()
} }
const handleEditA = (type: string, row: any) => { const handleEditA = (type: string, row: any) => {
console.log(row) console.log(row)
editA.value = { editA.value = {
title: '', title: '',
fileList: [], fileList: []
} }
setUserList.value = [] setUserList.value = []
shomkA.value = true shomkA.value = true
if (!row) return if (!row) return
editA.value = row editA.value = row
editA.value.fileList = [{ editA.value.fileList = [
{
name: row.title, name: row.title,
originalFilename: row.title, originalFilename: row.title,
url: row.filePath, url: row.filePath
}] }
]
setUserList.value = row.userIdList setUserList.value = row.userIdList
} }
async function handleDeleteA(index: number, row: any) { async function handleDeleteA(index: number, row: any) {
const { id } = row const { id } = row
if (!id) return if (!id) return
const { code, msg } = await marketPreDelete({ id, type: type.value }) const { code, msg } = await marketPreDelete({ id, type: type.value })
if (code === 200) { message.success("删除成功!") } if (code === 200) {
else { message.error(msg) } message.success('删除成功!')
getDataA(); } else {
message.error(msg)
}
getDataA()
} }
const activeName = ref('first')
const activeName = ref("first")
const userList = ref() const userList = ref()
const showModal = ref(false) const showModal = ref(false)
const flg = ref() const flg = ref()
@ -129,12 +149,11 @@ async function getUser(row) {
} }
// const {data: userArr} = await getBPCUser({moduleId}) // const {data: userArr} = await getBPCUser({moduleId})
// setUserList.value = userArr // setUserList.value = userArr
} }
// //
const userData = ref() const userData = ref()
const handleChild = (data: any) => { const handleChild = (data: any) => {
console.log(data, 444); console.log(data, 444)
const { showModal: show, multipleSelection } = data const { showModal: show, multipleSelection } = data
showModal.value = unref(show) showModal.value = unref(show)
let userIdList: any[] = [] let userIdList: any[] = []
@ -151,7 +170,6 @@ async function getUser(row) {
const CloseThiss = (data: boolean) => { const CloseThiss = (data: boolean) => {
showModal.value = data showModal.value = data
} }
</script> </script>
<template> <template>
<HomeHead class="top"> <HomeHead class="top">
@ -168,9 +186,18 @@ async function getUser(row) {
<div class="cont relative w100% h800px overflow-y-auto"> <div class="cont relative w100% h800px overflow-y-auto">
<el-button type="primary" @click="handleEditA('add')" class="my20px">市况内容新增</el-button> <el-button type="primary" @click="handleEditA('add')" class="my20px">市况内容新增</el-button>
<el-table :data="dataA" style="width: 95%" <el-table
:header-cell-style="{ background: '#2A7BF7', color: '#fff', height: '60px', textAlign: 'center', 'font-size': '24px' }" :data="dataA"
:cell-style="{ 'text-align': 'center' }"> style="width: 95%"
:header-cell-style="{
background: '#2A7BF7',
color: '#fff',
height: '60px',
textAlign: 'center',
'font-size': '24px'
}"
:cell-style="{ 'text-align': 'center' }"
>
<!-- <el-table-column label="级别" prop="status" /> --> <!-- <el-table-column label="级别" prop="status" /> -->
<el-table-column label="名称" prop="title" /> <el-table-column label="名称" prop="title" />
<!-- <!--
@ -186,19 +213,21 @@ async function getUser(row) {
<el-table-column label="查看范围" prop="userIdList"> <el-table-column label="查看范围" prop="userIdList">
<template #default="scope"> <template #default="scope">
<!-- <el-button type="primary" class="button" @click="getUser(scope.row)"></el-button> --> <!-- <el-button type="primary" class="button" @click="getUser(scope.row)"></el-button> -->
<span v-if="scope.row.userIdList" v-for="it in scope.row.userIdList">&nbsp;&nbsp;{{it.nickName}}</span> <span v-if="scope.row.userIdList" v-for="it in scope.row.userIdList"
>&nbsp;&nbsp;{{ it.nickName }}</span
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="180px"> <el-table-column label="操作" width="180px">
<template #default="scope"> <template #default="scope">
<el-button size="small" @click="handleEditA('edit', scope.row)">编辑</el-button> <el-button size="small" @click="handleEditA('edit', scope.row)">编辑</el-button>
<el-button size="small" type="danger" @click="handleDeleteA(scope.$index, scope.row)">删除</el-button> <el-button size="small" type="danger" @click="handleDeleteA(scope.$index, scope.row)"
>删除</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
</AppBlock> </AppBlock>
<n-modal v-model:show="shomkA"> <n-modal v-model:show="shomkA">
@ -211,23 +240,64 @@ async function getUser(row) {
<el-radio label="New" size="large">New</el-radio> <el-radio label="New" size="large">New</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> --> </el-form-item> -->
<br> <br />
<el-form-item label="标题"> <el-form-item label="标题">
<el-input v-model="editA.title" /> <el-input v-model="editA.title" />
</el-form-item> </el-form-item>
<br> <br />
<el-form-item label="查看范围"> <el-form-item label="查看范围">
<el-button class="button" @click="getUser(2)"></el-button> <el-button class="button" @click="getUser(2)"></el-button>
</el-form-item> </el-form-item>
<br> <br />
<el-form-item label="文件"> <el-form-item label="文件">
<el-upload v-model:file-list="editA.fileList" class="upload-demo" :headers="header" <el-upload
action="/test-api/common/upload" multiple :limit="editA.type == 'add' ? 3 : 1" :on-exceed="handleExceed"> v-model:file-list="editA.fileList"
class="upload-demo"
:headers="header"
action="/test-api/common/upload"
multiple
:limit="editA.type == 'add' ? 3 : 1"
:on-exceed="handleExceed"
>
<el-button type="primary">选择文件</el-button> <el-button type="primary">选择文件</el-button>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<br />
<el-form-item label="是否置顶">
<el-switch
v-model="editA.isTop"
active-text="置顶"
inactive-text="不置顶"
:inactive-value="0"
:active-value="1"
></el-switch>
</el-form-item>
<br />
<el-form-item label="是否定时发送">
<el-switch
v-model="editA.isPublish"
active-text="是"
inactive-text="否"
:inactive-value="0"
:active-value="1"
@change="(val) => (editA.publishTime = val ? pickerOptions.day : '')"
></el-switch>
</el-form-item>
<br />
<el-form-item label="发布时间" v-if="editA.isPublish == 1">
<el-date-picker
v-model="editA.publishTime"
align="right"
type="date"
placeholder="选择日期"
:disabledDate="pickerOptions.disabledDate"
:shortcuts="pickerOptions.shortcuts"
:value-format="pickerOptions.valueFormat"
>
</el-date-picker>
</el-form-item>
</el-form> </el-form>
<hr class="mb15px border-#f1f1f1"> <hr class="mb15px border-#f1f1f1" />
<el-button class="flex-center" type="primary" @click="onSubmitA(editA)"></el-button> <el-button class="flex-center" type="primary" @click="onSubmitA(editA)"></el-button>
</div> </div>

View File

@ -22,6 +22,7 @@ import {
badartGetUser, badartGetUser,
badartAddUser badartAddUser
} from '@/api/daikin/base' } from '@/api/daikin/base'
import { pickerOptions } from '@/utils/date'
import UserList from '@/views/home/intelligence/process/UserPages.vue' import UserList from '@/views/home/intelligence/process/UserPages.vue'
const message = useMessage() const message = useMessage()
const store = useUserStore() const store = useUserStore()
@ -123,9 +124,13 @@ async function onSubmitA(row: {
proportion?: any proportion?: any
partSum?: any partSum?: any
badSum?: any badSum?: any
monthDate?: any
isTop?: any
isPublish?: any
publishTime?: any
}) { }) {
console.log(row) console.log(row)
const { id, indexId, title, partSum, badSum, monthDate } = row const { id, indexId, title, partSum, badSum, monthDate, isTop, isPublish, publishTime } = row
let filePathArr = [] let filePathArr = []
if (row.fileList && row.fileList.length > 0) { if (row.fileList && row.fileList.length > 0) {
@ -146,7 +151,10 @@ async function onSubmitA(row: {
badSum, badSum,
filePath, filePath,
cate, cate,
monthDate: time monthDate: time,
isTop,
isPublish,
publishTime
}) })
if (code === 200) { if (code === 200) {
message.success('修改成功!') message.success('修改成功!')
@ -157,8 +165,16 @@ async function onSubmitA(row: {
gettopList() gettopList()
} }
async function onSubmitB(row: { filePathList?: any; id?: any; cate?: any; title?: any }) { async function onSubmitB(row: {
const { id, cate, title } = row filePathList?: any
id?: any
cate?: any
title?: any
isTop?: any
isPublish?: any
publishTime?: any
}) {
const { id, cate, title, isTop, isPublish, publishTime } = row
let filePathArr = [] let filePathArr = []
if (row.fileList && row.fileList.length > 0) { if (row.fileList && row.fileList.length > 0) {
@ -169,7 +185,15 @@ async function onSubmitB(row: { filePathList?: any; id?: any; cate?: any; title?
} }
let filePath = filePathArr.join(',') let filePath = filePathArr.join(',')
const { code, msg } = await badartAdd({ id, cate, title, filePath }) const { code, msg } = await badartAdd({
id,
cate,
title,
filePath,
isTop,
isPublish,
publishTime
})
if (code === 200) { if (code === 200) {
message.success('修改成功!') message.success('修改成功!')
} else { } else {
@ -180,9 +204,17 @@ async function onSubmitB(row: { filePathList?: any; id?: any; cate?: any; title?
getbadartList() getbadartList()
} }
async function onSubmitC(row: { filePathList?: any; id?: any; source?: any; title?: any }) { async function onSubmitC(row: {
filePathList?: any
id?: any
source?: any
title?: any
isTop?: any
isPublish?: any
publishTime?: any
}) {
console.log(row) console.log(row)
const { id, source, title } = row const { id, source, title, isTop, isPublish, publishTime } = row
let filePathArr = [] let filePathArr = []
if (row.fileList && row.fileList.length > 0) { if (row.fileList && row.fileList.length > 0) {
@ -193,16 +225,31 @@ async function onSubmitC(row: { filePathList?: any; id?: any; source?: any; titl
} }
let filePath = filePathArr.join(',') let filePath = filePathArr.join(',')
const { code, msg } = await highAdd({ id, source, title, filePath }) const { code, msg } = await highAdd({
id,
source,
title,
filePath,
isTop,
isPublish,
publishTime
})
if (code === 200) { if (code === 200) {
message.success('修改成功!') message.success('修改成功!')
} else message.error(msg) } else message.error(msg)
shomkC.value = false shomkC.value = false
gethighList() gethighList()
} }
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
}) {
console.log(row) console.log(row)
const { id, title } = row const { id, title, isTop, isPublish, publishTime } = row
let filePathArr = [] let filePathArr = []
if (row.fileList && row.fileList.length > 0) { if (row.fileList && row.fileList.length > 0) {
@ -213,7 +260,7 @@ async function onSubmitD(row: { filePathList?: any; id?: any; title?: any }) {
} }
let filePath = filePathArr.join(',') let filePath = filePathArr.join(',')
const { code, msg } = await actAdd({ id, title, filePath }) const { code, msg } = await actAdd({ id, title, filePath, isTop, isPublish, publishTime })
if (code === 200) { if (code === 200) {
message.success('修改成功!') message.success('修改成功!')
} else { } else {
@ -681,6 +728,40 @@ const CloseThiss = (data: any) => {
<el-input type="textarea" v-model="editA.title" /> <el-input type="textarea" v-model="editA.title" />
</el-form-item> </el-form-item>
<br />
<el-form-item label="是否置顶">
<el-switch
v-model="editA.isTop"
active-text="置顶"
inactive-text="不置顶"
:inactive-value="0"
:active-value="1"
></el-switch>
</el-form-item>
<br />
<el-form-item label="是否定时发送">
<el-switch
v-model="editA.isPublish"
active-text="是"
inactive-text="否"
:inactive-value="0"
:active-value="1"
@change="(val) => (editA.publishTime = val ? pickerOptions.day : '')"
></el-switch>
</el-form-item>
<br />
<el-form-item label="发布时间" v-if="editA.isPublish == 1">
<el-date-picker
v-model="editA.publishTime"
align="right"
type="date"
placeholder="选择日期"
:disabledDate="pickerOptions.disabledDate"
:shortcuts="pickerOptions.shortcuts"
:value-format="pickerOptions.valueFormat"
>
</el-date-picker>
</el-form-item>
<br /> <br />
<!-- <el-form-item label="不良内容"> <!-- <el-form-item label="不良内容">
<el-upload v-model:file-list="editA.fileList" class="upload-demo" :headers="header" <el-upload v-model:file-list="editA.fileList" class="upload-demo" :headers="header"
@ -718,6 +799,40 @@ const CloseThiss = (data: any) => {
<el-button type="primary">选择文件</el-button> <el-button type="primary">选择文件</el-button>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<br />
<el-form-item label="是否置顶">
<el-switch
v-model="editB.isTop"
active-text="置顶"
inactive-text="不置顶"
:inactive-value="0"
:active-value="1"
></el-switch>
</el-form-item>
<br />
<el-form-item label="是否定时发送">
<el-switch
v-model="editB.isPublish"
active-text="是"
inactive-text="否"
:inactive-value="0"
:active-value="1"
@change="(val) => (editB.publishTime = val ? pickerOptions.day : '')"
></el-switch>
</el-form-item>
<br />
<el-form-item label="发布时间" v-if="editB.isPublish == 1">
<el-date-picker
v-model="editB.publishTime"
align="right"
type="date"
placeholder="选择日期"
:disabledDate="pickerOptions.disabledDate"
:shortcuts="pickerOptions.shortcuts"
:value-format="pickerOptions.valueFormat"
>
</el-date-picker>
</el-form-item>
</el-form> </el-form>
<hr class="mb15px border-#f1f1f1" /> <hr class="mb15px border-#f1f1f1" />
@ -747,6 +862,40 @@ const CloseThiss = (data: any) => {
<el-button type="primary">选择文件</el-button> <el-button type="primary">选择文件</el-button>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<br />
<el-form-item label="是否置顶">
<el-switch
v-model="editC.isTop"
active-text="置顶"
inactive-text="不置顶"
:inactive-value="0"
:active-value="1"
></el-switch>
</el-form-item>
<br />
<el-form-item label="是否定时发送">
<el-switch
v-model="editC.isPublish"
active-text="是"
inactive-text="否"
:inactive-value="0"
:active-value="1"
@change="(val) => (editC.publishTime = val ? pickerOptions.day : '')"
></el-switch>
</el-form-item>
<br />
<el-form-item label="发布时间" v-if="editC.isPublish == 1">
<el-date-picker
v-model="editC.publishTime"
align="right"
type="date"
placeholder="选择日期"
:disabledDate="pickerOptions.disabledDate"
:shortcuts="pickerOptions.shortcuts"
:value-format="pickerOptions.valueFormat"
>
</el-date-picker>
</el-form-item>
</el-form> </el-form>
<hr class="mb15px border-#f1f1f1" /> <hr class="mb15px border-#f1f1f1" />
@ -771,6 +920,40 @@ const CloseThiss = (data: any) => {
<el-button type="primary">选择文件</el-button> <el-button type="primary">选择文件</el-button>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<br />
<el-form-item label="是否置顶">
<el-switch
v-model="editD.isTop"
active-text="置顶"
inactive-text="不置顶"
:inactive-value="0"
:active-value="1"
></el-switch>
</el-form-item>
<br />
<el-form-item label="是否定时发送">
<el-switch
v-model="editD.isPublish"
active-text="是"
inactive-text="否"
:inactive-value="0"
:active-value="1"
@change="(val) => (editD.publishTime = val ? pickerOptions.day : '')"
></el-switch>
</el-form-item>
<br />
<el-form-item label="发布时间" v-if="editD.isPublish == 1">
<el-date-picker
v-model="editD.publishTime"
align="right"
type="date"
placeholder="选择日期"
:disabledDate="pickerOptions.disabledDate"
:shortcuts="pickerOptions.shortcuts"
:value-format="pickerOptions.valueFormat"
>
</el-date-picker>
</el-form-item>
</el-form> </el-form>
<hr class="mb15px border-#f1f1f1" /> <hr class="mb15px border-#f1f1f1" />

View File

@ -257,11 +257,8 @@ var activeItem = 0
</n-popover> </n-popover>
<div class="p20px w270px rd-20px b-4px bg-#fff/4 b-4px b-solid b-#fff/23 text-14px relative"> <div class="p20px w270px rd-20px b-4px bg-#fff/4 b-4px b-solid b-#fff/23 text-14px relative">
<!-- href="http://106.14.114.146/scripts/cbgrn/grn.exe" --> <!-- href="http://106.14.114.146/scripts/cbgrn/grn.exe" -->
<a <!-- href="http://172.31.119.37/scripts/cbgrn/grn.exe/portal/index" -->
href="http://172.31.119.37/scripts/cbgrn/grn.exe/portal/index" <a :href="store.user?.cwzLoginUrl" target="_blank" class="no-underline text-#fff">
target="_blank"
class="no-underline text-#fff"
>
<div class="flex items-center text-18px hover:underline"> <div class="flex items-center text-18px hover:underline">
<img src="@/assets/images/icon-book.svg" class="w22px h22px mr10px" /> <img src="@/assets/images/icon-book.svg" class="w22px h22px mr10px" />
个人日程 个人日程