新增置顶和定时发布功能,其他优化
parent
06d4d33eb5
commit
f54f7e1608
|
|
@ -39,6 +39,7 @@ declare module 'vue' {
|
|||
ElRow: typeof import('element-plus/es')['ElRow']
|
||||
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
|
||||
ElSelect: typeof import('element-plus/es')['ElSelect']
|
||||
ElSwitch: typeof import('element-plus/es')['ElSwitch']
|
||||
ElTable: typeof import('element-plus/es')['ElTable']
|
||||
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
|
||||
ElTabPane: typeof import('element-plus/es')['ElTabPane']
|
||||
|
|
|
|||
|
|
@ -4,10 +4,51 @@ dayjs.extend(isSameOrAfter)
|
|||
// dayjs.extend(isBefore)
|
||||
|
||||
function isNotOneWeekAgo(date: any) {
|
||||
if (!date) return false
|
||||
const oneWeekAgo = dayjs().subtract(1, 'week')
|
||||
// console.log('🚀 ~ oneWeekAgo:', oneWeekAgo.format('YYYY-MM-DD'))
|
||||
return dayjs(date).isSameOrAfter(oneWeekAgo, 'day')
|
||||
if (!date) return false
|
||||
const oneWeekAgo = dayjs().subtract(1, 'week')
|
||||
// console.log('🚀 ~ oneWeekAgo:', oneWeekAgo.format('YYYY-MM-DD'))
|
||||
return dayjs(date).isSameOrAfter(oneWeekAgo, 'day')
|
||||
}
|
||||
|
||||
export { isNotOneWeekAgo }
|
||||
const pickerOptions = {
|
||||
disabledDate(time) {
|
||||
return time.getTime() < Date.now()
|
||||
},
|
||||
valueFormat: 'YYYY-MM-dd HH:mm:ss',
|
||||
shortcuts: [
|
||||
{
|
||||
text: '3天后',
|
||||
value: () => {
|
||||
const date = new Date()
|
||||
date.setTime(date.getTime() + 3600 * 1000 * 24 * 3)
|
||||
return date
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '5天后',
|
||||
value: () => {
|
||||
const date = new Date()
|
||||
date.setTime(date.getTime() + 3600 * 1000 * 24 * 5)
|
||||
return date
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '7天后',
|
||||
value: () => {
|
||||
const date = new Date()
|
||||
date.setTime(date.getTime() + 3600 * 1000 * 24 * 7)
|
||||
return date
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '10天后',
|
||||
value: () => {
|
||||
const date = new Date()
|
||||
date.setTime(date.getTime() + 3600 * 1000 * 24 * 10)
|
||||
return date
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
export { isNotOneWeekAgo, pickerOptions }
|
||||
|
|
|
|||
|
|
@ -39,7 +39,9 @@
|
|||
<n-form-item label="内容" path="title">
|
||||
<Editor @getChildData="handleChild" class="bg-#fff" />
|
||||
</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">
|
||||
<el-tag
|
||||
v-for="i in dataList"
|
||||
|
|
@ -57,6 +59,38 @@
|
|||
<n-form-item>
|
||||
<n-button @click="showModal1 = true"> 文本内容预览</n-button>
|
||||
</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>
|
||||
</div>
|
||||
<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 { saveArticle, trendsAdd } from '@/api/daikin/base'
|
||||
import { useDate } from '@/views/home/hooks/useDate'
|
||||
import { pickerOptions } from '@/utils/date'
|
||||
const editorContent = ref()
|
||||
const { push } = useRouter()
|
||||
const message = useMessage()
|
||||
|
|
@ -116,7 +151,9 @@ let formValue: any = ref({
|
|||
content: '',
|
||||
reviewSource: '3',
|
||||
isTop: 'N',
|
||||
treeSource: '3'
|
||||
treeSource: '3',
|
||||
isPublish: 0,
|
||||
publishTime: ''
|
||||
})
|
||||
function escapeHTML(html: string): string {
|
||||
const tempElement = document.createElement('div')
|
||||
|
|
@ -131,7 +168,8 @@ async function save() {
|
|||
let userIdList: any[] = []
|
||||
const cont = editorContent.value
|
||||
const content = escapeHTML(cont)
|
||||
const { title, reviewSource, tag, treeSource, source, type, isTop } = formValue.value
|
||||
const { title, reviewSource, tag, treeSource, source, type, isTop, isPublish, publishTime } =
|
||||
formValue.value
|
||||
const cate = not.article.cate
|
||||
// console.log(formValue.value, content,cate)
|
||||
if (dataList.value) {
|
||||
|
|
@ -161,7 +199,9 @@ async function save() {
|
|||
cate,
|
||||
type,
|
||||
content,
|
||||
userIdList
|
||||
userIdList,
|
||||
isPublish,
|
||||
publishTime
|
||||
})
|
||||
if (code === 200) {
|
||||
message.success('新增成功')
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -195,11 +195,11 @@ fetchNewDataList()
|
|||
<div
|
||||
class="text-black p-20px text-28px w-1/3 transition-all"
|
||||
:class="[{ 'text-#fff': curTab == 1 }]"
|
||||
@click="curTab = 0"
|
||||
@mouseenter="curTab = 0"
|
||||
>
|
||||
最近更新
|
||||
</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">
|
||||
<p
|
||||
class="text-22px cursor-pointer hover:underline transition-all"
|
||||
|
|
|
|||
|
|
@ -71,18 +71,23 @@ const getCsrSupplier = () => {
|
|||
const csrSupplierList = ref<any>([])
|
||||
const selMonth = ref('')
|
||||
const getCsrSupplierList = (index?: any) => {
|
||||
const month = index || index === 0 ? query.value.year + '-' + months[index] : ''
|
||||
const _m = +months[index]
|
||||
const month =
|
||||
index || index === 0
|
||||
? (_m < 4 ? +query.value.year + 1 : query.value.year) + '-' + months[index]
|
||||
: ''
|
||||
csrSupplierList.value = []
|
||||
selMonth.value = ''
|
||||
const req = { pageNum: 1, pageSize: 10, ...query.value, month }
|
||||
req.year = _m < 4 ? +req.year + 1 : req.year
|
||||
req.supplierName
|
||||
? fetchCsrSupplierList(req).then((res: any) => {
|
||||
csrSupplierList.value = (res.rows || []).filter((item: any) => item.submitunCount > 0)
|
||||
})
|
||||
: fetchCsrSupplierTopList(req).then((res: any) => {
|
||||
: fetchCsrSupplierTopList({ ...req }).then((res: any) => {
|
||||
csrSupplierList.value = (res.rows || []).filter((item: any) => item.submitunCount > 0)
|
||||
})
|
||||
selMonth.value = month ? +months[index] + '月' : ''
|
||||
selMonth.value = month ? months[index] : ''
|
||||
}
|
||||
|
||||
const getCsrSupplierTaskInfo = () => {
|
||||
|
|
@ -326,7 +331,9 @@ getCsrSupplierTaskInfo()
|
|||
</div>
|
||||
</div>
|
||||
<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">
|
||||
<span class="text-#ababab">更新时间:{{ updateTime }}</span>
|
||||
</div>
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -393,6 +393,40 @@
|
|||
</el-upload>
|
||||
</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>
|
||||
<br />
|
||||
<div class="text-center">
|
||||
<el-button type="primary" @click="addClickB(editB)" class="mb-20px"> 确认</el-button>
|
||||
</div>
|
||||
|
|
@ -465,6 +499,7 @@ import {
|
|||
import { NModal, useMessage, NSelect } from 'naive-ui'
|
||||
import UserList from '@/views/home/intelligence/process/UserPages.vue'
|
||||
import { databaseld } from '@/stores/modules/database'
|
||||
import { pickerOptions } from '@/utils/date'
|
||||
|
||||
const { push } = useRouter()
|
||||
const database = databaseld()
|
||||
|
|
|
|||
|
|
@ -225,6 +225,40 @@
|
|||
<el-button type="primary">选择文件</el-button>
|
||||
</el-upload>
|
||||
</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>
|
||||
<hr class="mb15px border-#f1f1f1" />
|
||||
<el-form-item>
|
||||
|
|
@ -342,6 +376,40 @@
|
|||
<el-button type="primary">选择文件</el-button>
|
||||
</el-upload>
|
||||
</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>
|
||||
<hr class="mb15px border-#f1f1f1" />
|
||||
<el-form-item class="">
|
||||
|
|
@ -394,6 +462,40 @@
|
|||
<el-button type="primary">选择文件</el-button>
|
||||
</el-upload>
|
||||
</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>
|
||||
<hr class="mb15px border-#f1f1f1" />
|
||||
<el-form-item>
|
||||
|
|
@ -420,6 +522,7 @@ import ModifyList from './component/modify.vue'
|
|||
import UserList from '@/views/home/intelligence/process/UserPages.vue'
|
||||
const ids = ref('')
|
||||
const { push } = useRouter()
|
||||
import { pickerOptions } from '@/utils/date'
|
||||
|
||||
const store = useUserStore()
|
||||
const message = useMessage()
|
||||
|
|
@ -632,6 +735,9 @@ async function onSubmitB(row: {
|
|||
time: string
|
||||
files: never[]
|
||||
fileList: never[]
|
||||
isTop?: any
|
||||
isPublish?: any
|
||||
publishTime?: any
|
||||
}) {
|
||||
// console.log(dataB.value, row.id)
|
||||
dataB.value.map((obj) => {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,20 @@
|
|||
<script setup lang="ts">
|
||||
import { useMessage, NModal, NSelect } from 'naive-ui'
|
||||
import { useUserStore } from '@/stores/modules/user'
|
||||
import { getLabCsrActList, updateLab, getCateList, addLab, getLabActList,actLABDel,updateActOne,deleteCateItem ,editCateItem} from '@/api/daikin/base'
|
||||
import { time } from 'echarts';
|
||||
import {
|
||||
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 { pickerOptions } from '@/utils/date'
|
||||
|
||||
const ids = ref('')
|
||||
const { push } = useRouter()
|
||||
|
|
@ -19,7 +30,7 @@ onBeforeMount(async () => {
|
|||
const { data: dataBot1 } = await getCateList({ indexId: 1 })
|
||||
const { data: dataBot3 } = await getCateList({ indexId: 3 })
|
||||
options.value = dataBot
|
||||
list.value.map(item => {
|
||||
list.value.map((item) => {
|
||||
if (item.id === 2) {
|
||||
item.options = dataBot
|
||||
}
|
||||
|
|
@ -53,11 +64,9 @@ onBeforeMount(async () => {
|
|||
// console.log( swiperList.value )
|
||||
})
|
||||
|
||||
|
||||
const store = useUserStore()
|
||||
const message = useMessage()
|
||||
|
||||
|
||||
async function onSubmitAdd() {
|
||||
console.log(swiperList.value)
|
||||
let newData = swiperList.value.map((item) => {
|
||||
|
|
@ -65,55 +74,53 @@ async function onSubmitAdd() {
|
|||
const urls = item.fileList.map((file) => {
|
||||
if (file.response) {
|
||||
return file.response.url
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return file.url
|
||||
}
|
||||
});
|
||||
return { ...item, filePath: urls.join(",") };
|
||||
});
|
||||
})
|
||||
return { ...item, filePath: urls.join(',') }
|
||||
})
|
||||
|
||||
newData.forEach((item) => {
|
||||
delete item.fileList;
|
||||
});
|
||||
delete item.fileList
|
||||
})
|
||||
// const data = JSON.stringify(newData)
|
||||
console.log(newData)
|
||||
|
||||
const { code, msg } = await updateLab(newData)
|
||||
// const { code, msg } = await editCateItem(newData)
|
||||
if (code === 200) { message.success("修改成功") }
|
||||
else message.warning(msg)
|
||||
if (code === 200) {
|
||||
message.success('修改成功')
|
||||
} else message.warning(msg)
|
||||
// getSwiperList()
|
||||
// push({name:'Diffspace'})
|
||||
|
||||
}
|
||||
async function onSubmit(row) {
|
||||
// swiperList.value.push(row)
|
||||
console.log(row)
|
||||
if (row.indexId === '') {
|
||||
message.info("请选择分类选项!")
|
||||
message.info('请选择分类选项!')
|
||||
return
|
||||
}
|
||||
if (!row.catId || row.catId === '') {
|
||||
message.info("请选择所属模块!")
|
||||
message.info('请选择所属模块!')
|
||||
return
|
||||
}
|
||||
|
||||
row.title = '【' + row.catId + '】' + row.title
|
||||
|
||||
if(row.fileList&&row.fileList.length>0){
|
||||
if (row.fileList && row.fileList.length > 0) {
|
||||
if (row.fileList[0].response) {
|
||||
row.filePath = row.fileList[0].response.url
|
||||
}
|
||||
else {
|
||||
row.filePath = row.fileList[0].url
|
||||
}
|
||||
}
|
||||
const {msg,code} = await updateActOne(row)
|
||||
if (code === 200) {
|
||||
message.success("操作成功")
|
||||
getSwiperList()
|
||||
row.filePath = row.fileList[0].response.url
|
||||
} else {
|
||||
row.filePath = row.fileList[0].url
|
||||
}
|
||||
}
|
||||
const { msg, code } = await updateActOne(row)
|
||||
if (code === 200) {
|
||||
message.success('操作成功')
|
||||
getSwiperList()
|
||||
}
|
||||
// else message.warning(msg)
|
||||
// swiperList.value.map(obj => {
|
||||
// obj.id === row.id ? { ...obj, ...row } : obj
|
||||
|
|
@ -130,19 +137,41 @@ async function onSubmit(row) {
|
|||
// }
|
||||
shomkB.value = false
|
||||
|
||||
|
||||
console.log(swiperList.value)
|
||||
}
|
||||
|
||||
async function onSubmitAdds() {
|
||||
|
||||
const actTopUserList = unref(actTopUserLists.value)
|
||||
const actMidUserList = unref(actMidUserLists.value)
|
||||
const actDownUserList = unref(actDownUserLists.value)
|
||||
const { id, bannerUserList, 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 {
|
||||
id,
|
||||
bannerUserList,
|
||||
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)
|
||||
|
|
@ -151,20 +180,16 @@ const shomksB = () => {
|
|||
console.log(shomkB.value)
|
||||
}
|
||||
|
||||
|
||||
let swiperList = ref([
|
||||
|
||||
])
|
||||
let swiperList = ref([])
|
||||
const editList = ref()
|
||||
const handleEdit = (index: number, row: any) => {
|
||||
console.log(row)
|
||||
if (row && row.url) {
|
||||
console.log(row.files.length)
|
||||
if (row.files.length <= 0) {
|
||||
row.files.push({ url: row.url });
|
||||
row.files.push({ url: row.url })
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
editList.value = {
|
||||
id: '',
|
||||
indexId: '1',
|
||||
|
|
@ -180,43 +205,53 @@ const handleEdit = (index: number, row: any) => {
|
|||
|
||||
console.log(row)
|
||||
}
|
||||
const list = ref([{
|
||||
id: 1,
|
||||
title: '部品业种',
|
||||
options: [{ id: '1', cateName: 'DEVICE' }, { id: '2', cateName: '加工品' }, { id: '3', cateName: '原材料' }]
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
title: '走访类型',
|
||||
options: [{ id: '1', cateName: '供方走访' }, { id: '2', cateName: '展会走访' }, { id: '3', cateName: '企业走访' }]
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: '探索方向',
|
||||
options: []
|
||||
},
|
||||
const list = ref([
|
||||
{
|
||||
id: 1,
|
||||
title: '部品业种',
|
||||
options: [
|
||||
{ id: '1', cateName: 'DEVICE' },
|
||||
{ id: '2', cateName: '加工品' },
|
||||
{ id: '3', cateName: '原材料' }
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
title: '走访类型',
|
||||
options: [
|
||||
{ id: '1', cateName: '供方走访' },
|
||||
{ id: '2', cateName: '展会走访' },
|
||||
{ id: '3', cateName: '企业走访' }
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: '探索方向',
|
||||
options: []
|
||||
}
|
||||
])
|
||||
const opt = ref()
|
||||
const radioClick = (e) => {
|
||||
opt.value = list.value.find(item => item.id == e)
|
||||
opt.value = list.value.find((item) => item.id == e)
|
||||
// console.log(ll)
|
||||
}
|
||||
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
|
||||
|
||||
if(!id) return
|
||||
|
||||
const {code,msg} =await actLABDel({id})
|
||||
if(code===200){message.info("操作成功!")}
|
||||
else{
|
||||
message.error(msg)
|
||||
}
|
||||
getSwiperList()
|
||||
if (!id) return
|
||||
|
||||
const { code, msg } = await actLABDel({ id })
|
||||
if (code === 200) {
|
||||
message.info('操作成功!')
|
||||
} else {
|
||||
message.error(msg)
|
||||
}
|
||||
getSwiperList()
|
||||
}
|
||||
|
||||
const handOnExceed: UploadProps['onExceed'] = (uploadFile: any, uploadFiles: any) => {
|
||||
message.warning("最多只能上传一个文件!")
|
||||
message.warning('最多只能上传一个文件!')
|
||||
}
|
||||
|
||||
const header = { 'token': store.user.token }
|
||||
|
|
@ -232,7 +267,6 @@ const getUser = (id: any) => {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// 获取子组件传过来的值
|
||||
const handleChild = (data: any) => {
|
||||
const { showModal: show, multipleSelection } = data
|
||||
|
|
@ -240,95 +274,117 @@ const handleChild = (data: any) => {
|
|||
// userList.value = multipleSelection
|
||||
let userIdList: any[] = []
|
||||
multipleSelection.value.forEach((i: { userId: any }) => {
|
||||
|
||||
userIdList.push(i.userId)
|
||||
})
|
||||
if (flg.value === 1) {
|
||||
actTopUserLists.value = userIdList
|
||||
// actDownUserLists.value = userIdList
|
||||
// actMidUserLists.value = userIdList
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
actMidUserLists.value = userIdList
|
||||
}
|
||||
console.log(userIdList)
|
||||
onSubmitAdds()
|
||||
|
||||
}
|
||||
const CloseThiss = (data: boolean) => {
|
||||
console.log(data)
|
||||
showModal.value = data
|
||||
}
|
||||
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 thisSelect = (e) => {
|
||||
|
||||
pageInfo.index = e
|
||||
|
||||
}
|
||||
const thisSelects = () => {
|
||||
pageInfo.index = ''
|
||||
}
|
||||
|
||||
const pageInfo = reactive({
|
||||
currentPage:1,
|
||||
pageSize:10,
|
||||
total:10,
|
||||
index:''
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 10,
|
||||
index: ''
|
||||
})
|
||||
const ss = computed(() => [pageInfo.index,pageInfo.currentPage])
|
||||
watch(() => unref(ss),
|
||||
const ss = computed(() => [pageInfo.index, pageInfo.currentPage])
|
||||
watch(
|
||||
() => unref(ss),
|
||||
async (v) => {
|
||||
|
||||
getSwiperList()
|
||||
|
||||
},
|
||||
{ immediate: true, deep: true },
|
||||
{ immediate: true, deep: true }
|
||||
)
|
||||
|
||||
async function getSwiperList() {
|
||||
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
|
||||
if (!rows) return
|
||||
const datas = rows.map((item: any) => Object.assign(item, {
|
||||
indexId: item.indexId + '',
|
||||
}))
|
||||
const datas = rows.map((item: any) =>
|
||||
Object.assign(item, {
|
||||
indexId: item.indexId + ''
|
||||
})
|
||||
)
|
||||
swiperList.value = datas
|
||||
swiperList.value = datas.map((item: { filePathList: any[] }) => {
|
||||
const fileList = item.filePathList.map((itt: any) => Object.assign(itt, {
|
||||
name: itt.originalFileName,
|
||||
url: itt.url
|
||||
}))
|
||||
const fileList = item.filePathList.map((itt: any) =>
|
||||
Object.assign(itt, {
|
||||
name: itt.originalFileName,
|
||||
url: itt.url
|
||||
})
|
||||
)
|
||||
return { ...item, fileList }
|
||||
})
|
||||
}
|
||||
const handleSizeChange=(e)=>{
|
||||
const handleSizeChange = (e) => {
|
||||
console.log(e)
|
||||
}
|
||||
|
||||
const handleCurrentChange=(e)=>{
|
||||
const handleCurrentChange = (e) => {
|
||||
console.log(e)
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="relative w-full h-full">
|
||||
<div class="flex my20px">
|
||||
|
||||
<el-button type="primary" @click="handleEdit" class="mr-20px">新增研究方向内容</el-button>
|
||||
<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"
|
||||
value-field="id" @update:value="thisSelect" />
|
||||
<n-select
|
||||
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>
|
||||
</div>
|
||||
|
||||
<el-table :data="swiperList" 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
|
||||
:data="swiperList"
|
||||
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="分类选项" width="280">
|
||||
<template #default="scope">
|
||||
|
|
@ -345,7 +401,6 @@ const handleCurrentChange=(e)=>{
|
|||
{{ it.name }}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="通知范围" prop="fileList" >
|
||||
<template #default="scope">
|
||||
|
|
@ -358,14 +413,14 @@ const handleCurrentChange=(e)=>{
|
|||
<el-table-column label="操作" :header-style="{ background: 'red' }">
|
||||
<template #default="scope">
|
||||
<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>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<el-form-item>
|
||||
<div class="my20px fixed bottom-25px left-20% z-2000 h50px w-200px">
|
||||
<!-- <el-button type="primary" @click="onSubmitAdd">提交数据</el-button> -->
|
||||
|
|
@ -375,16 +430,17 @@ const handleCurrentChange=(e)=>{
|
|||
</div>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class=" fixed bottom-65px right-100px ">
|
||||
<el-pagination v-model:current-page="pageInfo.currentPage" v-model:page-size="pageInfo.pageSize"
|
||||
layout="prev, pager, next, jumper" :total="pageInfo.total"
|
||||
@size-change="handleSizeChange" @current-change="handleCurrentChange" />
|
||||
</div>
|
||||
<div class="fixed bottom-65px right-100px">
|
||||
<el-pagination
|
||||
v-model:current-page="pageInfo.currentPage"
|
||||
v-model:page-size="pageInfo.pageSize"
|
||||
layout="prev, pager, next, jumper"
|
||||
:total="pageInfo.total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
</div>
|
||||
<n-modal v-model:show="shomkB">
|
||||
|
||||
<div class="bg-#FFF p30px">
|
||||
<el-form :model="editList" label-width="120px" :inline="true">
|
||||
<el-form-item label="分类选项">
|
||||
|
|
@ -394,26 +450,72 @@ const handleCurrentChange=(e)=>{
|
|||
<el-radio label="3" size="large">外部调研报告</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<br>
|
||||
<br />
|
||||
<el-form-item :label="opt.title">
|
||||
<n-select class="min-w220px" size="large" v-if="opt.options" v-model:value="editList.catId"
|
||||
:options="opt.options" label-field="cateName" value-field="cateName" />
|
||||
<n-select
|
||||
class="min-w220px"
|
||||
v-if="opt.options"
|
||||
v-model:value="editList.catId"
|
||||
:options="opt.options"
|
||||
label-field="cateName"
|
||||
value-field="cateName"
|
||||
/>
|
||||
</el-form-item>
|
||||
<br>
|
||||
<br />
|
||||
<el-form-item label="标题">
|
||||
<el-input v-model="editList.title" />
|
||||
</el-form-item>
|
||||
|
||||
<br>
|
||||
<br />
|
||||
<el-form-item label="文件">
|
||||
<el-upload 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-upload
|
||||
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-upload>
|
||||
</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>
|
||||
<hr class="mb15px border-#f1f1f1">
|
||||
<hr class="mb15px border-#f1f1f1" />
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit(editList)">确认</el-button>
|
||||
</el-form-item>
|
||||
|
|
@ -430,4 +532,4 @@ const handleCurrentChange=(e)=>{
|
|||
right: 30px;
|
||||
top: -92px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import {
|
|||
import { saveArticle, trendsDetail } from '@/api/daikin/base'
|
||||
import Editor from '../components/TinyECE.vue'
|
||||
import { useUserStore } from '@/stores/modules/user'
|
||||
import { pickerOptions } from '@/utils/date'
|
||||
import { useRoute } from 'vue-router'
|
||||
const { day, week } = useDate()
|
||||
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)
|
||||
const { msg, code } = await saveArticle({
|
||||
title,
|
||||
|
|
@ -183,7 +184,10 @@ async function save() {
|
|||
type,
|
||||
content,
|
||||
bannerImg,
|
||||
userIdList
|
||||
userIdList,
|
||||
isTop,
|
||||
isPublish,
|
||||
publishTime
|
||||
})
|
||||
if (code === 200) {
|
||||
message.success('新增成功')
|
||||
|
|
@ -370,6 +374,37 @@ const handleClose = (tag: any) => {
|
|||
{{ i.nickName }}
|
||||
</el-tag>
|
||||
</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>
|
||||
<div>
|
||||
<n-button @click="showModal = true"> 文本内容预览</n-button>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import HomeHeadSearch from '@/views/home/components/HomeHeadSearch.vue'
|
|||
import UserPage from './UserPages.vue'
|
||||
import { useDate } from '@/views/home/hooks/useDate'
|
||||
import { getArticleDetail, review } from '@/api/daikin/base'
|
||||
import { pickerOptions } from '@/utils/date'
|
||||
import {
|
||||
NModal,
|
||||
NCard,
|
||||
|
|
@ -59,6 +60,8 @@ let formValue: any = ref({
|
|||
source: '',
|
||||
content: '',
|
||||
isTop: 'N',
|
||||
isPublish: 0,
|
||||
publishTime: '',
|
||||
bannerImg: ''
|
||||
})
|
||||
|
||||
|
|
@ -422,6 +425,37 @@ const showModalRefs = ref(false)
|
|||
{{ i.nickName }}
|
||||
</el-tag>
|
||||
</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">
|
||||
<n-form-item>
|
||||
<n-button attr-type="button" style="padding: 0 20px" @click="submitSave(2)">
|
||||
|
|
|
|||
|
|
@ -5,8 +5,9 @@ import HomeHead from '@/views/home/components/HomeHead.vue'
|
|||
import { useMessage, NModal } from 'naive-ui'
|
||||
import { useUserStore } from '@/stores/modules/user'
|
||||
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 store = useUserStore()
|
||||
|
|
@ -15,7 +16,6 @@ const header = { 'token': store.user.token }
|
|||
const dataA = ref([])
|
||||
const editA = ref()
|
||||
|
||||
|
||||
const shomkA = ref(false)
|
||||
|
||||
async function setDataFiles(arr, _row) {
|
||||
|
|
@ -23,136 +23,155 @@ async function setDataFiles(arr, _row) {
|
|||
arr.value = _row.map((i: { filePathList: { name: any; originalFileName: any }[] }) => {
|
||||
if (i.filePathList && i.filePathList.length > 0) {
|
||||
i.filePathList.forEach((file: { name: any; originalFileName: any }) => {
|
||||
file.name = file.originalFileName;
|
||||
});
|
||||
file.name = file.originalFileName
|
||||
})
|
||||
}
|
||||
return i
|
||||
})
|
||||
}
|
||||
}
|
||||
const type =ref(2)
|
||||
const type = ref(2)
|
||||
async function getDataA() {
|
||||
const {data} = await getList({type:2})
|
||||
dataA.value = data
|
||||
// setDataFiles(dataArr);
|
||||
const { data } = await getList({ type: 2 })
|
||||
dataA.value = data
|
||||
// setDataFiles(dataArr);
|
||||
}
|
||||
|
||||
|
||||
onMounted(async () => {
|
||||
getDataA();
|
||||
getDataA()
|
||||
})
|
||||
|
||||
function computedName(title) {
|
||||
let index = title.indexOf(".");
|
||||
let index = title.indexOf('.')
|
||||
if (index > -1) {
|
||||
return title.slice(0, index - 1);
|
||||
return title.slice(0, index - 1)
|
||||
}
|
||||
return title;
|
||||
return title
|
||||
}
|
||||
|
||||
async function onSubmitA(row: { 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)
|
||||
const { id, title } = row
|
||||
const { id, title, isTop, isPublish, publishTime } = row
|
||||
// let moduleId = 1;
|
||||
let sendData= {}
|
||||
if(!row.id){
|
||||
sendData = { title,type:type.value,userIdList:userData.value };
|
||||
if (row.fileList && row.fileList.length > 0) {
|
||||
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);
|
||||
}
|
||||
|
||||
})
|
||||
let sendData = {}
|
||||
if (!row.id) {
|
||||
sendData = {
|
||||
title,
|
||||
type: type.value,
|
||||
userIdList: userData.value,
|
||||
isTop,
|
||||
isPublish,
|
||||
publishTime
|
||||
}
|
||||
if (row.fileList && row.fileList.length > 0) {
|
||||
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);
|
||||
}
|
||||
})
|
||||
}
|
||||
} else {
|
||||
sendData = {
|
||||
id,
|
||||
title,
|
||||
type: type.value,
|
||||
userIdList: userData.value,
|
||||
isTop,
|
||||
isPublish,
|
||||
publishTime
|
||||
}
|
||||
}
|
||||
console.log(sendData)
|
||||
const { code, msg } = await marketPreADD(sendData)
|
||||
if (code === 200) {
|
||||
message.success('修改成功!')
|
||||
} else {
|
||||
message.error(msg)
|
||||
}
|
||||
}
|
||||
else{
|
||||
sendData = {id, title,type:type.value,userIdList:userData.value };
|
||||
}
|
||||
console.log(sendData)
|
||||
const {code,msg} = await marketPreADD(sendData)
|
||||
if (code === 200) { message.success("修改成功!") }
|
||||
else { message.error(msg) }
|
||||
shomkA.value = false
|
||||
getDataA();
|
||||
getDataA()
|
||||
}
|
||||
|
||||
|
||||
|
||||
const handleEditA = (type: string, row: any) => {
|
||||
console.log(row)
|
||||
editA.value = {
|
||||
title: '',
|
||||
fileList: [],
|
||||
fileList: []
|
||||
}
|
||||
setUserList.value =[]
|
||||
setUserList.value = []
|
||||
shomkA.value = true
|
||||
if (!row) return
|
||||
|
||||
editA.value = row
|
||||
editA.value.fileList = [{
|
||||
name: row.title,
|
||||
originalFilename: row.title,
|
||||
url: row.filePath,
|
||||
}]
|
||||
setUserList.value =row.userIdList
|
||||
editA.value.fileList = [
|
||||
{
|
||||
name: row.title,
|
||||
originalFilename: row.title,
|
||||
url: row.filePath
|
||||
}
|
||||
]
|
||||
setUserList.value = row.userIdList
|
||||
}
|
||||
|
||||
|
||||
async function handleDeleteA(index: number, row: any) {
|
||||
const { id } = row
|
||||
if (!id) return
|
||||
const { code, msg } = await marketPreDelete({ id,type:type.value })
|
||||
if (code === 200) { message.success("删除成功!") }
|
||||
else { message.error(msg) }
|
||||
getDataA();
|
||||
const { code, msg } = await marketPreDelete({ id, type: type.value })
|
||||
if (code === 200) {
|
||||
message.success('删除成功!')
|
||||
} else {
|
||||
message.error(msg)
|
||||
}
|
||||
getDataA()
|
||||
}
|
||||
|
||||
|
||||
const activeName = ref("first")
|
||||
const activeName = ref('first')
|
||||
const userList = ref()
|
||||
const showModal = ref(false)
|
||||
const flg = ref()
|
||||
const setUserList =ref()
|
||||
const setUserList = ref()
|
||||
async function getUser(row) {
|
||||
console.log(row)
|
||||
showModal.value = !showModal.value
|
||||
flg.value = row
|
||||
if(row.id&&row.userIdList){
|
||||
if (row.id && row.userIdList) {
|
||||
setUserList.value = row.userIdList
|
||||
}
|
||||
// const {data: userArr} = await getBPCUser({moduleId})
|
||||
// setUserList.value = userArr
|
||||
|
||||
}
|
||||
// 获取子组件传过来的值
|
||||
const userData = ref()
|
||||
const handleChild = (data: any) => {
|
||||
console.log(data, 444);
|
||||
const { showModal: show, multipleSelection } = data
|
||||
showModal.value = unref(show)
|
||||
let userIdList: any[] =[]
|
||||
multipleSelection.value.forEach((i: { userId: any })=>{
|
||||
userIdList.push(i.userId)
|
||||
})
|
||||
if(flg.value.id){
|
||||
flg.value.userIdList = userIdList
|
||||
marketPreADD(flg.value)
|
||||
getDataA();
|
||||
console.log(flg.value)
|
||||
}
|
||||
userData.value = userIdList
|
||||
// 获取子组件传过来的值
|
||||
const userData = ref()
|
||||
const handleChild = (data: any) => {
|
||||
console.log(data, 444)
|
||||
const { showModal: show, multipleSelection } = data
|
||||
showModal.value = unref(show)
|
||||
let userIdList: any[] = []
|
||||
multipleSelection.value.forEach((i: { userId: any }) => {
|
||||
userIdList.push(i.userId)
|
||||
})
|
||||
if (flg.value.id) {
|
||||
flg.value.userIdList = userIdList
|
||||
marketPreADD(flg.value)
|
||||
getDataA()
|
||||
console.log(flg.value)
|
||||
}
|
||||
const CloseThiss = (data: boolean)=>{
|
||||
showModal.value = data
|
||||
}
|
||||
|
||||
userData.value = userIdList
|
||||
}
|
||||
const CloseThiss = (data: boolean) => {
|
||||
showModal.value = data
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<HomeHead class="top">
|
||||
|
|
@ -165,16 +184,25 @@ async function getUser(row) {
|
|||
<!-- <img src="./images/logo.svg" class="h56px mr21px" /> -->
|
||||
<div class="text-36px text-#000">汇率内容管理</div>
|
||||
</div>
|
||||
|
||||
<div class=" cont relative w100% h800px overflow-y-auto">
|
||||
<el-button type="primary" @click="handleEditA" class="my20px">汇率内容新增</el-button>
|
||||
|
||||
<el-table :data="dataA" 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="title" />
|
||||
<!--
|
||||
|
||||
<div class="cont relative w100% h800px overflow-y-auto">
|
||||
<el-button type="primary" @click="handleEditA" class="my20px">汇率内容新增</el-button>
|
||||
|
||||
<el-table
|
||||
:data="dataA"
|
||||
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="title" />
|
||||
<!--
|
||||
<el-table-column label="文件列表" prop="filePathList">
|
||||
<template #default="scope">
|
||||
<div v-if="scope.row.filePathList" v-for="(it, index) in scope.row.filePathList">
|
||||
|
|
@ -184,22 +212,24 @@ async function getUser(row) {
|
|||
</template>
|
||||
|
||||
</el-table-column> -->
|
||||
<el-table-column label="查看范围" prop="userIdList">
|
||||
<template #default="scope">
|
||||
<!-- <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"> {{it.nickName}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="180px">
|
||||
<template #default="scope">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
|
||||
<el-table-column label="查看范围" prop="userIdList">
|
||||
<template #default="scope">
|
||||
<!-- <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">
|
||||
{{ it.nickName }}</span
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="180px">
|
||||
<template #default="scope">
|
||||
<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
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</AppBlock>
|
||||
|
||||
<n-modal v-model:show="shomkA">
|
||||
|
|
@ -212,30 +242,71 @@ async function getUser(row) {
|
|||
<el-radio label="New" size="large">New</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item> -->
|
||||
<br>
|
||||
<br />
|
||||
<el-form-item label="标题">
|
||||
<el-input v-model="editA.title" />
|
||||
</el-form-item>
|
||||
<br>
|
||||
<br />
|
||||
<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>
|
||||
<br>
|
||||
<br />
|
||||
<el-form-item label="文件">
|
||||
<el-upload 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-upload
|
||||
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-upload>
|
||||
</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>
|
||||
<hr class="mb15px border-#f1f1f1">
|
||||
|
||||
<hr class="mb15px border-#f1f1f1" />
|
||||
|
||||
<el-button class="flex-center" type="primary" @click="onSubmitA(editA)">确认</el-button>
|
||||
</div>
|
||||
</n-modal>
|
||||
|
||||
<n-modal v-model:show="showModal">
|
||||
<UserList :userDataList="setUserList" @clickChild="handleChild" @CloseThis="CloseThiss"/>
|
||||
<UserList :userDataList="setUserList" @clickChild="handleChild" @CloseThis="CloseThiss" />
|
||||
</n-modal>
|
||||
</template>
|
||||
|
||||
|
|
@ -255,4 +326,4 @@ async function getUser(row) {
|
|||
justify-content: center;
|
||||
margin: 0 auto;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ import HomeHead from '@/views/home/components/HomeHead.vue'
|
|||
import { useMessage, NModal } from 'naive-ui'
|
||||
import { useUserStore } from '@/stores/modules/user'
|
||||
import UserList from '@/views/home/intelligence/process/UserPages.vue'
|
||||
|
||||
import { getList, marketPreDelete,marketPreADD } from '@/api/daikin/base'
|
||||
import { pickerOptions } from '@/utils/date'
|
||||
import { getList, marketPreDelete, marketPreADD } from '@/api/daikin/base'
|
||||
|
||||
const message = useMessage()
|
||||
const store = useUserStore()
|
||||
|
|
@ -15,7 +15,6 @@ const header = { 'token': store.user.token }
|
|||
const dataA = ref([])
|
||||
const editA = ref()
|
||||
|
||||
|
||||
const shomkA = ref(false)
|
||||
|
||||
async function setDataFiles(arr, _row) {
|
||||
|
|
@ -23,135 +22,154 @@ async function setDataFiles(arr, _row) {
|
|||
arr.value = _row.map((i: { filePathList: { name: any; originalFileName: any }[] }) => {
|
||||
if (i.filePathList && i.filePathList.length > 0) {
|
||||
i.filePathList.forEach((file: { name: any; originalFileName: any }) => {
|
||||
file.name = file.originalFileName;
|
||||
});
|
||||
file.name = file.originalFileName
|
||||
})
|
||||
}
|
||||
return i
|
||||
})
|
||||
}
|
||||
}
|
||||
const type =ref(1)
|
||||
const type = ref(1)
|
||||
async function getDataA() {
|
||||
const {data} = await getList({type:1})
|
||||
dataA.value = data
|
||||
// setDataFiles(dataArr);
|
||||
const { data } = await getList({ type: 1 })
|
||||
dataA.value = data
|
||||
// setDataFiles(dataArr);
|
||||
}
|
||||
|
||||
|
||||
onMounted(async () => {
|
||||
getDataA();
|
||||
getDataA()
|
||||
})
|
||||
|
||||
function computedName(title) {
|
||||
let index = title.indexOf(".");
|
||||
let index = title.indexOf('.')
|
||||
if (index > -1) {
|
||||
return title.slice(0, index - 1);
|
||||
return title.slice(0, index - 1)
|
||||
}
|
||||
return title;
|
||||
return title
|
||||
}
|
||||
|
||||
async function onSubmitA(row: { 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)
|
||||
const { id, title } = row
|
||||
const { id, title, isTop, isPublish, publishTime } = row
|
||||
// let moduleId = 1;
|
||||
let sendData= {}
|
||||
if(!row.id){
|
||||
sendData = { title,type:type.value,userIdList:userData.value };
|
||||
if (row.fileList && row.fileList.length > 0) {
|
||||
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);
|
||||
}
|
||||
|
||||
})
|
||||
let sendData = {}
|
||||
if (!row.id) {
|
||||
sendData = {
|
||||
title,
|
||||
type: type.value,
|
||||
userIdList: userData.value,
|
||||
isTop,
|
||||
isPublish,
|
||||
publishTime
|
||||
}
|
||||
if (row.fileList && row.fileList.length > 0) {
|
||||
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);
|
||||
}
|
||||
})
|
||||
}
|
||||
} else {
|
||||
sendData = {
|
||||
id,
|
||||
title,
|
||||
type: type.value,
|
||||
userIdList: userData.value,
|
||||
isTop,
|
||||
isPublish,
|
||||
publishTime
|
||||
}
|
||||
}
|
||||
console.log(sendData)
|
||||
const { code, msg } = await marketPreADD(sendData)
|
||||
if (code === 200) {
|
||||
message.success('修改成功!')
|
||||
} else {
|
||||
message.error(msg)
|
||||
}
|
||||
}
|
||||
else{
|
||||
sendData = {id, title,type:type.value,userIdList:userData.value };
|
||||
}
|
||||
console.log(sendData)
|
||||
const {code,msg} = await marketPreADD(sendData)
|
||||
if (code === 200) { message.success("修改成功!") }
|
||||
else { message.error(msg) }
|
||||
shomkA.value = false
|
||||
getDataA();
|
||||
getDataA()
|
||||
}
|
||||
|
||||
|
||||
|
||||
const handleEditA = (type: string, row: any) => {
|
||||
console.log(row)
|
||||
editA.value = {
|
||||
title: '',
|
||||
fileList: [],
|
||||
fileList: []
|
||||
}
|
||||
setUserList.value =[]
|
||||
setUserList.value = []
|
||||
shomkA.value = true
|
||||
if (!row) return
|
||||
|
||||
editA.value = row
|
||||
editA.value.fileList = [{
|
||||
name: row.title,
|
||||
originalFilename: row.title,
|
||||
url: row.filePath,
|
||||
}]
|
||||
setUserList.value =row.userIdList
|
||||
editA.value.fileList = [
|
||||
{
|
||||
name: row.title,
|
||||
originalFilename: row.title,
|
||||
url: row.filePath
|
||||
}
|
||||
]
|
||||
setUserList.value = row.userIdList
|
||||
}
|
||||
|
||||
|
||||
async function handleDeleteA(index: number, row: any) {
|
||||
const { id } = row
|
||||
if (!id) return
|
||||
const { code, msg } = await marketPreDelete({ id,type:type.value })
|
||||
if (code === 200) { message.success("删除成功!") }
|
||||
else { message.error(msg) }
|
||||
getDataA();
|
||||
const { code, msg } = await marketPreDelete({ id, type: type.value })
|
||||
if (code === 200) {
|
||||
message.success('删除成功!')
|
||||
} else {
|
||||
message.error(msg)
|
||||
}
|
||||
getDataA()
|
||||
}
|
||||
|
||||
|
||||
const activeName = ref("first")
|
||||
const activeName = ref('first')
|
||||
const userList = ref()
|
||||
const showModal = ref(false)
|
||||
const flg = ref()
|
||||
const setUserList =ref()
|
||||
const setUserList = ref()
|
||||
async function getUser(row) {
|
||||
console.log(row)
|
||||
showModal.value = !showModal.value
|
||||
flg.value = row
|
||||
if(row.id&&row.userIdList){
|
||||
if (row.id && row.userIdList) {
|
||||
setUserList.value = row.userIdList
|
||||
}
|
||||
// const {data: userArr} = await getBPCUser({moduleId})
|
||||
// setUserList.value = userArr
|
||||
|
||||
}
|
||||
// 获取子组件传过来的值
|
||||
const userData = ref()
|
||||
const handleChild = (data: any) => {
|
||||
console.log(data, 444);
|
||||
const { showModal: show, multipleSelection } = data
|
||||
showModal.value = unref(show)
|
||||
let userIdList: any[] =[]
|
||||
multipleSelection.value.forEach((i: { userId: any })=>{
|
||||
userIdList.push(i.userId)
|
||||
})
|
||||
if(flg.value.id){
|
||||
flg.value.userIdList = userIdList
|
||||
console.log(flg.value)
|
||||
marketPreADD(flg.value)
|
||||
}
|
||||
userData.value = userIdList
|
||||
// 获取子组件传过来的值
|
||||
const userData = ref()
|
||||
const handleChild = (data: any) => {
|
||||
console.log(data, 444)
|
||||
const { showModal: show, multipleSelection } = data
|
||||
showModal.value = unref(show)
|
||||
let userIdList: any[] = []
|
||||
multipleSelection.value.forEach((i: { userId: any }) => {
|
||||
userIdList.push(i.userId)
|
||||
})
|
||||
if (flg.value.id) {
|
||||
flg.value.userIdList = userIdList
|
||||
console.log(flg.value)
|
||||
marketPreADD(flg.value)
|
||||
}
|
||||
const CloseThiss = (data: boolean)=>{
|
||||
showModal.value = data
|
||||
}
|
||||
|
||||
userData.value = userIdList
|
||||
}
|
||||
const CloseThiss = (data: boolean) => {
|
||||
showModal.value = data
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<HomeHead class="top">
|
||||
|
|
@ -164,16 +182,25 @@ async function getUser(row) {
|
|||
<!-- <img src="./images/logo.svg" class="h56px mr21px" /> -->
|
||||
<div class="text-36px text-#000">市况内容管理</div>
|
||||
</div>
|
||||
|
||||
<div class=" cont relative w100% h800px overflow-y-auto">
|
||||
<el-button type="primary" @click="handleEditA('add')" class="my20px">市况内容新增</el-button>
|
||||
|
||||
<el-table :data="dataA" 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="title" />
|
||||
<!--
|
||||
|
||||
<div class="cont relative w100% h800px overflow-y-auto">
|
||||
<el-button type="primary" @click="handleEditA('add')" class="my20px">市况内容新增</el-button>
|
||||
|
||||
<el-table
|
||||
:data="dataA"
|
||||
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="title" />
|
||||
<!--
|
||||
<el-table-column label="文件列表" prop="filePathList">
|
||||
<template #default="scope">
|
||||
<div v-if="scope.row.filePathList" v-for="(it, index) in scope.row.filePathList">
|
||||
|
|
@ -183,22 +210,24 @@ async function getUser(row) {
|
|||
</template>
|
||||
|
||||
</el-table-column> -->
|
||||
<el-table-column label="查看范围" prop="userIdList">
|
||||
<template #default="scope">
|
||||
<!-- <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"> {{it.nickName}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="180px">
|
||||
<template #default="scope">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
|
||||
<el-table-column label="查看范围" prop="userIdList">
|
||||
<template #default="scope">
|
||||
<!-- <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"
|
||||
> {{ it.nickName }}</span
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="180px">
|
||||
<template #default="scope">
|
||||
<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
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</AppBlock>
|
||||
|
||||
<n-modal v-model:show="shomkA">
|
||||
|
|
@ -211,30 +240,71 @@ async function getUser(row) {
|
|||
<el-radio label="New" size="large">New</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item> -->
|
||||
<br>
|
||||
<br />
|
||||
<el-form-item label="标题">
|
||||
<el-input v-model="editA.title" />
|
||||
</el-form-item>
|
||||
<br>
|
||||
<br />
|
||||
<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>
|
||||
<br>
|
||||
<br />
|
||||
<el-form-item label="文件">
|
||||
<el-upload 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-upload
|
||||
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-upload>
|
||||
</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>
|
||||
<hr class="mb15px border-#f1f1f1">
|
||||
|
||||
<hr class="mb15px border-#f1f1f1" />
|
||||
|
||||
<el-button class="flex-center" type="primary" @click="onSubmitA(editA)">确认</el-button>
|
||||
</div>
|
||||
</n-modal>
|
||||
|
||||
<n-modal v-model:show="showModal">
|
||||
<UserList :userDataList="setUserList" @clickChild="handleChild" @CloseThis="CloseThiss"/>
|
||||
<UserList :userDataList="setUserList" @clickChild="handleChild" @CloseThis="CloseThiss" />
|
||||
</n-modal>
|
||||
</template>
|
||||
|
||||
|
|
@ -254,4 +324,4 @@ async function getUser(row) {
|
|||
justify-content: center;
|
||||
margin: 0 auto;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import {
|
|||
badartGetUser,
|
||||
badartAddUser
|
||||
} from '@/api/daikin/base'
|
||||
import { pickerOptions } from '@/utils/date'
|
||||
import UserList from '@/views/home/intelligence/process/UserPages.vue'
|
||||
const message = useMessage()
|
||||
const store = useUserStore()
|
||||
|
|
@ -123,9 +124,13 @@ async function onSubmitA(row: {
|
|||
proportion?: any
|
||||
partSum?: any
|
||||
badSum?: any
|
||||
monthDate?: any
|
||||
isTop?: any
|
||||
isPublish?: any
|
||||
publishTime?: any
|
||||
}) {
|
||||
console.log(row)
|
||||
const { id, indexId, title, partSum, badSum, monthDate } = row
|
||||
const { id, indexId, title, partSum, badSum, monthDate, isTop, isPublish, publishTime } = row
|
||||
let filePathArr = []
|
||||
|
||||
if (row.fileList && row.fileList.length > 0) {
|
||||
|
|
@ -146,7 +151,10 @@ async function onSubmitA(row: {
|
|||
badSum,
|
||||
filePath,
|
||||
cate,
|
||||
monthDate: time
|
||||
monthDate: time,
|
||||
isTop,
|
||||
isPublish,
|
||||
publishTime
|
||||
})
|
||||
if (code === 200) {
|
||||
message.success('修改成功!')
|
||||
|
|
@ -157,8 +165,16 @@ async function onSubmitA(row: {
|
|||
gettopList()
|
||||
}
|
||||
|
||||
async function onSubmitB(row: { filePathList?: any; id?: any; cate?: any; title?: any }) {
|
||||
const { id, cate, title } = row
|
||||
async function onSubmitB(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 = []
|
||||
|
||||
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(',')
|
||||
|
||||
const { code, msg } = await badartAdd({ id, cate, title, filePath })
|
||||
const { code, msg } = await badartAdd({
|
||||
id,
|
||||
cate,
|
||||
title,
|
||||
filePath,
|
||||
isTop,
|
||||
isPublish,
|
||||
publishTime
|
||||
})
|
||||
if (code === 200) {
|
||||
message.success('修改成功!')
|
||||
} else {
|
||||
|
|
@ -180,9 +204,17 @@ async function onSubmitB(row: { filePathList?: any; id?: any; cate?: any; title?
|
|||
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)
|
||||
const { id, source, title } = row
|
||||
const { id, source, title, isTop, isPublish, publishTime } = row
|
||||
let filePathArr = []
|
||||
|
||||
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(',')
|
||||
|
||||
const { code, msg } = await highAdd({ id, source, title, filePath })
|
||||
const { code, msg } = await highAdd({
|
||||
id,
|
||||
source,
|
||||
title,
|
||||
filePath,
|
||||
isTop,
|
||||
isPublish,
|
||||
publishTime
|
||||
})
|
||||
if (code === 200) {
|
||||
message.success('修改成功!')
|
||||
} else message.error(msg)
|
||||
shomkC.value = false
|
||||
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)
|
||||
const { id, title } = row
|
||||
const { id, title, isTop, isPublish, publishTime } = row
|
||||
let filePathArr = []
|
||||
|
||||
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(',')
|
||||
|
||||
const { code, msg } = await actAdd({ id, title, filePath })
|
||||
const { code, msg } = await actAdd({ id, title, filePath, isTop, isPublish, publishTime })
|
||||
if (code === 200) {
|
||||
message.success('修改成功!')
|
||||
} else {
|
||||
|
|
@ -681,6 +728,40 @@ const CloseThiss = (data: any) => {
|
|||
<el-input type="textarea" v-model="editA.title" />
|
||||
</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 />
|
||||
<!-- <el-form-item label="不良内容">
|
||||
<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-upload>
|
||||
</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>
|
||||
<hr class="mb15px border-#f1f1f1" />
|
||||
|
||||
|
|
@ -747,6 +862,40 @@ const CloseThiss = (data: any) => {
|
|||
<el-button type="primary">选择文件</el-button>
|
||||
</el-upload>
|
||||
</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>
|
||||
<hr class="mb15px border-#f1f1f1" />
|
||||
|
||||
|
|
@ -771,6 +920,40 @@ const CloseThiss = (data: any) => {
|
|||
<el-button type="primary">选择文件</el-button>
|
||||
</el-upload>
|
||||
</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>
|
||||
<hr class="mb15px border-#f1f1f1" />
|
||||
|
||||
|
|
|
|||
|
|
@ -257,11 +257,8 @@ var activeItem = 0
|
|||
</n-popover>
|
||||
<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" -->
|
||||
<a
|
||||
href="http://172.31.119.37/scripts/cbgrn/grn.exe/portal/index"
|
||||
target="_blank"
|
||||
class="no-underline text-#fff"
|
||||
>
|
||||
<!-- href="http://172.31.119.37/scripts/cbgrn/grn.exe/portal/index" -->
|
||||
<a :href="store.user?.cwzLoginUrl" target="_blank" class="no-underline text-#fff">
|
||||
<div class="flex items-center text-18px hover:underline">
|
||||
<img src="@/assets/images/icon-book.svg" class="w22px h22px mr10px" />
|
||||
个人日程
|
||||
|
|
|
|||
Loading…
Reference in New Issue