@ -1,10 +0,0 @@ |
|||
# port |
|||
VITE_PORT = 3401 |
|||
#mode |
|||
VITE_GLOB_APP_RUN_TYPE = saas |
|||
|
|||
# spa-title |
|||
VITE_GLOB_APP_TITLE = Smart Parking Depositor |
|||
|
|||
# spa shortname |
|||
VITE_GLOB_APP_SHORT_NAME = smart-parking-depositor |
@ -1,22 +0,0 @@ |
|||
# Whether to open mock |
|||
VITE_USE_MOCK = true |
|||
|
|||
# public path |
|||
VITE_PUBLIC_PATH = / |
|||
|
|||
# Cross-domain proxy, you can configure multiple |
|||
# Please note that no line breaks http://100.73.70.51 |
|||
|
|||
#VITE_PROXY = {"/community":{ "target":"http://100.73.70.51","changeOrigin": true,"prependPath":false},"/parking":{ "target":"http://100.73.70.246:8080","changeOrigin": true,"iprependPath":false}} |
|||
# VITE_PROXY=[["/api","http://100.73.70.51"],["/parking","http://100.73.70.246:8080"]] |
|||
# Delete console |
|||
VITE_DROP_CONSOLE = false |
|||
|
|||
# Basic interface address SPA |
|||
VITE_GLOB_API_URL=/basic-api |
|||
|
|||
# File upload address, optional |
|||
VITE_GLOB_UPLOAD_URL=/upload |
|||
|
|||
# Interface prefix |
|||
VITE_GLOB_API_URL_PREFIX= |
@ -1,35 +0,0 @@ |
|||
# Whether to open mock |
|||
VITE_USE_MOCK = true |
|||
|
|||
# public path |
|||
VITE_PUBLIC_PATH = / |
|||
|
|||
# Delete console |
|||
VITE_DROP_CONSOLE = true |
|||
|
|||
# Whether to enable gzip or brotli compression |
|||
# Optional: gzip | brotli | none |
|||
# If you need multiple forms, you can use `,` to separate |
|||
VITE_BUILD_COMPRESS = 'none' |
|||
|
|||
# Whether to delete origin files when using compress, default false |
|||
VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false |
|||
|
|||
# Basic interface address SPA |
|||
VITE_GLOB_API_URL=/basic-api |
|||
|
|||
# File upload address, optional |
|||
# It can be forwarded by nginx or write the actual address directly |
|||
VITE_GLOB_UPLOAD_URL=/upload |
|||
|
|||
# Interface prefix |
|||
VITE_GLOB_API_URL_PREFIX= |
|||
|
|||
# Whether to enable image compression |
|||
VITE_USE_IMAGEMIN= true |
|||
|
|||
# use pwa |
|||
VITE_USE_PWA = false |
|||
|
|||
# Is it compatible with older browsers |
|||
VITE_LEGACY = false |
@ -1 +0,0 @@ |
|||
1.0.10 |
@ -1,74 +0,0 @@ |
|||
#!/bin/bash |
|||
SOURCE="$0" |
|||
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink |
|||
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" |
|||
SOURCE="$(readlink "$SOURCE")" |
|||
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located |
|||
done |
|||
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" |
|||
|
|||
if [ -z $WORKSPACE ];then |
|||
echo "WORKSPACE not exists" |
|||
else |
|||
set DIR=$WORKSPACE |
|||
fi |
|||
|
|||
echo "current dir" |
|||
echo "$DIR" |
|||
|
|||
cd "$DIR" |
|||
projectname=$(basename `pwd`) |
|||
|
|||
npm run mobile-build |
|||
|
|||
if [ -d "$DIR/dist" ];then |
|||
|
|||
cd "$DIR/dist" |
|||
|
|||
# copy module.json |
|||
cp ../module.json ./ |
|||
|
|||
# package |
|||
VERSION=$(cat ../.version) |
|||
lastdir=../release/ |
|||
if [ -d ${lastdir} ];then |
|||
echo "删除旧release文件夹" |
|||
rm -rf ${lastdir} |
|||
else |
|||
echo "文件夹不存在!" |
|||
fi |
|||
mkdir -p ${lastdir} |
|||
|
|||
dir=../release/nerv/$projectname/$VERSION |
|||
mkdir -p ${dir} |
|||
tar -zcvf "${dir}/$projectname-$VERSION.tgz" ./* |
|||
|
|||
templatedir=../release/resources/templates/nerv/$projectname/$VERSION/$projectname |
|||
mkdir -p ${templatedir} |
|||
cp -r ../resources/templates/* ${templatedir} |
|||
|
|||
cd ../ |
|||
|
|||
releasefile=nerv-$projectname-$VERSION.tgz |
|||
if [ -f ${releasefile} ];then |
|||
echo "删除旧包!" |
|||
rm -rf ${releasefile} |
|||
fi |
|||
|
|||
tar -zcvf ${releasefile} ./release/* release.yaml |
|||
|
|||
mkdir -p ./release/nervui |
|||
cp -r ./release/nerv/* ./release/nervui |
|||
|
|||
if [ -f ${releasefile} ];then |
|||
echo "编译成功!" |
|||
mv ${releasefile} ./release |
|||
else |
|||
echo "编译失败!!!" |
|||
exit 1 |
|||
fi |
|||
|
|||
else |
|||
echo "编译失败!!!" |
|||
exit 1 |
|||
fi |
@ -1,14 +0,0 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en"> |
|||
<head> |
|||
<meta charset="UTF-8" /> |
|||
<link rel="icon" href="/favicon.ico" /> |
|||
<!-- <link rel="shortcut icon" href="/asset/image/logo.ico" type="image/ico" /> --> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
|||
<title>mobile-application</title> |
|||
</head> |
|||
<body> |
|||
<div id="app"></div> |
|||
<script type="module" src="./src/main.ts"></script> |
|||
</body> |
|||
</html> |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 218 KiB |
Before Width: | Height: | Size: 225 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 126 KiB |
Before Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 2.0 MiB |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 904 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 6.0 KiB |
@ -1,12 +0,0 @@ |
|||
# 上传release目录信息到nerv-file仓库 |
|||
release: |
|||
- {src: release, dest: /upload/pkg, include: [".*(.tgz)$"]} |
|||
- {src: release/resources/templates, dest: /upload/templates} |
|||
register: |
|||
name: nervui-mobile-application |
|||
version: 1.0.10 |
|||
components: |
|||
- type: nervui-mobile-application |
|||
resources: |
|||
- {type: template, relativePath: /nervui-mobile-application/deploy.json} |
|||
|
@ -1,35 +0,0 @@ |
|||
echo "=====================================================create=====================================================" |
|||
|
|||
#!/usr/bin/env bash |
|||
|
|||
function create() { |
|||
|
|||
if [ -d "$nervui_app_home" ];then |
|||
echo "$nervui_app_home exists!" |
|||
else |
|||
echo "start mkdir $nervui_app_home" |
|||
mkdir -p "$nervui_app_home" |
|||
fi |
|||
|
|||
pkg_file_name=${pkg_url##*/} |
|||
pkg_file_path="$nervui_app_home$pkg_file_name" |
|||
|
|||
|
|||
echo "start download $pkg_url" |
|||
curl -L -o $pkg_file_path $pkg_url |
|||
|
|||
|
|||
echo "start install $pkg_file_path" |
|||
tar -xf $pkg_file_path -C $nervui_app_home |
|||
|
|||
} |
|||
|
|||
if [ "$pkg_url" == "" ]; then |
|||
echo {\"error\":\"pkg_url is empty\"} |
|||
exit 1 |
|||
elif [ "$nervui_app_home" == "" ]; then |
|||
echo {\"error\":\"nervui_app_home is empty\"} |
|||
exit 1 |
|||
else |
|||
create |
|||
fi |
@ -1 +0,0 @@ |
|||
echo "=====================================================delete=====================================================" |
@ -1 +0,0 @@ |
|||
echo "=====================================================setup=====================================================" |
@ -1 +0,0 @@ |
|||
echo "=====================================================start=====================================================" |
@ -1 +0,0 @@ |
|||
echo "=====================================================stop=====================================================" |
@ -1,30 +0,0 @@ |
|||
{ |
|||
"name": "/nervui/nervui-mobile-application", |
|||
"operations": [ |
|||
{ |
|||
"name": "Create", |
|||
"type": "shell", |
|||
"implementor": "create.sh" |
|||
}, |
|||
{ |
|||
"name": "Delete", |
|||
"type": "shell", |
|||
"implementor": "delete.sh" |
|||
}, |
|||
{ |
|||
"name": "Setup", |
|||
"type": "shell", |
|||
"implementor": "setup.sh" |
|||
}, |
|||
{ |
|||
"name": "Start", |
|||
"type": "shell", |
|||
"implementor": "start.sh" |
|||
}, |
|||
{ |
|||
"name": "Stop", |
|||
"type": "shell", |
|||
"implementor": "stop.sh" |
|||
} |
|||
] |
|||
} |
@ -1,64 +0,0 @@ |
|||
{ |
|||
"name": "/nervui/nervui-mobile-application", |
|||
"version": 1, |
|||
"inputs": [ |
|||
{ |
|||
"name": "server_ip", |
|||
"type": "string", |
|||
"required": true, |
|||
"description": "应用安装IP地址", |
|||
"inputType": "ipSelectType" |
|||
}, |
|||
{ |
|||
"name": "version", |
|||
"type": "string", |
|||
"required": true, |
|||
"description": "软件版本", |
|||
"inputType": "versionSelectType" |
|||
}, |
|||
{ |
|||
"name": "install_dir", |
|||
"type": "string", |
|||
"required": true, |
|||
"defaultValue": "/data", |
|||
"inputType": "textInputType", |
|||
"description": "安装目录" |
|||
} |
|||
], |
|||
"nodes": [ |
|||
{ |
|||
"name": "nervui-mobile-application", |
|||
"type": "/nerv/nerv-orchestrator/cluster/Nervui", |
|||
"parameters": [ |
|||
{ |
|||
"name": "file_repository", |
|||
"value": "${nerv_file_repository}" |
|||
}, |
|||
{ |
|||
"name": "install_dir", |
|||
"value": "${install_dir}" |
|||
}, |
|||
{ |
|||
"name": "pkg_url", |
|||
"value": "/api/pkg/nerv/nervui-mobile-application/${version}/nervui-mobile-application-${version}.tgz" |
|||
} |
|||
], |
|||
"dependencies": [ |
|||
{ |
|||
"type": "contained", |
|||
"target": "host" |
|||
} |
|||
] |
|||
}, |
|||
{ |
|||
"name": "host", |
|||
"type": "/nerv/nerv-orchestrator/compute/Host", |
|||
"parameters": [ |
|||
{ |
|||
"name": "address", |
|||
"value": "${server_ip}" |
|||
} |
|||
] |
|||
} |
|||
] |
|||
} |
@ -1,61 +0,0 @@ |
|||
<!-- @format --> |
|||
|
|||
<template> |
|||
<a-config-provider :locale="locale"> |
|||
<router-view /> |
|||
</a-config-provider> |
|||
</template> |
|||
|
|||
<script lang="ts"> |
|||
import { defineComponent, watch, ref } from 'vue'; |
|||
import zhCN from 'ant-design-vue/es/locale/zh_CN'; |
|||
import { useRouter } from 'vue-router'; |
|||
import Cookies from 'js-cookie'; |
|||
import { message } from 'ant-design-vue'; |
|||
export default defineComponent({ |
|||
name: 'App', |
|||
|
|||
setup() { |
|||
const router = useRouter(); |
|||
|
|||
// router.beforeEach((to, from) => { |
|||
// if (Cookies.get('nervsid') === undefined && to.fullPath !== '/login') { |
|||
// if (from.name !== undefined) { |
|||
// message.warn('登陆信息已过期,请重新登录!', 1); |
|||
// } |
|||
// router.push('/login'); |
|||
// } |
|||
// }); |
|||
|
|||
const cachedViews = ['Status']; |
|||
|
|||
// watch( |
|||
// () => router.currentRoute.value, |
|||
// (e) => { |
|||
// // if (Cookies.get('nervsid') === undefined && e.fullPath !== '/login') { |
|||
// // message.warn('登陆信息已过期,请重新登录!', 1); |
|||
// // router.push('/login'); |
|||
// // } |
|||
// // } else { |
|||
// // if (Cookies.get('nervsid') !== undefined && e === '/login') { |
|||
// // let url = window.sessionStorage.getItem('url'); |
|||
// // url === null ? window.sessionStorage.setItem('url', '/doorway/visitor/audit') : ''; |
|||
// // router.push(url === null ? '/doorway' : url); |
|||
// // } |
|||
// // } |
|||
// } |
|||
// ); |
|||
return { |
|||
cachedViews, |
|||
locale: zhCN, |
|||
}; |
|||
}, |
|||
}); |
|||
</script> |
|||
|
|||
<style> |
|||
#app { |
|||
width: 100%; |
|||
height: 100%; |
|||
} |
|||
</style> |
@ -1,6 +0,0 @@ |
|||
/*** |
|||
*配置接口 格式 module:Array<resource> |
|||
*/ |
|||
export const apiModule = { |
|||
parking: ['User', 'CurrentUser', 'Organizational'], |
|||
}; |
@ -1,20 +0,0 @@ |
|||
import { http } from '/nerv-lib/saas'; |
|||
|
|||
enum Api { |
|||
// USER_LOGIN = '/api/community/objs/Login', //用户登录
|
|||
// USER_INFO = '/api/community/community/objs/CurrentUser', //获取用户信息
|
|||
|
|||
USER_LOGIN = 'api/web/objs/Login', //用户登录
|
|||
USER_INFO = 'api/web/objs/CurrentUser', //获取用户信息
|
|||
USER_RESOURCE = '/api/community/objs/User/Resource', //获取用户资源
|
|||
} |
|||
export const userLogin = (data: RoomListModel) => http.post(Api.USER_LOGIN, data); |
|||
export const userInfo = () => http.get(Api.USER_INFO); |
|||
export const userResource = () => http.get(Api.USER_RESOURCE); |
|||
/** |
|||
* @description 用户登录 |
|||
* @property `[fatherRegionUuid]` 父级区域唯一标识 |
|||
*/ |
|||
interface RoomListModel { |
|||
data: string; |
|||
} |
@ -1,26 +0,0 @@ |
|||
/** @format */ |
|||
import headerConfig from './transform'; |
|||
// console.log(headerConfig);
|
|||
|
|||
export const appConfig = { |
|||
projectType: 'web', |
|||
baseApi: '/api', |
|||
// enablePermissions: true,
|
|||
timeout: 60 * 1000, |
|||
customLogin: () => import('/@/view/login.vue'), |
|||
userLoginApi: 'api/content/objs/Login', |
|||
userResourceApi: '/api/community/objs/User/Resource', |
|||
userInfoApi: 'api/content/objs/CurrentUser', |
|||
headers: Object.assign( |
|||
{ |
|||
site: 'brainMobile', |
|||
}, |
|||
headerConfig, |
|||
), |
|||
// 修改密码配置
|
|||
updatePassWordInfo: { |
|||
title: '修改密码', |
|||
subtitle: '移动端应用管理', |
|||
api: '/api/content/objs/User/changePassword', |
|||
}, |
|||
}; |
@ -1,2 +0,0 @@ |
|||
import { appConfig } from '/@/config/app.config'; |
|||
export { appConfig }; |
@ -1,26 +0,0 @@ |
|||
/** @format */ |
|||
import Cookies from 'js-cookie'; |
|||
|
|||
const transformParams = () => { |
|||
const HEADER_CONFIG = window.location.search.substring(1); |
|||
if (!HEADER_CONFIG) return null; |
|||
const KEY_VALUE = HEADER_CONFIG.split('&'); |
|||
return KEY_VALUE.reduce((memo: any, cur) => { |
|||
const keyvalue = cur.split('='); |
|||
memo[keyvalue[0]] = keyvalue[1]; |
|||
return memo; |
|||
}, {}); |
|||
}; |
|||
|
|||
const headers = transformParams(); |
|||
let headerConfig = {}; |
|||
if (headers) { |
|||
Object.keys(headers).map((key) => { |
|||
Cookies.set(key, headers[key]); |
|||
}); |
|||
headerConfig = Object.assign({}, headers); |
|||
} else { |
|||
headerConfig['qsToken'] = Cookies.get('qsToken'); |
|||
} |
|||
|
|||
export default headerConfig; |
@ -1,22 +0,0 @@ |
|||
export enum ResultEnum { |
|||
SUCCESS = 0, |
|||
ERROR = 1, |
|||
TIMEOUT = 401, |
|||
TOKEN_INVALID = 403, |
|||
} |
|||
|
|||
export enum RequestEnum { |
|||
GET = 'GET', |
|||
POST = 'POST', |
|||
PUT = 'PUT', |
|||
DELETE = 'DELETE', |
|||
} |
|||
|
|||
export enum ContentTypeEnum { |
|||
// json
|
|||
JSON = 'application/json;charset=UTF-8', |
|||
// form-data qs
|
|||
FORM_URLENCODED = 'application/x-www-form-urlencoded;charset=UTF-8', |
|||
// form-data upload
|
|||
FORM_DATA = 'multipart/form-data;charset=UTF-8', |
|||
} |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 971 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 714 B |
Before Width: | Height: | Size: 8.3 KiB |
@ -1,13 +0,0 @@ |
|||
import { createApp } from 'vue'; |
|||
import App from '/@/App.vue'; |
|||
import { saasInit } from '/nerv-lib/saas'; |
|||
import { apiModule } from '/@/api'; |
|||
import { appConfig } from '/@/config'; |
|||
|
|||
const app = createApp(App); |
|||
saasInit({ |
|||
app, |
|||
apiModule, |
|||
appConfig, |
|||
}); |
|||
app.mount('#app'); |
@ -1,510 +0,0 @@ |
|||
/** @format */ |
|||
|
|||
import Cookies from 'js-cookie'; |
|||
import headerConfig from '/@/config/transform'; |
|||
|
|||
console.log(headerConfig); |
|||
|
|||
const Base = () => import('/nerv-lib/saas/view/system/layout/content.vue'); |
|||
|
|||
const contentManage = { |
|||
path: '/contentManage', |
|||
name: 'contentManage', |
|||
meta: { title: '', icon: '', index: 1 }, |
|||
redirect: { name: 'Content' }, |
|||
children: [ |
|||
{ |
|||
path: 'content', |
|||
name: 'Content', |
|||
meta: { title: '内容管理', icon: 'neirongguanli' }, |
|||
component: Base, |
|||
redirect: { name: 'Announcements' }, |
|||
children: [ |
|||
{ |
|||
path: 'announcements', |
|||
name: 'Announcements', |
|||
meta: { title: '通知公告管理', hideChildren: true }, |
|||
component: Base, |
|||
redirect: { name: 'AnnouncementsIndex' }, |
|||
children: [ |
|||
{ |
|||
path: 'index', |
|||
name: 'AnnouncementsIndex', |
|||
component: () => import('/@/view/contentManage/announcements/index.vue'), |
|||
meta: { |
|||
title: '通知公告管理', |
|||
keepAlive: true, |
|||
backApi: [], |
|||
}, |
|||
}, |
|||
{ |
|||
path: 'detail', |
|||
name: 'AnnouncementsDetail', |
|||
component: () => import('/@/view/contentManage/announcements/detail.vue'), |
|||
meta: { |
|||
type: 'op', |
|||
title: '查看', |
|||
backApi: [], |
|||
}, |
|||
}, |
|||
{ |
|||
path: 'add', |
|||
name: 'AnnouncementsAdd', |
|||
component: () => import('/@/view/contentManage/announcements/add.vue'), |
|||
meta: { |
|||
type: 'op', |
|||
title: '新增', |
|||
backApi: [], |
|||
}, |
|||
}, |
|||
{ |
|||
path: 'edit', |
|||
name: 'AnnouncementsEdit', |
|||
component: () => import('/@/view/contentManage/announcements/add.vue'), |
|||
meta: { |
|||
type: 'op', |
|||
title: '编辑', |
|||
backApi: [], |
|||
}, |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
path: 'news', |
|||
name: 'News', |
|||
meta: { title: '新闻管理', hideChildren: true }, |
|||
component: Base, |
|||
redirect: { name: 'NewsIndex' }, |
|||
children: [ |
|||
{ |
|||
path: 'index', |
|||
name: 'NewsIndex', |
|||
component: () => import('/@/view/contentManage/news/index.vue'), |
|||
meta: { |
|||
title: '通知公告管理', |
|||
keepAlive: true, |
|||
backApi: [], |
|||
}, |
|||
}, |
|||
{ |
|||
path: 'detail', |
|||
name: 'NewsDetail', |
|||
component: () => import('/@/view/contentManage/news/detail.vue'), |
|||
meta: { |
|||
type: 'op', |
|||
title: '查看', |
|||
backApi: [], |
|||
}, |
|||
}, |
|||
{ |
|||
path: 'add', |
|||
name: 'NewsAdd', |
|||
component: () => import('/@/view/contentManage/news/add.vue'), |
|||
meta: { |
|||
type: 'op', |
|||
title: '新增', |
|||
backApi: [], |
|||
}, |
|||
}, |
|||
{ |
|||
path: 'edit', |
|||
name: 'NewsEdit', |
|||
component: () => import('/@/view/contentManage/news/add.vue'), |
|||
meta: { |
|||
type: 'op', |
|||
title: '编辑', |
|||
backApi: [], |
|||
}, |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
path: 'article', |
|||
name: 'Article', |
|||
meta: { title: '文章管理', hideChildren: true }, |
|||
component: Base, |
|||
redirect: { name: 'ArticleIndex' }, |
|||
children: [ |
|||
{ |
|||
path: 'index', |
|||
name: 'ArticleIndex', |
|||
component: () => import('/@/view/contentManage/article/index.vue'), |
|||
meta: { |
|||
title: '文章管理', |
|||
keepAlive: true, |
|||
backApi: [], |
|||
}, |
|||
}, |
|||
{ |
|||
path: 'detail', |
|||
name: 'ArticleDetail', |
|||
component: () => import('/@/view/contentManage/article/detail.vue'), |
|||
meta: { |
|||
type: 'op', |
|||
title: '查看', |
|||
backApi: [], |
|||
}, |
|||
}, |
|||
{ |
|||
path: 'add', |
|||
name: 'ArticleAdd', |
|||
component: () => import('/@/view/contentManage/article/add.vue'), |
|||
meta: { |
|||
type: 'op', |
|||
title: '新增', |
|||
backApi: [], |
|||
}, |
|||
}, |
|||
{ |
|||
path: 'edit', |
|||
name: 'ArticleEdit', |
|||
component: () => import('/@/view/contentManage/article/add.vue'), |
|||
meta: { |
|||
type: 'op', |
|||
title: '编辑', |
|||
backApi: [], |
|||
}, |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
path: 'audit', |
|||
name: 'Audit', |
|||
meta: { title: '审核管理', hideChildren: true }, |
|||
component: Base, |
|||
redirect: { name: 'AuditIndex' }, |
|||
children: [ |
|||
{ |
|||
path: 'index', |
|||
name: 'AuditIndex', |
|||
component: () => import('/@/view/contentManage/audit/index.vue'), |
|||
meta: { |
|||
title: '审核管理', |
|||
keepAlive: true, |
|||
backApi: [], |
|||
}, |
|||
}, |
|||
{ |
|||
path: 'detail', |
|||
name: 'AuditDetail', |
|||
component: () => import('/@/view/contentManage/audit/detail.vue'), |
|||
meta: { |
|||
type: 'op', |
|||
title: '查看', |
|||
backApi: [], |
|||
}, |
|||
}, |
|||
{ |
|||
path: 'audit', |
|||
name: 'AuditAction', |
|||
component: () => import('/@/view/contentManage/audit/audit.vue'), |
|||
meta: { |
|||
type: 'op', |
|||
title: '审核', |
|||
backApi: [], |
|||
}, |
|||
}, |
|||
], |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
path: 'systemManage', |
|||
name: 'SystemManage', |
|||
meta: { title: '系统管理', icon: 'xitongguanli' }, |
|||
component: Base, |
|||
redirect: { name: 'SystemManage' }, |
|||
children: [ |
|||
{ |
|||
path: 'bannerManage', |
|||
name: 'BannerManage', |
|||
meta: { title: '渠道banner管理', hideChildren: true }, |
|||
component: Base, |
|||
redirect: { name: 'BannerManageIndex' }, |
|||
children: [ |
|||
{ |
|||
path: 'index', |
|||
name: 'BannerManageIndex', |
|||
component: () => import('/@/view/systemManage/bannerManage/index.vue'), |
|||
meta: { |
|||
title: '渠道banner管理', |
|||
keepAlive: true, |
|||
backApi: [], |
|||
}, |
|||
}, |
|||
{ |
|||
path: 'detail', |
|||
name: 'BannerManageDetail', |
|||
component: () => import('/@/view/systemManage/bannerManage/detail.vue'), |
|||
meta: { |
|||
type: 'op', |
|||
title: '查看', |
|||
backApi: [], |
|||
}, |
|||
}, |
|||
{ |
|||
path: 'detailCheck', |
|||
name: 'BannerManageDetailCheck', |
|||
component: () => import('/@/view/systemManage/bannerManage/detail.vue'), |
|||
meta: { |
|||
type: 'op', |
|||
title: '审批', |
|||
backApi: [], |
|||
}, |
|||
}, |
|||
{ |
|||
path: 'add', |
|||
name: 'BannerManageAdd', |
|||
component: () => import('/@/view/systemManage/bannerManage/add.vue'), |
|||
meta: { |
|||
type: 'op', |
|||
title: '新增', |
|||
backApi: [], |
|||
}, |
|||
}, |
|||
{ |
|||
path: 'edit', |
|||
name: 'BannerManageEdit', |
|||
component: () => import('/@/view/systemManage/bannerManage/add.vue'), |
|||
meta: { |
|||
type: 'op', |
|||
title: '编辑', |
|||
backApi: [], |
|||
}, |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
path: 'openScreenManage', |
|||
name: 'OpenScreenManage', |
|||
component: Base, |
|||
redirect: { name: 'OpenScreenManageIndex' }, |
|||
meta: { title: '开屏广告管理', hideChildren: true, type: 'menus' }, |
|||
children: [ |
|||
{ |
|||
path: 'index', |
|||
name: 'OpenScreenManageIndex', |
|||
component: () => import('/@/view/systemManage/openScreenManage/index.vue'), |
|||
meta: { |
|||
type: 'menus', |
|||
operates: [ |
|||
{ |
|||
title: '失效', |
|||
code: 'OpenScreenManageInvalidation', |
|||
backApi: [ |
|||
{ |
|||
method: 'POST', |
|||
url: '/api/objs/admin/AdvertisingMarketing/invalidationOpenScreen', |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
title: '删除', |
|||
code: 'OpenScreenManageRemove', |
|||
backApi: [ |
|||
{ |
|||
method: 'POST', |
|||
url: '/api/objs/admin/AdvertisingMarketing/deleteOpenScreen', |
|||
}, |
|||
], |
|||
}, |
|||
], |
|||
title: '开屏广告管理', |
|||
keepAlive: true, |
|||
backApi: [ |
|||
{ |
|||
method: 'GET', |
|||
url: '/api/objs/admin/AdvertisingMarketing/openScreenList', |
|||
}, |
|||
], |
|||
}, |
|||
}, |
|||
{ |
|||
path: 'add', |
|||
name: 'OpenScreenManageAdd', |
|||
component: () => import('/@/view/systemManage/openScreenManage/add.vue'), |
|||
meta: { |
|||
type: 'op', |
|||
title: '新增', |
|||
backApi: [ |
|||
{ |
|||
method: 'POST', |
|||
url: '/api/objs/admin/AdvertisingMarketing/releasePoppup', |
|||
}, |
|||
{ |
|||
method: 'POST', |
|||
url: '/api/objs/admin/AdvertisingMarketing/savePoppup', |
|||
}, |
|||
{ |
|||
method: 'GET', |
|||
url: '/api/objs/admin/AdvertisingMarketing/popupDetail', |
|||
}, |
|||
{ |
|||
method: 'POST', |
|||
url: '/api/objs/admin/FileUpload', |
|||
}, |
|||
{ |
|||
method: 'GET', |
|||
url: '/api/objs/admin/ParkPic', |
|||
}, |
|||
], |
|||
}, |
|||
}, |
|||
{ |
|||
path: 'edit', |
|||
name: 'OpenScreenManageEdit', |
|||
component: () => import('/@/view/systemManage/openScreenManage/add.vue'), |
|||
meta: { |
|||
type: 'op', |
|||
title: '编辑', |
|||
backApi: [ |
|||
{ |
|||
method: 'POST', |
|||
url: '/api/objs/admin/AdvertisingMarketing/releasePoppup', |
|||
}, |
|||
{ |
|||
method: 'POST', |
|||
url: '/api/objs/admin/AdvertisingMarketing/savePoppup', |
|||
}, |
|||
{ |
|||
method: 'GET', |
|||
url: '/api/objs/admin/AdvertisingMarketing/popupDetail', |
|||
}, |
|||
{ |
|||
method: 'POST', |
|||
url: '/api/objs/admin/FileUpload', |
|||
}, |
|||
{ |
|||
method: 'GET', |
|||
url: '/api/objs/admin/ParkPic', |
|||
}, |
|||
], |
|||
}, |
|||
}, |
|||
{ |
|||
path: 'detail', |
|||
name: 'OpenScreenManageDetail', |
|||
component: () => import('/@/view/systemManage/openScreenManage/detail.vue'), |
|||
meta: { |
|||
type: 'op', |
|||
title: '查看', |
|||
backApi: [ |
|||
{ |
|||
method: 'GET', |
|||
url: '/api/objs/admin/AdvertisingMarketing/popupDetail', |
|||
}, |
|||
{ |
|||
method: 'GET', |
|||
url: '/api/objs/admin/ParkPic', |
|||
}, |
|||
], |
|||
}, |
|||
}, |
|||
{ |
|||
path: 'detailCheck', |
|||
name: 'OpenScreenManageDetailCheck', |
|||
component: () => import('/@/view/systemManage/openScreenManage/detail.vue'), |
|||
meta: { |
|||
type: 'op', |
|||
title: '审核', |
|||
backApi: [ |
|||
{ |
|||
method: 'GET', |
|||
url: '/api/objs/admin/AdvertisingMarketing/popupDetail', |
|||
}, |
|||
{ |
|||
method: 'GET', |
|||
url: '/api/objs/admin/ParkPic', |
|||
}, |
|||
], |
|||
}, |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
path: 'appVersionManage', |
|||
name: 'AppVersionManage', |
|||
meta: { title: 'APP版本管理', hideChildren: true }, |
|||
component: Base, |
|||
redirect: { name: 'AppVersionManageIndex' }, |
|||
children: [ |
|||
{ |
|||
path: 'index', |
|||
name: 'AppVersionManageIndex', |
|||
component: () => import('/@/view/systemManage/appVersionManage/index.vue'), |
|||
meta: { |
|||
title: 'APP版本管理', |
|||
keepAlive: true, |
|||
backApi: [], |
|||
}, |
|||
}, |
|||
{ |
|||
path: 'detail', |
|||
name: 'AppVersionManageDetail', |
|||
component: () => import('/@/view/systemManage/appVersionManage/detail.vue'), |
|||
meta: { |
|||
type: 'op', |
|||
title: '查看', |
|||
backApi: [], |
|||
}, |
|||
}, |
|||
{ |
|||
path: 'add', |
|||
name: 'AppVersionManageAdd', |
|||
component: () => import('/@/view/systemManage/appVersionManage/add.vue'), |
|||
meta: { |
|||
type: 'op', |
|||
title: '新增', |
|||
backApi: [], |
|||
}, |
|||
}, |
|||
{ |
|||
path: 'edit', |
|||
name: 'AppVersionManageEdit', |
|||
component: () => import('/@/view/systemManage/appVersionManage/add.vue'), |
|||
meta: { |
|||
type: 'op', |
|||
title: '编辑', |
|||
backApi: [], |
|||
}, |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
path: 'logManage', |
|||
name: 'LogManage', |
|||
meta: { title: '日志管理', hideChildren: true }, |
|||
component: Base, |
|||
redirect: { name: 'LogManageIndex' }, |
|||
children: [ |
|||
{ |
|||
path: 'index', |
|||
name: 'LogManageIndex', |
|||
component: () => import('/@/view/systemManage/logManage/index.vue'), |
|||
meta: { |
|||
title: '日志管理', |
|||
keepAlive: true, |
|||
backApi: [], |
|||
}, |
|||
}, |
|||
], |
|||
}, |
|||
], |
|||
}, |
|||
], |
|||
}; |
|||
|
|||
function removeByName(name: string) { |
|||
const index = contentManage.children[1].children.reduce((pre, item, index) => { |
|||
if (item.name == name) pre = index; |
|||
return pre; |
|||
}, 0); |
|||
contentManage.children[1].children.splice(index, 1); |
|||
} |
|||
if (Cookies.get('type') == 'pc') { |
|||
removeByName('AppVersionManage'); |
|||
} |
|||
if (Cookies.get('type') != 'mobile') { |
|||
removeByName('OpenScreenManage'); |
|||
} |
|||
export default contentManage; |
@ -1,11 +0,0 @@ |
|||
/** @format */ |
|||
|
|||
// const RootRoute = {
|
|||
// path: '/',
|
|||
// name: 'root',
|
|||
// redirect: { name: 'AnnouncementsIndex' },
|
|||
// meta: {
|
|||
// title: 'Root',
|
|||
// },
|
|||
// };
|
|||
// export default RootRoute;
|
@ -1,8 +0,0 @@ |
|||
/** @format */ |
|||
|
|||
const RootRoute = { |
|||
path: '/root', |
|||
name: 'root', |
|||
redirect: { name: 'AnnouncementsIndex' }, |
|||
}; |
|||
export default RootRoute; |
@ -1,12 +0,0 @@ |
|||
import { defineStore } from 'pinia'; |
|||
|
|||
export const items = defineStore({ |
|||
id: 'items', |
|||
state() { |
|||
return { list: [], count: 10 }; |
|||
}, |
|||
getters: { |
|||
double: (state: any) => state.count * 2, |
|||
}, |
|||
actions: {}, |
|||
}); |
@ -1,53 +0,0 @@ |
|||
@font-face { |
|||
font-family: 'QuartzMS'; |
|||
src: url('/asset/font/QuartzMS.TTF') format('truetype'); |
|||
} |
|||
|
|||
//侧边导航 |
|||
.ant-menu:not(.ant-menu-horizontal) .ant-menu-item-selected { |
|||
background: #e5f7f9 !important; |
|||
} |
|||
|
|||
.ant-menu.ant-menu-dark .ant-menu-item-selected { |
|||
color: #fff; |
|||
background: rgba(45, 120, 238, 1) !important; |
|||
} |
|||
|
|||
.ant-menu-dark.ant-menu-horizontal>.ant-menu-item:hover { |
|||
background-color: rgba(45, 120, 238, 1) !important; |
|||
cursor: default; |
|||
} |
|||
|
|||
.ant-menu-inline .ant-menu-item, |
|||
.ant-menu-inline .ant-menu-submenu-title { |
|||
width: 100% !important; |
|||
} |
|||
|
|||
.ns-basic-table .ant-btn:hover { |
|||
border-color: transparent !important; |
|||
} |
|||
|
|||
.ns-basic-table .ant-btn-link:hover { |
|||
background: none !important; |
|||
} |
|||
|
|||
// .ns-detail { |
|||
// padding: 0px 24px 10px 24px !important; |
|||
// } |
|||
|
|||
.ant-tabs-nav-wrap { |
|||
padding: 0 24px; // 列表tab边距 |
|||
} |
|||
|
|||
.ant-tabs-nav { |
|||
margin: 0 !important; // 列表tab下边距 |
|||
} |
|||
|
|||
.ant-input-number { |
|||
width: 100%; //inputNumber组件宽度 |
|||
} |
|||
|
|||
// 富文本组件层级 |
|||
.ns-richText-ZIndex { |
|||
z-index: 1; |
|||
} |
@ -1,2 +0,0 @@ |
|||
@import "variable"; |
|||
@import "global"; |
@ -1,42 +0,0 @@ |
|||
// @import "./global-antd.less"; |
|||
|
|||
@primary-color: rgba(45, 120, 238, 1); // 全局主色 |
|||
// @link-color: #43BB79; // 链接色 |
|||
@layout-header-hover: rgba(45, 120, 238, .7); //hover |
|||
// @text-color: #323232; // 主文本色 |
|||
|
|||
|
|||
@layout-header-background: rgba(45, 120, 238, 1); // 头部背景色 |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
//btn |
|||
// @btn-height-base: 30px; |
|||
// @btn-height-lg: 30px; |
|||
// @btn-disable-bg: #dfe3e9; //禁用按钮background |
|||
// @btn-disable-border: 1px solid #ced0da; |
|||
|
|||
// @btn-link-hover-bg: #37ABC4; |
|||
// @btn-text-hover-bg: #46ebdb; |
|||
|
|||
|
|||
// //input |
|||
// @input-height-base: 30px; |
|||
|
|||
|
|||
// //form |
|||
// @label-color: #52616f; //form-lable颜色 |
|||
|
|||
|
|||
// @form-item-margin-bottom: 16px; |
|||
|
|||
// //menu |
|||
|
|||
|
|||
//spin |
|||
|
|||
|
|||
// @border-width-base: 1px; |
|||
// @border-style-base: solid; |
@ -1,65 +0,0 @@ |
|||
// $primary-color: #37ABC4; // 全局主色 |
|||
// $link-color: #37ABC4; // 链接色 |
|||
// $success-color: #17BE6B; // 成功色 |
|||
// $warning-color: #FF9901; // 警告色 |
|||
// $error-color: #FF1744; // 错误色 |
|||
// $font-size-base: 14px; // 主字号 |
|||
// $font-size-lg:14px; |
|||
// $font-size-lg:14px; |
|||
// $heading-font-size-lg:16px;//标题字号 |
|||
// $heading-font-weight:600;//标题加粗 |
|||
// $font-line-height:22px;//文字行高 |
|||
// $heading-font-line-height:24px;//标题文字行高 |
|||
// $heading-color: rgba(0, 0, 0, 0.85); // 标题色 |
|||
// $text-color: #323232; // 主文本色 |
|||
// $text-color-secondary: rgba(0, 0, 0, 0.45); // 次文本色 |
|||
// $disabled-color: #BFBFBF; // 失效色 |
|||
// $border-radius-base: 2px; // 组件/浮层圆角 |
|||
// $border-color-base: #dcdfe2; // 边框色 |
|||
// $box-shadow-base: 0 2px 8px rgba(0, 0, 0, 0.15); // 浮层阴影 |
|||
// $layout-body-background: #f0f2f5; //框架背景色 |
|||
// $layout-header-background:#37ABC4; // 头部背景色 |
|||
|
|||
// $layout-sider-width:208px; //侧边导航宽度 |
|||
// $layout-sider-arrow-color:#808d96;//侧边导航箭头颜色 |
|||
// $border-style-base:solid; |
|||
// $layout-header-height:48px;//头部高度 |
|||
// $line-height-base:22px; |
|||
|
|||
// //btn |
|||
// $btn-height-base:30px; |
|||
// $btn-height-lg: 30px; |
|||
// $btn-disable-color: #9b9b9b;//禁用按钮color |
|||
// $btn-disable-bg: #dfe3e9;//禁用按钮background |
|||
// $btn-disable-border: 1px solid #ced0da; |
|||
// $btn-border-radius-base: $border-radius-base;//圆角边框 |
|||
// $btn-border-width: 1px; |
|||
// $btn-border-style: $border-style-base; |
|||
// $btn-link-hover-bg: #37ABC4; |
|||
// $btn-text-hover-bg: #46ebdb; |
|||
// $btn-font-size-lg: $font-size-lg; |
|||
|
|||
// //input |
|||
// $input-height-base: 30px; |
|||
// $input-hover-focus-border-color:#a5a5b5; |
|||
// // @input-hover-border-color: rgba(0,0,0,.85);//鼠标滑过input边框 |
|||
|
|||
// //form |
|||
// $label-color:#52616f; |
|||
// $form-vertical-label-padding: 0; |
|||
// $form-vertical-label-margin: 0,0,16,0px; |
|||
// $form-item-label-height:$input-height-base; |
|||
// $form-item-margin-bottom: 16px; |
|||
|
|||
// //menu |
|||
// $menu-item-height: 48px; |
|||
// $menu-item-active-bg: none; |
|||
// $menu-item-boundary-margin: 0px; |
|||
|
|||
// //spin |
|||
// $spin-dot-size-sm: 14px; |
|||
// $spin-dot-size: 20px; |
|||
// $spin-dot-size-lg: 32px; |
|||
|
|||
// $border-width-base: 1px; |
|||
// $border-style-base: solid; |
@ -1 +0,0 @@ |
|||
declare module '*.vue'; |
@ -1,70 +0,0 @@ |
|||
<!-- @format --> |
|||
|
|||
<template> |
|||
<div ref="FCKEditor"> </div> |
|||
</template> |
|||
<script> |
|||
import { defineComponent, ref, inject } from 'vue'; |
|||
import Editor from 'wangeditor'; |
|||
export default defineComponent({ |
|||
name: 'FCKEditor', |
|||
props: { |
|||
htmlInfo: { |
|||
type: String, |
|||
default: '', |
|||
}, |
|||
}, |
|||
emits: ['change'], |
|||
setup() { |
|||
const editor = ref({}); |
|||
const content = ref(''); |
|||
const components = inject('components'); |
|||
return { |
|||
editor, |
|||
content, |
|||
components, |
|||
}; |
|||
}, |
|||
watch: { |
|||
htmlInfo: { |
|||
handler(val) { |
|||
console.log(123); |
|||
setTimeout(() => { |
|||
this.editor.cmd.do('insertHTML', val); |
|||
}, 10); |
|||
}, |
|||
}, |
|||
}, |
|||
mounted() { |
|||
this.initAre(this.htmlInfo); |
|||
}, |
|||
methods: { |
|||
initAre(val) { |
|||
// eslint-disable-next-line @typescript-eslint/no-this-alias |
|||
let that = this; |
|||
this.editor = new Editor(this.$refs.FCKEditor); |
|||
this.editor.config.uploadImgShowBase64 = true; |
|||
// this.editor.config.uploadImgServer = '/api/pension/pension/objs/FileUpload'; // |
|||
// this.editor.config.uploadFileName = 'file'; |
|||
// this.editor.config.uploadImgParams = { |
|||
// uploadType: '1', |
|||
// }; |
|||
this.editor.config.withCredentials = true; |
|||
//this.editor.config.uploadImgMaxSize = 5 * 1024 * 1024; //限制图片大小 2M |
|||
this.editor.config.onchange = function (html) { |
|||
// 第二步,监控变化,同步更新到 textarea |
|||
console.log(Object.prototype.toString.call(html)); |
|||
that.$emit('change', html); |
|||
}; |
|||
this.editor.create(); |
|||
if (val) { |
|||
this.editor.cmd.do('insertHTML', val); |
|||
} |
|||
}, |
|||
getInfo() { |
|||
console.log(this.editor.txt.html()); |
|||
}, |
|||
}, |
|||
}); |
|||
</script> |
|||
<style lang="less" scoped></style> |
@ -1,153 +0,0 @@ |
|||
<!-- @format --> |
|||
|
|||
<template> |
|||
<ns-view-add-form |
|||
ref="nsAddFormRef" |
|||
:schemas="formSchema" |
|||
:model="data" |
|||
:title="uuid ? '编辑公告' : '新增公告'" |
|||
:headActions="headActions" |
|||
:api="formApi" /> |
|||
</template> |
|||
<script lang="ts"> |
|||
import { defineComponent, reactive, ref, provide, computed } from 'vue'; |
|||
import { useRouter } from 'vue-router'; |
|||
import FCKEditor from '/@/view/components/FCKEditor.vue'; |
|||
import { http } from '/nerv-lib/util/http'; |
|||
|
|||
export default defineComponent({ |
|||
name: 'AnnouncementsAdd', |
|||
setup() { |
|||
const router = useRouter(); |
|||
const { uuid } = router.currentRoute.value.query; |
|||
const nsAddFormRef = ref(); |
|||
const htmlInfo = ref(''); |
|||
const formApi = ref( |
|||
uuid |
|||
? '/api/content/objs/admin/cms/bg/article/update' |
|||
: '/api/content/objs/admin/cms/bg/article/add', |
|||
); |
|||
const data = ref({ |
|||
articleCommonHandleForm: { folderCode: 'mobileNoticeManager', content: '', title: '' }, |
|||
}); |
|||
provide('components', () => { |
|||
return { FCKEditor }; |
|||
}); |
|||
if (uuid) { |
|||
http.get('/api/content/objs/admin/cms/bg/article/detail', { uuid }).then((res) => { |
|||
console.log(res); |
|||
data.value = res.data.articleCommonVO; |
|||
data.value.articleCommonHandleForm = { |
|||
folderCode: 'mobileNoticeManager', |
|||
folderName: '通知公告', |
|||
sort: 0, |
|||
title: res.data.articleCommonVO.title, |
|||
content: res.data.articleCommonVO.content, |
|||
}; |
|||
data.value.folderCode = 'mobileNoticeManager'; |
|||
|
|||
// 编辑->未上架 |
|||
data.value.isPublish = 0; |
|||
htmlInfo.value = res.data.articleCommonVO.content || ''; |
|||
}); |
|||
} |
|||
const dataHandle = (data) => { |
|||
const newData = data; |
|||
newData['articleCommonHandleForm'] = data; |
|||
return newData; |
|||
}; |
|||
const validateResult = computed(() => { |
|||
return !nsAddFormRef.value?.validateResult; |
|||
}); |
|||
const headActions = ref({ |
|||
actions: [ |
|||
{ |
|||
label: '发布', |
|||
name: 'AnnouncementsDetail', |
|||
dynamicDisabled: validateResult, |
|||
handle: (record, name) => { |
|||
// formApi.value = uuid |
|||
// ? '/api/content/objs/admin/cms/bg/article/publish' |
|||
// : '/api/content/objs/admin/cms/bg/article/add'; |
|||
data.value.isPublish = 1; |
|||
nsAddFormRef.value?.submit(); |
|||
}, |
|||
}, |
|||
], |
|||
}); |
|||
|
|||
const formSchema = ref([ |
|||
{ |
|||
field: 'folderCode', |
|||
defaultValue: 'mobileNoticeManager', |
|||
}, |
|||
{ |
|||
field: 'articleCommonHandleForm', |
|||
defaultValue: { folderCode: 'mobileNoticeManager', folderName: '通知公告', sort: 0 }, |
|||
}, |
|||
{ |
|||
field: 'uuid', |
|||
defaultValue: uuid, |
|||
}, |
|||
{ |
|||
field: 'isPublish', |
|||
defaultValue: 0, |
|||
}, |
|||
{ |
|||
field: 'title', |
|||
label: '公告主题', |
|||
component: 'NsInput', |
|||
|
|||
componentProps: { |
|||
placeholder: '请输入', |
|||
// 禁止输入 |
|||
// disabled: true, |
|||
onChange: (e) => { |
|||
data.value.articleCommonHandleForm['title'] = e.target.value; |
|||
}, |
|||
}, |
|||
rules: [ |
|||
{ |
|||
pattern: /^((?!\\|\/|:|\*|\?|<|>|\||'|%|@|#|&|\$|\^|&|\*).){1,100}$/, |
|||
message: '可输入1~100个字符,不能包含‘ / ; : * ?” < > ` 这些特殊符号', |
|||
trigger: 'blur', |
|||
}, |
|||
{ |
|||
required: true, |
|||
message: '请输入公告主题', |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
field: 'content', |
|||
component: 'FCKEditor', |
|||
class: 'ns-form-item-full ns-form-item-padding ns-richText-ZIndex', |
|||
label: '公告内容', |
|||
componentProps: { |
|||
htmlInfo: htmlInfo, |
|||
onChange: (a) => { |
|||
data.value.articleCommonHandleForm['content'] = a; |
|||
}, |
|||
}, |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: '内容不能为空', |
|||
trigger: 'blur', |
|||
}, |
|||
], |
|||
}, |
|||
]); |
|||
|
|||
return { |
|||
formSchema, |
|||
data, |
|||
headActions, |
|||
nsAddFormRef, |
|||
dataHandle, |
|||
uuid, |
|||
formApi, |
|||
}; |
|||
}, |
|||
}); |
|||
</script> |
@ -1,53 +0,0 @@ |
|||
<!-- @format --> |
|||
|
|||
<template> |
|||
<div> |
|||
<ns-view-detail api="/api/content/objs/admin/cms/bg/article/detail" :detail="detail"> |
|||
<template #content="data"> |
|||
<span v-html="data.value"></span> |
|||
</template> |
|||
</ns-view-detail> |
|||
</div> |
|||
</template> |
|||
<script lang="ts"> |
|||
import { defineComponent, reactive, ref } from 'vue'; |
|||
import { useRouter } from 'vue-router'; |
|||
// import customerDetail from '../monthly/components/customerDetail.vue'; |
|||
import { dateUtil } from '/nerv-lib/saas'; |
|||
export default defineComponent({ |
|||
name: 'AnnouncementsDetail', |
|||
// components: { customerDetail }, |
|||
setup() { |
|||
const rouer = useRouter(); |
|||
const detail = reactive([ |
|||
{ |
|||
title: '公告主题:', |
|||
items: [ |
|||
{ |
|||
label: '', |
|||
name: 'pushTime', |
|||
format: (value, record) => { |
|||
return record.articleCommonVO.title; |
|||
}, |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
title: '公告内容:', |
|||
items: [ |
|||
{ |
|||
label: '', |
|||
type: 'html', |
|||
name: 'content', |
|||
style: { padding: 0 }, |
|||
format: (value, record) => { |
|||
return record.articleCommonVO.content; |
|||
}, |
|||
}, |
|||
], |
|||
}, |
|||
]); |
|||
return { detail }; |
|||
}, |
|||
}); |
|||
</script> |
@ -1,258 +0,0 @@ |
|||
<!-- @format --> |
|||
|
|||
<template> |
|||
<ns-view-list-table ref="nsTableRef" v-bind="tableConfig" rowKey="uuid"> |
|||
<template #bodyCell="{ record, column, index }"> |
|||
<template v-if="column.dataIndex == 'content'"> |
|||
<a @click="modalContent(record)">点击预览</a> |
|||
</template> |
|||
</template> |
|||
</ns-view-list-table> |
|||
<ns-modal |
|||
v-model:visible="visible" |
|||
width="520px" |
|||
:destroyOnClose="true" |
|||
title="公告内容" |
|||
:footer="null"> |
|||
<div class="detail-info" v-html="modalInfo"></div> |
|||
</ns-modal> |
|||
</template> |
|||
|
|||
<script lang="ts"> |
|||
import { defineComponent, createVNode, ref } from 'vue'; |
|||
import { dateUtil } from '/nerv-lib/saas'; |
|||
import { useRouter } from 'vue-router'; |
|||
import { Modal } from 'ant-design-vue'; |
|||
import { http } from '/nerv-lib/util/http'; |
|||
import { NsMessage } from '/nerv-lib/component/message'; |
|||
|
|||
export default defineComponent({ |
|||
name: 'AnnouncementsIndex', |
|||
setup() { |
|||
const router = useRouter(); |
|||
const nsTableRef = ref(); |
|||
const modalInfo = ref(''); |
|||
const visible = ref(false); |
|||
const request = (api: string, params: object) => { |
|||
http.post(api, params).then(() => { |
|||
NsMessage.success('操作成功'); |
|||
nsTableRef.value.nsTableRef.reload(); |
|||
}); |
|||
}; |
|||
const tableConfig = { |
|||
title: '公告管理', |
|||
api: { |
|||
method: 'POST', |
|||
url: '/api/content/objs/admin/cms/bg/article/pageList', |
|||
}, |
|||
// api:'/api/web/objs/bulletin/pageList' |
|||
formConfig: { |
|||
schemas: [ |
|||
{ |
|||
field: 'titleLike', |
|||
label: '公告主题', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
placeholder: '请输入', |
|||
}, |
|||
}, |
|||
{ |
|||
field: 'articleStatus', |
|||
label: '状态', |
|||
component: 'NsSelect', |
|||
defaultValue: '', |
|||
componentProps: { |
|||
placeholder: '请选择', |
|||
options: [ |
|||
{ label: '全部', value: '' }, |
|||
{ label: '未上架', value: 1 }, |
|||
{ label: '待审核', value: 2 }, |
|||
{ label: '已上架', value: 3 }, |
|||
{ label: '未通过', value: 6 }, |
|||
], |
|||
}, |
|||
}, |
|||
], |
|||
}, |
|||
params: { |
|||
page: 0, |
|||
pageSize: 10, |
|||
folderCode: 'mobileNoticeManager', |
|||
}, |
|||
headerActions: [ |
|||
{ |
|||
label: '新增公告', |
|||
name: 'AnnouncementsAdd', |
|||
type: 'primary', |
|||
handle: ({}, name) => { |
|||
router.push({ name, query: {} }); |
|||
}, |
|||
}, |
|||
], |
|||
rowSelection: null, |
|||
// transformCellText: ({ record, column }) => { |
|||
// return record.articleCommonVO[column.dataIndex]; |
|||
// }, |
|||
columns: [ |
|||
{ |
|||
title: '公告ID', |
|||
dataIndex: 'articleCode', |
|||
textNumber: 7, |
|||
customRender: ({ record: { articleCommonVO }, column }) => { |
|||
return articleCommonVO[column.dataIndex]; |
|||
}, |
|||
}, |
|||
{ |
|||
title: '公告主题', |
|||
dataIndex: 'extraColMap', |
|||
textNumber: 6, |
|||
textEllipsis: true, |
|||
customRender: ({ record: { articleCommonVO }, column }) => { |
|||
return articleCommonVO['title']; |
|||
}, |
|||
}, |
|||
{ |
|||
title: '公告内容', |
|||
dataIndex: 'content', |
|||
// textEllipsis: true, |
|||
textNumber: 5, |
|||
customRender: ({ record: { articleCommonVO }, column }) => { |
|||
return articleCommonVO[column.dataIndex]; |
|||
}, |
|||
}, |
|||
{ |
|||
title: '上架时间', |
|||
dataIndex: 'publishTime', |
|||
textNumber: 10, |
|||
customRender: ({ record: { articleCommonVO }, column }) => { |
|||
return articleCommonVO[column.dataIndex] || '-'; |
|||
}, |
|||
}, |
|||
{ |
|||
title: '创建时间', |
|||
dataIndex: 'createTime', |
|||
// textNumber: 9, |
|||
customRender: ({ record: { articleCommonVO }, column }) => { |
|||
return articleCommonVO[column.dataIndex]; |
|||
}, |
|||
}, |
|||
{ |
|||
title: '创建人', |
|||
dataIndex: 'createUserName', |
|||
textNumber: 5, |
|||
customRender: ({ record: { articleCommonVO }, column }) => { |
|||
return articleCommonVO[column.dataIndex]; |
|||
}, |
|||
}, |
|||
{ |
|||
title: '状态', |
|||
dataIndex: 'articleStatus', |
|||
textNumber: 5, |
|||
customCell: ({ articleCommonVO: { articleStatus } }) => { |
|||
return { |
|||
style: { color: articleStatus == 3 ? 'green' : articleStatus == 6 ? 'red' : '' }, |
|||
}; |
|||
}, |
|||
customRender: ({ record: { articleCommonVO }, column }) => { |
|||
return ['', '未上架', '待审核', '已上架', '', '', '未通过'][ |
|||
articleCommonVO[column.dataIndex] |
|||
]; |
|||
}, |
|||
}, |
|||
], |
|||
columnActions: { |
|||
title: '操作', |
|||
// width: 100, |
|||
autoMergeAction: false, |
|||
actionNumber: 2, |
|||
actions: [ |
|||
{ |
|||
label: '查看', |
|||
name: 'AnnouncementsDetail', |
|||
ifShow: ({ articleCommonVO: { articleStatus } }) => [2, 3].includes(articleStatus), |
|||
handle: ({ articleCommonVO: { uuid } }, name) => { |
|||
router.push({ name, query: { uuid } }); |
|||
}, |
|||
}, |
|||
{ |
|||
label: '编辑', |
|||
name: 'AnnouncementsEdit', |
|||
ifShow: ({ articleCommonVO: { articleStatus } }) => [1, 6].includes(articleStatus), |
|||
handle: ({ articleCommonVO: { uuid } }, name) => { |
|||
router.push({ name, query: { uuid } }); |
|||
}, |
|||
}, |
|||
{ |
|||
label: '下架', |
|||
name: 'AnnouncementsReaded', |
|||
confirm: true, |
|||
ifShow: ({ articleCommonVO: { articleStatus } }) => [3].includes(articleStatus), |
|||
handle: ({ articleCommonVO: { uuid } }, name) => { |
|||
request('/api/content/objs/admin/cms/bg/article/withdrawn', { uuid }); |
|||
}, |
|||
}, |
|||
{ |
|||
label: '删除', |
|||
name: 'AnnouncementsDelete', |
|||
confirm: true, |
|||
ifShow: ({ articleCommonVO: { articleStatus } }) => [1, 6].includes(articleStatus), |
|||
handle: ({ articleCommonVO: { uuid } }, name) => { |
|||
request('/api/content/objs/admin/cms/bg/article/batchDel', { uuids: [uuid] }); |
|||
}, |
|||
}, |
|||
], |
|||
}, |
|||
}; |
|||
const modalContent = (record) => { |
|||
http |
|||
.get('/api/content/objs/admin/cms/bg/article/detail', { |
|||
uuid: record.articleCommonVO.uuid, |
|||
}) |
|||
.then((res) => { |
|||
modalInfo.value = res.data.articleCommonVO.content; |
|||
visible.value = true; |
|||
}); |
|||
}; |
|||
return { |
|||
tableConfig, |
|||
modalContent, |
|||
nsTableRef, |
|||
visible, |
|||
modalInfo, |
|||
}; |
|||
}, |
|||
}); |
|||
</script> |
|||
<style lang="less" scoped> |
|||
.detail-info { |
|||
:deep(table) { |
|||
border-top: 1px solid #ffffff; |
|||
border-left: 1px solid #ffffff; |
|||
:deep(p) { |
|||
font-size: 12px; |
|||
color: #898e91; |
|||
} |
|||
} |
|||
:deep(th) { |
|||
border-right: 1px solid #ffffff; |
|||
font-size: 13px; |
|||
padding-top: 5px; |
|||
padding-bottom: 5px; |
|||
font-weight: normal; |
|||
background: #eff0f2; |
|||
} |
|||
:deep(td) { |
|||
border-top: 1px solid #ffffff; |
|||
border-right: 1px solid #ffffff; |
|||
padding-top: 5px; |
|||
padding-bottom: 5px; |
|||
font-size: 12px; |
|||
color: #606060; |
|||
text-align: center; |
|||
:deep(text) { |
|||
border-bottom: 1px solid #ffffff; |
|||
} |
|||
background: rgba(240, 242, 245, 0.5); |
|||
} |
|||
} |
|||
</style> |
@ -1,271 +0,0 @@ |
|||
<!-- @format --> |
|||
|
|||
<template> |
|||
<ns-view-add-form |
|||
ref="nsAddFormRef" |
|||
:schemas="formSchema" |
|||
:model="data" |
|||
:title="uuid ? '编辑文章' : '新增文章'" |
|||
:dataHandle="dataHandle" |
|||
:headActions="headActions" |
|||
:api="formApi" /> |
|||
</template> |
|||
<script lang="ts"> |
|||
import { defineComponent, reactive, ref, provide, computed } from 'vue'; |
|||
import { useRouter } from 'vue-router'; |
|||
import FCKEditor from '/@/view/components/FCKEditor.vue'; |
|||
import { http } from '/nerv-lib/util/http'; |
|||
|
|||
export default defineComponent({ |
|||
name: 'NewsAdd', |
|||
setup() { |
|||
provide('components', () => { |
|||
return { FCKEditor }; |
|||
}); |
|||
const router = useRouter(); |
|||
const { uuid } = router.currentRoute.value.query; |
|||
const nsAddFormRef = ref(); |
|||
const htmlInfo = ref(''); |
|||
const imageNetUrl = ref(''); |
|||
let uuidList = ref<any>([]); |
|||
const formApi = ref( |
|||
uuid |
|||
? '/api/content/objs/admin/cms/bg/article/update' |
|||
: '/api/content/objs/admin/cms/bg/article/add', |
|||
); |
|||
|
|||
const data = ref({ |
|||
articleCommonHandleForm: { folderCode: 'mobileArticleManager', content: '', title: '' }, |
|||
}); |
|||
|
|||
if (uuid) { |
|||
http.get('/api/content/objs/admin/cms/bg/article/detail', { uuid }).then((res) => { |
|||
console.log(res); |
|||
data.value = res.data.articleCommonVO; |
|||
data.value.tagUuidList = res.data.tagNameList; |
|||
uuidList.value = res.data.tagUuidList; |
|||
data.value.articleCommonHandleForm = { |
|||
folderCode: 'mobileArticleManager', |
|||
folderName: '文章', |
|||
sort: 0, |
|||
title: res.data.articleCommonVO.title, |
|||
content: res.data.articleCommonVO.content, |
|||
articleSource: res.data.articleCommonVO.articleSource, |
|||
imageNetUrl: res.data.articleCommonVO.imageNetUrl, |
|||
}; |
|||
data.value.folderCode = 'mobileArticleManager'; |
|||
// 编辑->未上架 |
|||
data.value.isPublish = 0; |
|||
imageNetUrl.value = res.data.articleCommonVO.imageNetUrl; |
|||
htmlInfo.value = res.data.articleCommonVO.content || ''; |
|||
}); |
|||
} |
|||
|
|||
const getTagUuid = async (list = []) => { |
|||
const res = await http.get('/api/content/objs/admin/cms/bg/articleTag/allList', { |
|||
folderCode: 'mobileArticleManager', |
|||
}); |
|||
console.log(res); |
|||
|
|||
const arr = []; |
|||
list?.map((cur) => { |
|||
res.data.some((item) => { |
|||
if (item.tagName == cur) { |
|||
arr.push(item.uuid); |
|||
return true; |
|||
} |
|||
}); |
|||
}); |
|||
uuidList.value = arr; |
|||
}; |
|||
const addTag = (tagName, tagNameList) => { |
|||
http |
|||
.post('/api/content/objs/admin/cms/bg/articleTag/add', { |
|||
folderCode: 'mobileArticleManager', |
|||
tagName, |
|||
}) |
|||
.then(() => { |
|||
getTagUuid(tagNameList); |
|||
}); |
|||
}; |
|||
const dataHandle = (data) => { |
|||
const newData = JSON.parse(JSON.stringify(data)); |
|||
newData['articleCommonHandleForm'] = Object.assign( |
|||
newData['articleCommonHandleForm'], |
|||
data, |
|||
); |
|||
newData['tagUuidList'] = uuidList.value; |
|||
return newData; |
|||
}; |
|||
const validateResult = computed(() => { |
|||
return !nsAddFormRef.value?.validateResult; |
|||
}); |
|||
const headActions = ref({ |
|||
actions: [ |
|||
{ |
|||
label: '发布', |
|||
name: 'NewsDetail', |
|||
dynamicDisabled: validateResult, |
|||
handle: (record, name) => { |
|||
// formApi.value = uuid |
|||
// ? '/api/content/objs/admin/cms/bg/article/publish' |
|||
// : '/api/content/objs/admin/cms/bg/article/add'; |
|||
data.value.isPublish = 1; |
|||
nsAddFormRef.value?.submit(); |
|||
}, |
|||
}, |
|||
], |
|||
}); |
|||
|
|||
const formSchema = ref([ |
|||
{ |
|||
field: 'folderCode', |
|||
defaultValue: 'mobileArticleManager', |
|||
}, |
|||
{ |
|||
field: 'articleCommonHandleForm', |
|||
defaultValue: { folderCode: 'mobileArticleManager', folderName: '文章', sort: 0 }, |
|||
}, |
|||
{ |
|||
field: 'uuid', |
|||
defaultValue: uuid, |
|||
}, |
|||
{ |
|||
field: 'isPublish', |
|||
defaultValue: 0, |
|||
}, |
|||
{ |
|||
field: 'title', |
|||
label: '文章标题', |
|||
component: 'NsInput', |
|||
|
|||
componentProps: { |
|||
placeholder: '请输入', |
|||
// 禁止输入 |
|||
// disabled: true, |
|||
// onChange: (e) => { |
|||
// data.value.articleCommonHandleForm['title'] = e.target.value; |
|||
// }, |
|||
}, |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: '请输入文章标题', |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
field: 'articleSource', |
|||
label: '消息来源', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
placeholder: '请输入', |
|||
// onChange: (e) => { |
|||
// data.value.articleCommonHandleForm['articleSource'] = e.target.value; |
|||
// }, |
|||
}, |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: '请输入消息来源', |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
field: 'tagUuidList', |
|||
label: '文章标签', |
|||
component: 'nsSelectApi', |
|||
componentProps: { |
|||
mode: 'tags', |
|||
api: '/api/content/objs/admin/cms/bg/articleTag/allList', |
|||
params: { folderCode: 'mobileArticleManager' }, |
|||
autoSelectFirst: false, |
|||
resultField: 'data', |
|||
labelField: 'tagName', |
|||
valueField: 'tagName', |
|||
immediate: true, |
|||
dropdownReload: true, |
|||
placeholder: '请选择', |
|||
filterOption: (input, option) => { |
|||
return option.tagName?.indexOf(input) >= 0; |
|||
}, |
|||
// onChange: (a, b) => { |
|||
// console.log(a, b, 'onchange'); |
|||
// // getTagUuid(a); |
|||
// }, |
|||
onSelect: (a, b) => { |
|||
if (JSON.stringify(b) == '{}') { |
|||
addTag(a, data.value.tagUuidList); |
|||
// console.log(data.value); |
|||
} else { |
|||
getTagUuid(data.value.tagUuidList); |
|||
} |
|||
console.log(a, JSON.stringify(b), 'onselect'); |
|||
}, |
|||
}, |
|||
// rules: [ |
|||
// { |
|||
// required: true, |
|||
// message: '请选择', |
|||
// type: 'array', |
|||
// }, |
|||
// ], |
|||
}, |
|||
|
|||
{ |
|||
field: 'imageNetUrl', |
|||
component: 'NsUpload', |
|||
label: '文章图片', |
|||
componentProps: { |
|||
// 上传的地址 |
|||
url: '/api/fileunify/objs/admin/MaterialFile', |
|||
// 上传的图片大小 |
|||
maxSize: 5242880, |
|||
// 上传的图片类型 |
|||
fileType: ['jpg', 'png', 'jpeg'], |
|||
// 展示图片数量 |
|||
count: 1, |
|||
// 上传的文件类型,0-证书,1-图片,2-身份证件 |
|||
uploadType: 1, |
|||
params: { |
|||
groupCode: 'mobile_img', |
|||
}, |
|||
baseImageUrl: imageNetUrl, |
|||
// onChange: (e) => { |
|||
// data.value.articleCommonHandleForm['imageNetUrl'] = e; |
|||
// }, |
|||
}, |
|||
}, |
|||
{ |
|||
field: 'content', |
|||
component: 'FCKEditor', |
|||
class: 'ns-form-item-full ns-form-item-padding ns-richText-ZIndex', |
|||
label: '文章内容', |
|||
componentProps: { |
|||
htmlInfo: htmlInfo, |
|||
// onChange: (a) => { |
|||
// data.value.articleCommonHandleForm['content'] = a; |
|||
// }, |
|||
}, |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: '内容不能为空', |
|||
trigger: 'blur', |
|||
}, |
|||
], |
|||
}, |
|||
]); |
|||
|
|||
return { |
|||
formSchema, |
|||
data, |
|||
headActions, |
|||
nsAddFormRef, |
|||
dataHandle, |
|||
uuid, |
|||
formApi, |
|||
}; |
|||
}, |
|||
}); |
|||
</script> |
@ -1,70 +0,0 @@ |
|||
<!-- @format --> |
|||
|
|||
<template> |
|||
<div> |
|||
<ns-view-detail api="/api/content/objs/admin/cms/bg/article/detail" :detail="detail"> |
|||
<template #content="data"> |
|||
<span v-html="data.value"></span> |
|||
</template> |
|||
</ns-view-detail> |
|||
</div> |
|||
</template> |
|||
<script lang="ts"> |
|||
import { defineComponent, reactive, ref } from 'vue'; |
|||
import { useRouter } from 'vue-router'; |
|||
import { dateUtil } from '/nerv-lib/saas'; |
|||
import { http } from '/nerv-lib/util/http'; |
|||
|
|||
export default defineComponent({ |
|||
name: 'ArticleDetail', |
|||
setup() { |
|||
const rouer = useRouter(); |
|||
const dataHandle = ({ articleCommonVO }) => { |
|||
return articleCommonVO; |
|||
}; |
|||
const detail = reactive([ |
|||
{ |
|||
title: '基本信息', |
|||
items: [ |
|||
{ |
|||
label: '新闻标题', |
|||
name: 'title', |
|||
format: (value, { articleCommonVO: { title } }) => title, |
|||
}, |
|||
{ |
|||
label: '消息来源', |
|||
name: 'articleSource', |
|||
format: (value, { articleCommonVO: { articleSource } }) => articleSource, |
|||
}, |
|||
{ |
|||
label: '文章标签', |
|||
name: 'tagNameList', |
|||
format: (value) => { |
|||
return value && value.join(','); |
|||
}, |
|||
}, |
|||
{ |
|||
label: '新闻图片', |
|||
name: 'imageNetUrl', |
|||
type: 'image', |
|||
format: (value, { articleCommonVO: { imageNetUrl } }) => imageNetUrl, |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
title: '新闻内容:', |
|||
items: [ |
|||
{ |
|||
label: '', |
|||
type: 'html', |
|||
name: 'content', |
|||
style: { padding: 0 }, |
|||
format: (value, { articleCommonVO: { content } }) => content, |
|||
}, |
|||
], |
|||
}, |
|||
]); |
|||
return { detail, dataHandle }; |
|||
}, |
|||
}); |
|||
</script> |
@ -1,251 +0,0 @@ |
|||
<!-- @format --> |
|||
|
|||
<template> |
|||
<ns-view-list-table ref="nsTableRef" v-bind="tableConfig" rowKey="uuid" /> |
|||
</template> |
|||
|
|||
<script lang="ts"> |
|||
import { defineComponent, ref } from 'vue'; |
|||
import { dateUtil } from '/nerv-lib/saas'; |
|||
import { useRouter } from 'vue-router'; |
|||
import { http } from '/nerv-lib/util/http'; |
|||
import { NsMessage } from '/nerv-lib/component/message'; |
|||
|
|||
export default defineComponent({ |
|||
name: 'ArticleIndex', |
|||
setup() { |
|||
const router = useRouter(); |
|||
const nsTableRef = ref(); |
|||
|
|||
const request = (api: string, params: object) => { |
|||
http.post(api, params).then(() => { |
|||
NsMessage.success('操作成功'); |
|||
nsTableRef.value.nsTableRef.reload(); |
|||
}); |
|||
}; |
|||
const tableConfig = { |
|||
title: '文章管理', |
|||
api: { |
|||
method: 'POST', |
|||
url: '/api/content/objs/admin/cms/bg/article/pageList', |
|||
}, |
|||
params: { |
|||
page: 0, |
|||
pageSize: 10, |
|||
folderCode: 'mobileArticleManager', |
|||
}, |
|||
formConfig: { |
|||
schemas: [ |
|||
{ |
|||
field: 'titleLike', |
|||
label: '文章标题', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
placeholder: '请输入', |
|||
}, |
|||
}, |
|||
{ |
|||
field: 'articleStatus', |
|||
label: '状态', |
|||
component: 'NsSelect', |
|||
defaultValue: '', |
|||
componentProps: { |
|||
placeholder: '请选择', |
|||
options: [ |
|||
{ label: '全部', value: '' }, |
|||
{ label: '未上架', value: 1 }, |
|||
{ label: '审核中', value: 2 }, |
|||
{ label: '已上架', value: 3 }, |
|||
{ label: '未通过', value: 6 }, |
|||
], |
|||
}, |
|||
}, |
|||
{ |
|||
field: 'tagUuidList', |
|||
label: '文章标签', |
|||
component: 'nsSelectApi', |
|||
componentProps: { |
|||
params: { folderCode: 'mobileArticleManager' }, |
|||
mode: 'multiple', |
|||
api: '/api/content/objs/admin/cms/bg/articleTag/allList', |
|||
autoSelectFirst: false, |
|||
resultField: 'data', |
|||
labelField: 'tagName', |
|||
valueField: 'uuid', |
|||
immediate: true, |
|||
placeholder: '请选择', |
|||
showSearch: true, |
|||
filterOption: (input, option) => { |
|||
return option.tagName.indexOf(input) >= 0; |
|||
}, |
|||
dropdownReload: true, |
|||
}, |
|||
}, |
|||
], |
|||
}, |
|||
headerActions: [ |
|||
{ |
|||
label: '新增文章', |
|||
name: 'ArticleAdd', |
|||
type: 'primary', |
|||
handle: ({}, name) => { |
|||
router.push({ name, query: {} }); |
|||
}, |
|||
}, |
|||
], |
|||
rowSelection: null, |
|||
columns: [ |
|||
{ |
|||
title: '文章ID', |
|||
dataIndex: 'articleCode', |
|||
textNumber: 5, |
|||
customRender: ({ record: { articleCommonVO }, column }) => { |
|||
return articleCommonVO[column.dataIndex]; |
|||
}, |
|||
}, |
|||
{ |
|||
title: '文章标题', |
|||
dataIndex: 'title', |
|||
textNumber: 5, |
|||
customRender: ({ record: { articleCommonVO }, column }) => { |
|||
return articleCommonVO[column.dataIndex]; |
|||
}, |
|||
}, |
|||
{ |
|||
title: '文章标签', |
|||
dataIndex: 'tagNameList', |
|||
textNumber: 5, |
|||
textEllipsis: true, |
|||
customRender: ({ record: { tagNameList }, column }) => { |
|||
return (tagNameList && tagNameList.join(',')) || '-'; |
|||
}, |
|||
}, |
|||
{ |
|||
title: '信息来源', |
|||
dataIndex: 'articleSource', |
|||
textNumber: 5, |
|||
customRender: ({ record: { articleCommonVO }, column }) => { |
|||
return articleCommonVO[column.dataIndex]; |
|||
}, |
|||
}, |
|||
{ |
|||
title: '上架时间', |
|||
dataIndex: 'publishTime', |
|||
textNumber: 10, |
|||
customRender: ({ record: { articleCommonVO }, column }) => { |
|||
return articleCommonVO[column.dataIndex] || '-'; |
|||
}, |
|||
}, |
|||
{ |
|||
title: '状态', |
|||
dataIndex: 'articleStatus', |
|||
textNumber: 5, |
|||
customCell: ({ articleCommonVO: { articleStatus } }) => { |
|||
return { |
|||
style: { color: articleStatus == 3 ? 'green' : articleStatus == 6 ? 'red' : '' }, |
|||
}; |
|||
}, |
|||
customRender: ({ record: { articleCommonVO }, column }) => { |
|||
return ['', '未上架', '待审核', '已上架', '', '', '未通过'][ |
|||
articleCommonVO[column.dataIndex] |
|||
]; |
|||
}, |
|||
}, |
|||
{ |
|||
title: '是否置顶', |
|||
textNumber: 4, |
|||
dataIndex: 'isTop', |
|||
customRender: ({ record: { articleCommonVO }, column }) => { |
|||
return ['否', '是'][articleCommonVO[column.dataIndex]]; |
|||
}, |
|||
}, |
|||
|
|||
{ |
|||
title: '创建人', |
|||
dataIndex: 'createUserName', |
|||
textNumber: 5, |
|||
customRender: ({ record: { articleCommonVO }, column }) => { |
|||
return articleCommonVO[column.dataIndex]; |
|||
}, |
|||
}, |
|||
{ |
|||
title: '创建时间', |
|||
dataIndex: 'createTime', |
|||
// textNumber: 9, |
|||
customRender: ({ record: { articleCommonVO }, column }) => { |
|||
return articleCommonVO[column.dataIndex]; |
|||
}, |
|||
}, |
|||
], |
|||
columnActions: { |
|||
title: '操作', |
|||
autoMergeAction: false, |
|||
actionNumber: 3, |
|||
actions: [ |
|||
{ |
|||
label: '查看', |
|||
name: 'ArticleDetail', |
|||
ifShow: ({ articleCommonVO: { articleStatus } }) => [2, 3].includes(articleStatus), |
|||
handle: ({ articleCommonVO: { uuid } }, name) => { |
|||
router.push({ name, query: { uuid } }); |
|||
}, |
|||
}, |
|||
{ |
|||
label: '编辑', |
|||
name: 'ArticleEdit', |
|||
ifShow: ({ articleCommonVO: { articleStatus } }) => [1, 6].includes(articleStatus), |
|||
handle: ({ articleCommonVO: { uuid } }, name) => { |
|||
router.push({ name, query: { uuid } }); |
|||
}, |
|||
}, |
|||
{ |
|||
label: '置顶', |
|||
name: 'ArticleManageTop', |
|||
confirm: true, |
|||
ifShow: ({ articleCommonVO: { articleStatus, isTop } }) => |
|||
articleStatus == 3 && isTop == 0, |
|||
handle: ({ articleCommonVO: { uuid } }, name) => { |
|||
request('/api/content/objs/admin/cms/bg/article/top', { uuid }); |
|||
}, |
|||
}, |
|||
{ |
|||
label: '取消置顶', |
|||
name: 'ArticleManageCancleTop', |
|||
confirm: true, |
|||
ifShow: ({ articleCommonVO: { articleStatus, isTop } }) => |
|||
articleStatus == 3 && isTop == 1, |
|||
handle: ({ articleCommonVO: { uuid } }, name) => { |
|||
request('/api/content/objs/admin/cms/bg/article/top', { uuid }); |
|||
}, |
|||
}, |
|||
{ |
|||
label: '删除', |
|||
dynamicParams: 'uuid', |
|||
name: 'ArticleManageDelete', |
|||
confirm: true, |
|||
ifShow: ({ articleCommonVO: { articleStatus } }) => [1, 6].includes(articleStatus), |
|||
handle: ({ articleCommonVO: { uuid } }, name) => { |
|||
request('/api/content/objs/admin/cms/bg/article/batchDel', { uuids: [uuid] }); |
|||
}, |
|||
}, |
|||
{ |
|||
label: '下架', |
|||
dynamicParams: 'uuid', |
|||
name: 'ArticleManageReaded', |
|||
confirm: true, |
|||
ifShow: ({ articleCommonVO: { articleStatus } }) => [3].includes(articleStatus), |
|||
handle: ({ articleCommonVO: { uuid } }, name) => { |
|||
request('/api/content/objs/admin/cms/bg/article/withdrawn', { uuid }); |
|||
}, |
|||
}, |
|||
], |
|||
}, |
|||
}; |
|||
return { |
|||
tableConfig, |
|||
nsTableRef, |
|||
}; |
|||
}, |
|||
}); |
|||
</script> |
|||
<style lang="less" scoped></style> |
@ -1,162 +0,0 @@ |
|||
<!-- @format --> |
|||
|
|||
<template> |
|||
<ns-view-add-form |
|||
ref="nsAddFormRef" |
|||
:schemas="formSchema" |
|||
:model="data" |
|||
title="审核" |
|||
:api="'/api/content/objs/admin/articleExamineRecord/update'" /> |
|||
</template> |
|||
<script lang="ts"> |
|||
import { defineComponent, reactive, ref, provide, computed } from 'vue'; |
|||
import { useRouter } from 'vue-router'; |
|||
import FCKEditor from '/@/view/components/FCKEditor.vue'; |
|||
import { http } from '/nerv-lib/util/http'; |
|||
import { dateUtil } from '/nerv-lib/saas'; |
|||
|
|||
export default defineComponent({ |
|||
name: 'AnnouncementsAdd', |
|||
setup() { |
|||
const router = useRouter(); |
|||
const { uuid } = router.currentRoute.value.query; |
|||
const nsAddFormRef = ref(); |
|||
const data = ref({}); |
|||
provide('components', () => { |
|||
return { FCKEditor }; |
|||
}); |
|||
if (uuid) { |
|||
http.get('/api/content/objs/admin/articleExamineRecord/detail', { uuid }).then((res) => { |
|||
data.value = res.data; |
|||
data.value.createTime = |
|||
res.data?.createTime && dateUtil(res.data.createTime).format('YYYY-MM-DD HH:mm:ss'); |
|||
}); |
|||
} |
|||
const validateResult = computed(() => { |
|||
return !nsAddFormRef.value?.validateResult; |
|||
}); |
|||
const headActions = ref({ |
|||
actions: [ |
|||
{ |
|||
label: '发布', |
|||
name: 'AnnouncementsDetail', |
|||
dynamicDisabled: validateResult, |
|||
handle: (record, name) => { |
|||
nsAddFormRef.value?.submit(); |
|||
}, |
|||
}, |
|||
], |
|||
}); |
|||
|
|||
const formSchema = reactive([ |
|||
{ |
|||
field: 'uuid', |
|||
defaultValue: uuid, |
|||
}, |
|||
{ |
|||
field: 'field111', |
|||
label: '', |
|||
displayFormItem: false, |
|||
class: 'ns-form-item-full', |
|||
component: 'NsChildForm', |
|||
componentProps: { |
|||
title: '审核内容', |
|||
schemas: [ |
|||
{ |
|||
field: 'folderName', |
|||
label: '内容类型', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
disabled: true, |
|||
}, |
|||
}, |
|||
{ |
|||
field: 'articleTitle', |
|||
label: '内容名称', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
disabled: true, |
|||
}, |
|||
}, |
|||
{ |
|||
field: 'createTime', |
|||
label: '提交时间', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
disabled: true, |
|||
}, |
|||
}, |
|||
{ |
|||
field: 'createUserName', |
|||
label: '提交人', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
disabled: true, |
|||
}, |
|||
}, |
|||
], |
|||
}, |
|||
}, |
|||
{ |
|||
field: 'field111', |
|||
label: '', |
|||
displayFormItem: false, |
|||
class: 'ns-form-item-full', |
|||
component: 'NsChildForm', |
|||
componentProps: { |
|||
title: '审核信息', |
|||
schemas: [ |
|||
{ |
|||
field: 'examStatus', |
|||
component: 'NsRadioGroup', |
|||
label: '审核结果', |
|||
defaultValue: 1, |
|||
componentProps: { |
|||
radioType: 'radio', |
|||
options: [ |
|||
{ |
|||
label: '通过', |
|||
value: 1, |
|||
}, |
|||
{ |
|||
label: '不通过', |
|||
value: 2, |
|||
}, |
|||
], |
|||
}, |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: '请选择', |
|||
type: 'number', |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
field: 'examRemark', |
|||
label: '审批说明', |
|||
component: 'NsTextarea', |
|||
componentProps: { |
|||
placeholder: '请输入', |
|||
}, |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: '请输入', |
|||
}, |
|||
], |
|||
}, |
|||
], |
|||
}, |
|||
}, |
|||
]); |
|||
|
|||
return { |
|||
formSchema, |
|||
data, |
|||
headActions, |
|||
nsAddFormRef, |
|||
}; |
|||
}, |
|||
}); |
|||
</script> |
@ -1,85 +0,0 @@ |
|||
<!-- @format --> |
|||
|
|||
<template> |
|||
<div> |
|||
<ns-view-detail |
|||
:title="bulletinTopic" |
|||
api="/api/content/objs/admin/articleExamineRecord/detail" |
|||
:detail="detail"> |
|||
<template #content="data"> |
|||
<span v-html="data.value"></span> |
|||
</template> |
|||
</ns-view-detail> |
|||
</div> |
|||
</template> |
|||
<script lang="ts"> |
|||
import { defineComponent, reactive, ref } from 'vue'; |
|||
import { useRouter } from 'vue-router'; |
|||
import { dateUtil } from '/nerv-lib/saas'; |
|||
|
|||
export default defineComponent({ |
|||
name: 'MonthlyCarDetail', |
|||
setup() { |
|||
const rouer = useRouter(); |
|||
const { bulletinTopic } = rouer.currentRoute.value.query; |
|||
const detail = reactive([ |
|||
{ |
|||
title: '审核内容', |
|||
items: [ |
|||
{ |
|||
label: '内容类型', |
|||
name: 'folderName', |
|||
}, |
|||
{ |
|||
label: '内容名称', |
|||
name: 'articleTitle', |
|||
}, |
|||
{ |
|||
label: '内容ID', |
|||
name: 'articleCode', |
|||
}, |
|||
{ |
|||
label: '提交人', |
|||
name: 'createUserName', |
|||
}, |
|||
{ |
|||
label: '提交时间', |
|||
name: 'createTime', |
|||
format: (val) => { |
|||
return val && dateUtil(val).format('YYYY-MM-DD HH:mm:ss'); |
|||
}, |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
title: '审核信息', |
|||
items: [ |
|||
{ |
|||
label: '审批结果', |
|||
name: 'examResult', |
|||
format: (val) => { |
|||
return ['', '通过', '不通过'][val]; |
|||
}, |
|||
}, |
|||
{ |
|||
label: '审批人', |
|||
name: 'examUserName', |
|||
}, |
|||
{ |
|||
label: '审批时间', |
|||
name: 'examTime', |
|||
format: (val) => { |
|||
return val && dateUtil(val).format('YYYY-MM-DD HH:mm:ss'); |
|||
}, |
|||
}, |
|||
{ |
|||
label: '审批说明', |
|||
name: 'examRemark', |
|||
}, |
|||
], |
|||
}, |
|||
]); |
|||
return { detail, bulletinTopic }; |
|||
}, |
|||
}); |
|||
</script> |
@ -1,170 +0,0 @@ |
|||
<!-- @format --> |
|||
|
|||
<template> |
|||
<ns-view-list-table v-bind="tableConfig" rowKey="uuid" /> |
|||
</template> |
|||
|
|||
<script lang="ts"> |
|||
import { defineComponent } from 'vue'; |
|||
import { dateUtil } from '/nerv-lib/saas'; |
|||
import { useRouter } from 'vue-router'; |
|||
export default defineComponent({ |
|||
name: 'AuditIndex', |
|||
setup() { |
|||
const router = useRouter(); |
|||
const tableConfig = { |
|||
title: '审核管理', |
|||
api: { |
|||
method: 'GET', |
|||
url: '/api/content/objs/admin/articleExamineRecord/pageList', |
|||
}, |
|||
params: { |
|||
page: 0, |
|||
pageSize: 10, |
|||
}, |
|||
formConfig: { |
|||
schemas: [ |
|||
{ |
|||
field: 'folderId', |
|||
label: '内容类型', |
|||
component: 'NsSelect', |
|||
defaultValue: '', |
|||
componentProps: { |
|||
placeholder: '请选择', |
|||
options: [ |
|||
{ label: '全部', value: '' }, |
|||
{ label: '通知公告', value: 1 }, |
|||
{ label: '新闻', value: 2 }, |
|||
{ label: '文章', value: 3 }, |
|||
], |
|||
}, |
|||
}, |
|||
{ |
|||
field: 'articleTitleLike', |
|||
label: '内容名称', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
placeholder: '请输入', |
|||
}, |
|||
}, |
|||
{ |
|||
field: 'articleCodeLike', |
|||
label: '内容ID', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
placeholder: '请输入', |
|||
}, |
|||
}, |
|||
{ |
|||
field: 'examStatus', |
|||
label: '审核状态', |
|||
component: 'NsSelect', |
|||
defaultValue: '', |
|||
componentProps: { |
|||
placeholder: '请选择', |
|||
options: [ |
|||
{ label: '全部', value: '' }, |
|||
{ label: '待审核', value: 1 }, |
|||
{ label: '已完成', value: 2 }, |
|||
], |
|||
}, |
|||
}, |
|||
], |
|||
}, |
|||
headerActions: [{}], |
|||
rowSelection: null, |
|||
columns: [ |
|||
{ |
|||
title: '内容类型', |
|||
dataIndex: 'folderName', |
|||
textNumber: 4, |
|||
}, |
|||
{ |
|||
title: '内容名称', |
|||
dataIndex: 'articleTitle', |
|||
textNumber: 6, |
|||
textEllipsis: true, |
|||
// width: 300, |
|||
}, |
|||
{ |
|||
title: '内容ID', |
|||
dataIndex: 'articleCode', |
|||
// width: 300, |
|||
}, |
|||
{ |
|||
title: '提交人', |
|||
dataIndex: 'createUserName', |
|||
// width: 300, |
|||
}, |
|||
{ |
|||
title: '提交时间', |
|||
dataIndex: 'createTime', |
|||
// width: 200, |
|||
customRender: ({ value }: any) => { |
|||
if (!value) return '-'; |
|||
if (value) return dateUtil(value).format('YYYY-MM-DD HH:mm:ss'); |
|||
}, |
|||
}, |
|||
{ |
|||
title: '审核人', |
|||
dataIndex: 'examUserName', |
|||
textNumber: 4, |
|||
customRender: ({ value }: any) => { |
|||
if (!value) return '-'; |
|||
return value; |
|||
}, |
|||
}, |
|||
{ |
|||
title: '审核时间', |
|||
dataIndex: 'examTime', |
|||
textNumber: 10, |
|||
customRender: ({ value }: any) => { |
|||
if (!value) return '-'; |
|||
if (value) return dateUtil(value).format('YYYY-MM-DD HH:mm:ss'); |
|||
}, |
|||
}, |
|||
{ |
|||
title: '审核结果', |
|||
dataIndex: 'examResult', |
|||
textNumber: 4, |
|||
customRender: ({ value }: any) => ['', '通过', '未通过'][value], |
|||
}, |
|||
{ |
|||
title: '状态', |
|||
dataIndex: 'examStatus', |
|||
textNumber: 3, |
|||
customRender: ({ value }: any) => ['', '待审核', '已完成'][value], |
|||
}, |
|||
], |
|||
columnActions: { |
|||
title: '操作', |
|||
// width: 100, |
|||
actionNumber: 1, |
|||
textNumber: 2, |
|||
actions: [ |
|||
{ |
|||
label: '查看', |
|||
name: 'AuditDetail', |
|||
ifShow: ({ examStatus }) => examStatus == 2, |
|||
handle: ({ uuid }, name) => { |
|||
router.push({ name, query: { uuid } }); |
|||
}, |
|||
}, |
|||
{ |
|||
label: '审核', |
|||
name: 'AuditAction', |
|||
ifShow: ({ examStatus }) => examStatus == 1, |
|||
handle: ({ uuid }, name) => { |
|||
router.push({ name, query: { uuid } }); |
|||
}, |
|||
}, |
|||
], |
|||
}, |
|||
}; |
|||
return { |
|||
tableConfig, |
|||
}; |
|||
}, |
|||
}); |
|||
</script> |
|||
<style lang="less" scoped></style> |
@ -1,199 +0,0 @@ |
|||
<!-- @format --> |
|||
|
|||
<template> |
|||
<ns-view-add-form |
|||
ref="nsAddFormRef" |
|||
:schemas="formSchema" |
|||
:model="data" |
|||
:title="uuid ? '编辑新闻' : '新增新闻'" |
|||
:dataHandle="dataHandle" |
|||
:headActions="headActions" |
|||
:api="formApi" /> |
|||
</template> |
|||
<script lang="ts"> |
|||
import { defineComponent, reactive, ref, provide, computed } from 'vue'; |
|||
import { useRouter } from 'vue-router'; |
|||
import FCKEditor from '/@/view/components/FCKEditor.vue'; |
|||
import { http } from '/nerv-lib/util/http'; |
|||
|
|||
export default defineComponent({ |
|||
name: 'NewsAdd', |
|||
setup() { |
|||
provide('components', () => { |
|||
return { FCKEditor }; |
|||
}); |
|||
const router = useRouter(); |
|||
const { uuid } = router.currentRoute.value.query; |
|||
const nsAddFormRef = ref(); |
|||
const htmlInfo = ref(''); |
|||
const imageNetUrl = ref(''); |
|||
const formApi = ref( |
|||
uuid |
|||
? '/api/content/objs/admin/cms/bg/article/update' |
|||
: '/api/content/objs/admin/cms/bg/article/add', |
|||
); |
|||
|
|||
const data = ref({ |
|||
articleCommonHandleForm: { folderCode: 'mobileNewsManager', content: '', title: '' }, |
|||
}); |
|||
|
|||
if (uuid) { |
|||
http.get('/api/content/objs/admin/cms/bg/article/detail', { uuid }).then((res) => { |
|||
console.log(res); |
|||
data.value = res.data.articleCommonVO; |
|||
data.value.articleCommonHandleForm = { |
|||
folderCode: 'mobileNewsManager', |
|||
folderName: '新闻', |
|||
sort: 0, |
|||
title: res.data.articleCommonVO.title, |
|||
content: res.data.articleCommonVO.content, |
|||
articleSource: res.data.articleCommonVO.articleSource, |
|||
imageNetUrl: res.data.articleCommonVO.imageNetUrl, |
|||
}; |
|||
data.value.folderCode = 'mobileNewsManager'; |
|||
// 编辑->未上架 |
|||
data.value.isPublish = 0; |
|||
imageNetUrl.value = res.data.articleCommonVO.imageNetUrl; |
|||
htmlInfo.value = res.data.articleCommonVO.content || ''; |
|||
}); |
|||
} |
|||
const dataHandle = (data) => { |
|||
const newData = JSON.parse(JSON.stringify(data)); |
|||
newData['articleCommonHandleForm'] = Object.assign( |
|||
newData['articleCommonHandleForm'], |
|||
data, |
|||
); |
|||
return newData; |
|||
}; |
|||
const validateResult = computed(() => { |
|||
return !nsAddFormRef.value?.validateResult; |
|||
}); |
|||
const headActions = ref({ |
|||
actions: [ |
|||
{ |
|||
label: '发布', |
|||
name: 'NewsDetail', |
|||
dynamicDisabled: validateResult, |
|||
handle: (record, name) => { |
|||
// formApi.value = uuid |
|||
// ? '/api/content/objs/admin/cms/bg/article/publish' |
|||
// : '/api/content/objs/admin/cms/bg/article/add'; |
|||
data.value.isPublish = 1; |
|||
nsAddFormRef.value?.submit(); |
|||
}, |
|||
}, |
|||
], |
|||
}); |
|||
|
|||
const formSchema = ref([ |
|||
{ |
|||
field: 'folderCode', |
|||
defaultValue: 'mobileNewsManager', |
|||
}, |
|||
{ |
|||
field: 'articleCommonHandleForm', |
|||
defaultValue: { folderCode: 'mobileNewsManager', folderName: '新闻', sort: 0 }, |
|||
}, |
|||
{ |
|||
field: 'uuid', |
|||
defaultValue: uuid, |
|||
}, |
|||
{ |
|||
field: 'isPublish', |
|||
defaultValue: 0, |
|||
}, |
|||
{ |
|||
field: 'title', |
|||
label: '新闻标题', |
|||
component: 'NsInput', |
|||
|
|||
componentProps: { |
|||
placeholder: '请输入', |
|||
// 禁止输入 |
|||
// disabled: true, |
|||
// onChange: (e) => { |
|||
// data.value.articleCommonHandleForm['title'] = e.target.value; |
|||
// }, |
|||
}, |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: '请输入新闻标题', |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
field: 'articleSource', |
|||
label: '消息来源', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
placeholder: '请输入', |
|||
// onChange: (e) => { |
|||
// data.value.articleCommonHandleForm['articleSource'] = e.target.value; |
|||
// }, |
|||
}, |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: '请输入消息来源', |
|||
}, |
|||
], |
|||
}, |
|||
|
|||
{ |
|||
field: 'imageNetUrl', |
|||
component: 'NsUpload', |
|||
label: '新闻图片', |
|||
componentProps: { |
|||
// 上传的地址 |
|||
url: '/api/fileunify/objs/admin/MaterialFile', |
|||
// 上传的图片大小 |
|||
maxSize: 5242880, |
|||
// 上传的图片类型 |
|||
fileType: ['jpg', 'png', 'jpeg'], |
|||
// 展示图片数量 |
|||
count: 1, |
|||
// 上传的文件类型,0-证书,1-图片,2-身份证件 |
|||
uploadType: 1, |
|||
params: { |
|||
groupCode: 'mobile_img', |
|||
}, |
|||
baseImageUrl: imageNetUrl, |
|||
// onChange: (e) => { |
|||
// data.value.articleCommonHandleForm['imageNetUrl'] = e; |
|||
// }, |
|||
}, |
|||
}, |
|||
{ |
|||
field: 'content', |
|||
component: 'FCKEditor', |
|||
class: 'ns-form-item-full ns-form-item-padding ns-richText-ZIndex', |
|||
label: '新闻内容', |
|||
componentProps: { |
|||
htmlInfo: htmlInfo, |
|||
// onChange: (a) => { |
|||
// data.value.articleCommonHandleForm['content'] = a; |
|||
// }, |
|||
}, |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: '内容不能为空', |
|||
trigger: 'blur', |
|||
}, |
|||
], |
|||
}, |
|||
]); |
|||
|
|||
return { |
|||
formSchema, |
|||
data, |
|||
headActions, |
|||
nsAddFormRef, |
|||
dataHandle, |
|||
uuid, |
|||
formApi, |
|||
}; |
|||
}, |
|||
}); |
|||
</script> |
@ -1,65 +0,0 @@ |
|||
<!-- @format --> |
|||
|
|||
<template> |
|||
<div> |
|||
<ns-view-detail |
|||
:dataHandle="dataHandle" |
|||
api="/api/content/objs/admin/cms/bg/article/detail" |
|||
:detail="detail"> |
|||
<template #content="data"> |
|||
<span v-html="data.value"></span> |
|||
</template> |
|||
</ns-view-detail> |
|||
</div> |
|||
</template> |
|||
<script lang="ts"> |
|||
import { defineComponent, reactive, ref } from 'vue'; |
|||
import { useRouter } from 'vue-router'; |
|||
import { dateUtil } from '/nerv-lib/saas'; |
|||
import { http } from '/nerv-lib/util/http'; |
|||
|
|||
export default defineComponent({ |
|||
name: 'NewsDetail', |
|||
setup() { |
|||
const rouer = useRouter(); |
|||
const dataHandle = ({ articleCommonVO }) => { |
|||
return articleCommonVO; |
|||
}; |
|||
const detail = reactive([ |
|||
{ |
|||
title: '基本信息', |
|||
items: [ |
|||
{ |
|||
label: '新闻标题', |
|||
name: 'title', |
|||
}, |
|||
{ |
|||
label: '消息来源', |
|||
name: 'articleSource', |
|||
}, |
|||
{ |
|||
label: '新闻图片', |
|||
name: 'imageNetUrl', |
|||
type: 'image', |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
title: '新闻内容:', |
|||
items: [ |
|||
{ |
|||
label: '', |
|||
type: 'html', |
|||
name: 'content', |
|||
style: { padding: 0 }, |
|||
// format: (value, record) => { |
|||
// return record.articleCommonVO.content; |
|||
// }, |
|||
}, |
|||
], |
|||
}, |
|||
]); |
|||
return { detail, dataHandle }; |
|||
}, |
|||
}); |
|||
</script> |
@ -1,220 +0,0 @@ |
|||
<!-- @format --> |
|||
|
|||
<template> |
|||
<ns-view-list-table ref="nsTableRef" v-bind="tableConfig" rowKey="uuid" /> |
|||
</template> |
|||
|
|||
<script lang="ts"> |
|||
import { defineComponent, ref } from 'vue'; |
|||
import { dateUtil } from '/nerv-lib/saas'; |
|||
import { useRouter } from 'vue-router'; |
|||
import { http } from '/nerv-lib/util/http'; |
|||
import { NsMessage } from '/nerv-lib/component/message'; |
|||
|
|||
export default defineComponent({ |
|||
name: 'NewsIndex', |
|||
setup() { |
|||
const router = useRouter(); |
|||
const nsTableRef = ref(); |
|||
|
|||
const request = (api: string, params: object) => { |
|||
http.post(api, params).then(() => { |
|||
NsMessage.success('操作成功'); |
|||
nsTableRef.value.nsTableRef.reload(); |
|||
}); |
|||
}; |
|||
const tableConfig = { |
|||
title: '新闻管理', |
|||
api: { |
|||
method: 'POST', |
|||
url: '/api/content/objs/admin/cms/bg/article/pageList', |
|||
}, |
|||
params: { |
|||
page: 0, |
|||
pageSize: 10, |
|||
folderCode: 'mobileNewsManager', |
|||
}, |
|||
formConfig: { |
|||
schemas: [ |
|||
{ |
|||
field: 'titleLike', |
|||
label: '新闻标题', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
placeholder: '请输入', |
|||
}, |
|||
}, |
|||
{ |
|||
field: 'articleStatus', |
|||
label: '状态', |
|||
component: 'NsSelect', |
|||
defaultValue: '', |
|||
componentProps: { |
|||
placeholder: '请选择', |
|||
options: [ |
|||
{ label: '全部', value: '' }, |
|||
{ label: '未上架', value: 1 }, |
|||
{ label: '待审核', value: 2 }, |
|||
{ label: '已上架', value: 3 }, |
|||
{ label: '未通过', value: 6 }, |
|||
], |
|||
}, |
|||
}, |
|||
], |
|||
}, |
|||
headerActions: [ |
|||
{ |
|||
label: '新增新闻', |
|||
name: 'NewsAdd', |
|||
type: 'primary', |
|||
handle: ({}, name) => { |
|||
router.push({ name, query: {} }); |
|||
}, |
|||
}, |
|||
], |
|||
rowSelection: null, |
|||
columns: [ |
|||
{ |
|||
title: '新闻ID', |
|||
dataIndex: 'articleCode', |
|||
customRender: ({ record: { articleCommonVO }, column }) => { |
|||
return articleCommonVO[column.dataIndex]; |
|||
}, |
|||
}, |
|||
{ |
|||
title: '新闻标题', |
|||
dataIndex: 'extraColMap', |
|||
textNumber: 6, |
|||
textEllipsis: true, |
|||
customRender: ({ record: { articleCommonVO }, column }) => { |
|||
return articleCommonVO['title']; |
|||
}, |
|||
}, |
|||
{ |
|||
title: '状态', |
|||
textNumber: 4, |
|||
dataIndex: 'articleStatus', |
|||
customCell: ({ articleCommonVO: { articleStatus } }) => { |
|||
return { |
|||
style: { color: articleStatus == 3 ? 'green' : articleStatus == 6 ? 'red' : '' }, |
|||
}; |
|||
}, |
|||
customRender: ({ record: { articleCommonVO }, column }) => { |
|||
return ['', '未上架', '待审核', '已上架', '', '', '未通过'][ |
|||
articleCommonVO[column.dataIndex] |
|||
]; |
|||
}, |
|||
}, |
|||
{ |
|||
title: '是否置顶', |
|||
textNumber: 4, |
|||
dataIndex: 'isTop', |
|||
customRender: ({ record: { articleCommonVO }, column }) => { |
|||
return ['否', '是'][articleCommonVO[column.dataIndex]]; |
|||
}, |
|||
}, |
|||
{ |
|||
title: '上架时间', |
|||
dataIndex: 'publishTime', |
|||
textNumber: 10, |
|||
customRender: ({ record: { articleCommonVO }, column }) => { |
|||
return articleCommonVO[column.dataIndex] || '-'; |
|||
}, |
|||
}, |
|||
{ |
|||
title: '消息来源', |
|||
textNumber: 5, |
|||
dataIndex: 'articleSource', |
|||
customRender: ({ record: { articleCommonVO }, column }) => { |
|||
return articleCommonVO[column.dataIndex]; |
|||
}, |
|||
}, |
|||
{ |
|||
title: '创建人', |
|||
textNumber: 5, |
|||
dataIndex: 'createUserName', |
|||
customRender: ({ record: { articleCommonVO }, column }) => { |
|||
return articleCommonVO[column.dataIndex]; |
|||
}, |
|||
}, |
|||
{ |
|||
title: '创建时间', |
|||
// textNumber: 9, |
|||
dataIndex: 'createTime', |
|||
customRender: ({ record: { articleCommonVO }, column }) => { |
|||
return articleCommonVO[column.dataIndex]; |
|||
}, |
|||
}, |
|||
], |
|||
columnActions: { |
|||
title: '操作', |
|||
autoMergeAction: false, |
|||
actionNumber: 3, |
|||
actions: [ |
|||
{ |
|||
label: '查看', |
|||
name: 'NewsDetail', |
|||
ifShow: ({ articleCommonVO: { articleStatus } }) => [2, 3].includes(articleStatus), |
|||
handle: ({ articleCommonVO: { uuid } }, name) => { |
|||
router.push({ name, query: { uuid } }); |
|||
}, |
|||
}, |
|||
{ |
|||
label: '编辑', |
|||
name: 'NewsEdit', |
|||
ifShow: ({ articleCommonVO: { articleStatus } }) => [1, 6].includes(articleStatus), |
|||
handle: ({ articleCommonVO: { uuid } }, name) => { |
|||
router.push({ name, query: { uuid } }); |
|||
}, |
|||
}, |
|||
{ |
|||
label: '置顶', |
|||
name: 'NewsManageTop', |
|||
confirm: true, |
|||
ifShow: ({ articleCommonVO: { articleStatus, isTop } }) => |
|||
articleStatus == 3 && isTop == 0, |
|||
handle: ({ articleCommonVO: { uuid } }, name) => { |
|||
request('/api/content/objs/admin/cms/bg/article/top', { uuid }); |
|||
}, |
|||
}, |
|||
{ |
|||
label: '取消置顶', |
|||
name: 'NewsManageCancleTop', |
|||
confirm: true, |
|||
ifShow: ({ articleCommonVO: { articleStatus, isTop } }) => |
|||
articleStatus == 3 && isTop == 1, |
|||
handle: ({ articleCommonVO: { uuid } }, name) => { |
|||
request('/api/content/objs/admin/cms/bg/article/top', { uuid }); |
|||
}, |
|||
}, |
|||
{ |
|||
label: '删除', |
|||
dynamicParams: 'uuid', |
|||
name: 'NewsManageDelete', |
|||
confirm: true, |
|||
ifShow: ({ articleCommonVO: { articleStatus } }) => [1, 6].includes(articleStatus), |
|||
handle: ({ articleCommonVO: { uuid } }, name) => { |
|||
request('/api/content/objs/admin/cms/bg/article/batchDel', { uuids: [uuid] }); |
|||
}, |
|||
}, |
|||
{ |
|||
label: '下架', |
|||
dynamicParams: 'uuid', |
|||
name: 'NewsManageReaded', |
|||
confirm: true, |
|||
ifShow: ({ articleCommonVO: { articleStatus } }) => [3].includes(articleStatus), |
|||
handle: ({ articleCommonVO: { uuid } }, name) => { |
|||
request('/api/content/objs/admin/cms/bg/article/withdrawn', { uuid }); |
|||
}, |
|||
}, |
|||
], |
|||
}, |
|||
}; |
|||
return { |
|||
nsTableRef, |
|||
tableConfig, |
|||
}; |
|||
}, |
|||
}); |
|||
</script> |
|||
<style lang="less" scoped></style> |
@ -1,254 +0,0 @@ |
|||
<!-- @format --> |
|||
|
|||
<template> |
|||
<div style="height: 100%"> |
|||
<a-layout style="height: 100%"> |
|||
<a-layout-header class="home_header" style="position: relative"> |
|||
<ns-icon name="login" size="100" style="width: 220px" /> |
|||
</a-layout-header> |
|||
<a-layout-content class="center-content"> |
|||
<div class="lg_card"> |
|||
<h1 class="lg_card_title">账号登录current</h1> |
|||
<p v-show="!errorShow" style="height: 22px"></p> |
|||
<p v-show="errorShow" class="lg_card_error">{{ errorMsg }}</p> |
|||
<a-input |
|||
placeholder="登录账号" |
|||
v-model:value="userName" |
|||
style="height: 48px; margin-bottom: 20px"> |
|||
<template #prefix> |
|||
<ns-icon name="userName" size="25" style="margin-right: 5px" /> |
|||
</template> |
|||
</a-input> |
|||
<a-input-password placeholder="登录密码" v-model:value="password" style="height: 48px"> |
|||
<template #prefix> |
|||
<ns-icon name="passWord" size="25" style="margin-right: 5px" /> |
|||
</template> |
|||
</a-input-password> |
|||
<a-button |
|||
@click="submit" |
|||
:loading="loading" |
|||
type="primary" |
|||
style="margin-top: 30px; width: 100%; height: 53px" |
|||
>登录</a-button |
|||
> |
|||
</div> |
|||
</a-layout-content> |
|||
<a-layout-footer>Copyright 2021 xu科技 All Rights Reserved</a-layout-footer> |
|||
</a-layout> |
|||
</div> |
|||
</template> |
|||
|
|||
<script lang="ts"> |
|||
import { defineComponent, ref } from 'vue'; |
|||
import { useRouter } from 'vue-router'; |
|||
import { appConfigStore } from '/nerv-lib/saas/store/modules/app-config'; |
|||
import { authorizationService } from '/nerv-base/store/modules/authorization-service'; |
|||
import Cookies from 'js-cookie'; |
|||
export default defineComponent({ |
|||
name: 'UserLogin', |
|||
setup() { |
|||
const url = ref('/asset/image/login/background.png'); |
|||
const userName = ref<string>(''); |
|||
const password = ref<string>(''); |
|||
const logUrl = ref<string>(''); |
|||
const bgUrl = ref<string>(''); |
|||
const errorMsg = ref<string>(''); |
|||
const errorShow = ref<boolean>(false); |
|||
const router = useRouter(); |
|||
const title = ref<string>(''); |
|||
const initUrl = ref(''); |
|||
title.value = '账号登录'; |
|||
// title.value = appConfig.title ? appConfig.title : '账号登录'; |
|||
const loading = ref<boolean>(false); |
|||
const configStore = appConfigStore(); |
|||
const useAuthorization = authorizationService(); |
|||
const submit = (): void => { |
|||
if (password.value === '') { |
|||
errorMsg.value = '请输入密码'; |
|||
errorShow.value = true; |
|||
} |
|||
if (userName.value === '') { |
|||
errorMsg.value = '请输入账号'; |
|||
errorShow.value = true; |
|||
} |
|||
if (userName.value !== '' && password.value !== '') { |
|||
errorShow.value = false; |
|||
let data = JSON.stringify({ userName: userName.value, password: password.value }); |
|||
// loading.value = true; |
|||
console.log(data); |
|||
Cookies.set('nervsid', 'mockId'); |
|||
router.push({ |
|||
name: 'AnnouncementsIndex', |
|||
}); |
|||
async function logins() { |
|||
try { |
|||
const res = await configStore.userLogin(JSON.parse(data)); |
|||
if (res.success) { |
|||
if (res.data?.userToken) { |
|||
Cookies.set('nervsid', res.data?.userToken); |
|||
} |
|||
const info = await configStore.userInfo(); |
|||
info.success |
|||
? window.sessionStorage.setItem('userInfo', JSON.stringify(info.data)) |
|||
: ''; |
|||
loading.value = false; |
|||
if (configStore.enablePermissions) { |
|||
const res = await configStore.userResource(); |
|||
initUrl.value = ''; |
|||
const dealInitUrl = (item) => { |
|||
if (item.type === 'menus' && item.menus && item.menus?.length !== 0) { |
|||
dealInitUrl(item.menus[0]); |
|||
} else { |
|||
// if (item.type === 'noChildrenMenu') { |
|||
initUrl.value = configStore.resourceName |
|||
? item.code.replace(configStore.resourceName, '') |
|||
: item.code; |
|||
// } |
|||
} |
|||
}; |
|||
if (configStore.resourceName) { |
|||
const initResource = []; |
|||
res.data.forEach((item) => { |
|||
if (item.code.includes(configStore.resourceName)) { |
|||
initResource.push(item); |
|||
} |
|||
}); |
|||
dealInitUrl(initResource[0]); |
|||
} else { |
|||
dealInitUrl(res.data[0]); |
|||
} |
|||
// dealInitUrl(res.data[0]); |
|||
useAuthorization.updateUserResource(res.data); |
|||
const initRouterList = useAuthorization.getInitRouterList; |
|||
console.log(initUrl.value); |
|||
router.push({ |
|||
name: initRouterList.length === 0 ? 'error403' : initUrl.value, |
|||
}); |
|||
} else { |
|||
router.replace({ name: 'root' }); |
|||
} |
|||
} |
|||
} catch (err) { |
|||
loading.value = false; |
|||
} |
|||
} |
|||
// logins(); |
|||
} |
|||
}; |
|||
const checkoutLogo = (): void => { |
|||
logUrl.value = ''; |
|||
}; |
|||
const checkoutBg = (): void => { |
|||
Math.random() > 0.5 |
|||
? (url.value = 'src/assetimg/background.jpg') |
|||
: (url.value = 'src/assetimg/background.png'); |
|||
}; |
|||
return { |
|||
title, |
|||
url, |
|||
loading, |
|||
userName, |
|||
password, |
|||
submit, |
|||
errorMsg, |
|||
bgUrl, |
|||
logUrl, |
|||
checkoutLogo, |
|||
checkoutBg, |
|||
errorShow, |
|||
}; |
|||
}, |
|||
created() { |
|||
const _this = this; |
|||
window.sessionStorage.clear(); |
|||
document.onkeydown = function (e) { |
|||
const key = window.event === undefined ? e.keyCode : window.event.keyCode; |
|||
key === 13 ? _this.submit() : ''; |
|||
}; |
|||
}, |
|||
beforeUnmount() { |
|||
document.onkeydown = function (e) {}; |
|||
}, |
|||
|
|||
mounted() { |
|||
// if (Cookies.get('nervsid') !== undefined) { |
|||
// this.$router.push('/home'); |
|||
// } |
|||
}, |
|||
}); |
|||
</script> |
|||
|
|||
<style lang="less" scoped> |
|||
.home_header { |
|||
height: 64px !important; |
|||
display: flex; |
|||
align-items: center; |
|||
} |
|||
:deep(.center-content) { |
|||
background: url('/asset/image/login/background.jpg') center center no-repeat; |
|||
background-size: cover; |
|||
|
|||
// background-position-y: -120px; |
|||
margin: 0; |
|||
} |
|||
.icon { |
|||
color: @primary-color; |
|||
// background: #000; |
|||
// min-height: 25px; |
|||
// min-width: 25px; |
|||
// display: flex; |
|||
// justify-content: center; |
|||
// align-items: center; |
|||
// border-radius: 50%; |
|||
} |
|||
.ant-layout-header { |
|||
min-height: 64px; |
|||
background: #fff !important; |
|||
} |
|||
|
|||
.ant-layout-content { |
|||
height: calc(100vh - 112px); |
|||
width: 100%; |
|||
min-height: 400px; |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: flex-end; |
|||
} |
|||
|
|||
.ant-layout-footer { |
|||
max-height: 48px; |
|||
min-height: 48px; |
|||
font-size: 14px; |
|||
font-weight: 400; |
|||
color: #8f8f8f; |
|||
padding: 0; |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: center; |
|||
} |
|||
|
|||
.lg_card { |
|||
width: 385px; |
|||
height: 353px; |
|||
background: #fff; |
|||
box-shadow: 0 2px 2px 0 rgb(0 0 0 / 5%), 0 0 18px 0 rgb(0 0 0 / 8%); |
|||
border-radius: 6px; |
|||
margin: 0 30px 0 30px; |
|||
padding: 35px; |
|||
} |
|||
|
|||
.lg_card .lg_card_title { |
|||
height: 28px; |
|||
font-size: 20px; |
|||
font-weight: bold; |
|||
color: #172e3d; |
|||
line-height: 28px; |
|||
text-align: left; |
|||
} |
|||
|
|||
.lg_card_error { |
|||
text-align: left; |
|||
color: #e4393c; |
|||
font-size: 14px; |
|||
} |
|||
</style> |
@ -1,346 +0,0 @@ |
|||
<!-- @format --> |
|||
|
|||
<template> |
|||
<my-add-form |
|||
formLayout="vertical" |
|||
:schemas="formSchema" |
|||
:model="data" |
|||
:title="uuid ? `${versionArr[platformId]}版本编辑` : `${versionArr[platformId]}发版`" |
|||
:api=" |
|||
uuid |
|||
? '/api/op_com/objs/admin/VersionConfigOper/updateVersionConfig' |
|||
: '/api/op_com/objs/admin/VersionConfigOper/addVersionConfig' |
|||
" /> |
|||
</template> |
|||
<script lang="ts"> |
|||
import { defineComponent, reactive, ref, provide } from 'vue'; |
|||
import { useRouter } from 'vue-router'; |
|||
import upFile from './components/uploadFile.vue'; |
|||
import { http } from '/nerv-lib/util/http'; |
|||
|
|||
import myAddForm from './components/add-form.vue'; |
|||
export default defineComponent({ |
|||
name: 'SoftwareVersionManageAdd', |
|||
components: { |
|||
myAddForm, |
|||
}, |
|||
setup() { |
|||
provide('components', () => { |
|||
return { upFile }; |
|||
}); |
|||
const data = ref({}); |
|||
const router = useRouter(); |
|||
const { title, uuid, platformId } = router.currentRoute.value.query; |
|||
if (platformId == 3) { |
|||
setTimeout(() => { |
|||
// H5 |
|||
data.value.updateFlag = 0; |
|||
data.value.versionState = 0; |
|||
}, 10); |
|||
} |
|||
const versionArr = ['', 'Android', 'IOS', 'H5']; |
|||
const formSchema = ref(); |
|||
const fileList = ref(); |
|||
const request = () => { |
|||
return new Promise((resolve, reject) => { |
|||
http |
|||
.get('/api/op_com/objs/admin/VersionConfigOper/queryVersionUpgradeConfigInfo', { uuid }) |
|||
.then((res) => { |
|||
const detail = res.data; |
|||
|
|||
resolve(detail); |
|||
}) |
|||
.catch((err) => { |
|||
reject(err); |
|||
}); |
|||
}); |
|||
}; |
|||
let formSchemaDetail = [ |
|||
{ |
|||
field: 'platformId', |
|||
defaultValue: platformId, |
|||
}, |
|||
{ |
|||
field: 'uuid', |
|||
defaultValue: uuid, |
|||
}, |
|||
|
|||
{ |
|||
field: 'appName', |
|||
label: '软件名称', |
|||
component: 'NsInput', |
|||
|
|||
componentProps: { |
|||
placeholder: '请输入', |
|||
// 禁止输入 |
|||
// disabled: true, |
|||
}, |
|||
rules: [ |
|||
{ |
|||
pattern: /^.{1,20}$/, |
|||
message: '支持1-20个字符', |
|||
trigger: 'blur', |
|||
}, |
|||
{ |
|||
required: true, |
|||
message: '请输入软件名称', |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
field: 'versionCode', |
|||
label: '版本号', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
placeholder: '请输入', |
|||
}, |
|||
rules: [ |
|||
{ |
|||
pattern: /^.{1,20}$/, |
|||
message: '支持1-20个字符', |
|||
trigger: 'blur', |
|||
}, |
|||
{ |
|||
required: true, |
|||
message: '请输入版本号', |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
field: 'downSource', |
|||
label: '下载方式', |
|||
component: 'NsSelect', |
|||
ifShow: () => platformId == 1, |
|||
defaultValue: 1, |
|||
componentProps: { |
|||
placeholder: '请选择', |
|||
options: [ |
|||
{ label: '浏览器下载', value: 0 }, |
|||
{ label: '应用商城下载', value: 1 }, |
|||
{ label: '应用内下载', value: 2 }, |
|||
], |
|||
}, |
|||
}, |
|||
// 安卓 |
|||
{ |
|||
field: 'file', |
|||
label: '安装包', |
|||
component: 'upFile', |
|||
ifShow: () => platformId == 1, |
|||
componentProps: { |
|||
placeholder: '请输入', |
|||
fileName: fileList, |
|||
// 禁止输入 |
|||
// disabled: true, |
|||
}, |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: '请上传安装包', |
|||
type: 'object', |
|||
trigger: 'change', |
|||
}, |
|||
// { |
|||
// validator: (value, b) => { |
|||
// console.log(value, b); |
|||
// }, |
|||
// }, |
|||
], |
|||
}, |
|||
// ios |
|||
{ |
|||
field: 'downUrl', |
|||
label: '下载地址', |
|||
component: 'NsInput', |
|||
ifShow: () => platformId != 1, |
|||
componentProps: { |
|||
placeholder: '请输入', |
|||
// 禁止输入 |
|||
// disabled: true, |
|||
}, |
|||
// rules: [ |
|||
// // { |
|||
// // pattern: /^.{1,20}$/, |
|||
// // message: '支持1-20个字符', |
|||
// // trigger: 'blur', |
|||
// // }, |
|||
// // { |
|||
// // required: true, |
|||
// // message: '请输入下载地址', |
|||
// // trigger: 'change', |
|||
// // }, |
|||
// ], |
|||
}, |
|||
// 安卓 |
|||
{ |
|||
field: 'md5', |
|||
label: 'MD5码', |
|||
defaultValue: 'defaultMD5', |
|||
component: 'NsInput', |
|||
show: false, |
|||
componentProps: { |
|||
placeholder: '请输入', |
|||
// 禁止输入 |
|||
// disabled: true, |
|||
}, |
|||
rules: [ |
|||
// { |
|||
// required: true, |
|||
// message: '请填写MD5码', |
|||
// trigger: 'change', |
|||
// }, |
|||
{ |
|||
pattern: /^.{1,64}$/, |
|||
message: '支持1-64个字符', |
|||
trigger: 'blur', |
|||
}, |
|||
], |
|||
}, |
|||
// 安卓 |
|||
{ |
|||
field: 'uniqueCode', |
|||
label: '唯一code', |
|||
component: 'NsInput', |
|||
show: false, |
|||
defaultValue: 'com.yidingyun.lowcodeapp', |
|||
// componentProps: { |
|||
// placeholder: '请输入', |
|||
// // 禁止输入 |
|||
// // disabled: true, |
|||
// }, |
|||
// rules: [ |
|||
// { |
|||
// required: true, |
|||
// message: '请填写唯一code', |
|||
// trigger: 'change', |
|||
// }, |
|||
// { |
|||
// pattern: /^.{1,64}$/, |
|||
// message: '支持1-64个字符', |
|||
// trigger: 'blur', |
|||
// }, |
|||
// ], |
|||
}, |
|||
|
|||
{ |
|||
field: 'updateFlag', |
|||
label: '是否需要更新', |
|||
component: 'NsRadioGroup', |
|||
defaultValue: 0, |
|||
componentProps: { |
|||
radioType: 'radio', |
|||
options: [ |
|||
{ label: '是', value: 1 }, |
|||
{ label: '否', value: 0 }, |
|||
], |
|||
}, |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: '请选择是否需要更新', |
|||
type: 'number', |
|||
trigger: 'change', |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
field: 'updateType', |
|||
label: '更新类型', |
|||
component: 'NsRadioGroup', |
|||
defaultValue: 0, |
|||
show: (a) => { |
|||
if (a.updateFlag) { |
|||
return true; |
|||
} |
|||
return false; |
|||
}, |
|||
componentProps: { |
|||
radioType: 'radio', |
|||
options: [ |
|||
{ label: '强制更新', value: 1 }, |
|||
{ label: '建议更新', value: 0 }, |
|||
], |
|||
// disabled: uuid && true, |
|||
}, |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: '请选择更新类型', |
|||
type: 'number', |
|||
trigger: 'blur', |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
field: 'versionState', |
|||
label: '是否最新版本', |
|||
defaultValue: 0, |
|||
component: 'NsRadioGroup', |
|||
componentProps: { |
|||
radioType: 'radio', |
|||
options: [ |
|||
{ label: '是', value: 1 }, |
|||
{ label: '否', value: 0 }, |
|||
], |
|||
}, |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: '请选择是否最新版本', |
|||
type: 'number', |
|||
trigger: 'blur', |
|||
}, |
|||
], |
|||
}, |
|||
|
|||
{ |
|||
field: 'upgradeTips', |
|||
label: '更新日志', |
|||
component: 'NsTextarea', |
|||
extra: 'tips:不同版本下载地址相同', |
|||
componentProps: { |
|||
placeholder: '请输入更新日志,限300字符', |
|||
showCount: true, |
|||
maxlength: 300, |
|||
// maxLength: 10, |
|||
// 禁止输入 |
|||
// disabled: true, |
|||
// 阻止回车默认事件 |
|||
onPressEnter: (e) => { |
|||
e.preventDefault(); |
|||
}, |
|||
}, |
|||
rules: [ |
|||
// { |
|||
// required: true, |
|||
// message: '请输入更新日志,限300字符', |
|||
// trigger: 'blur', |
|||
// }, |
|||
{ |
|||
pattern: /^.{1,300}$/, |
|||
message: '长度不得超过个300字符', |
|||
trigger: 'blur', |
|||
}, |
|||
], |
|||
}, |
|||
]; |
|||
if (uuid) { |
|||
request().then((res: any) => { |
|||
data.value = res; |
|||
fileList.value = data.value.appPackageName; |
|||
formSchema.value = Object.assign([], formSchemaDetail); |
|||
}); |
|||
} else { |
|||
formSchema.value = Object.assign([], formSchemaDetail); |
|||
} |
|||
|
|||
return { |
|||
formSchema, |
|||
data, |
|||
uuid, |
|||
platformId, |
|||
versionArr, |
|||
}; |
|||
}, |
|||
}); |
|||
</script> |
@ -1,135 +0,0 @@ |
|||
<!-- @format --> |
|||
|
|||
<template> |
|||
<a-spin :spinning="isLoading"> |
|||
<ns-page-header class="ns-page-header" :title="title"> |
|||
<template #extra> |
|||
<!-- todo 隐藏取消--> |
|||
<a-button @click="navigateBack">返回</a-button> |
|||
<a-button |
|||
style="margin-left: 10px" |
|||
type="primary" |
|||
:disabled="validateResult" |
|||
@click="submit" |
|||
>保存</a-button |
|||
> |
|||
</template> |
|||
</ns-page-header> |
|||
<div class="ns-add-form"> |
|||
<ns-form ref="mainRef" v-bind="getBindValue"> |
|||
<template #[item]="data" v-for="item in Object.keys($slots)"> |
|||
<slot :name="item" v-bind="data || {}"></slot> |
|||
</template> |
|||
</ns-form> |
|||
</div> |
|||
</a-spin> |
|||
</template> |
|||
|
|||
<script lang="ts"> |
|||
import { computed, defineComponent, ref } from 'vue'; |
|||
import { http } from '/nerv-lib/util/http'; |
|||
import { NsMessage } from '/nerv-lib/component/message'; |
|||
import { useRouter } from 'vue-router'; |
|||
import { useNavigate } from '/nerv-lib/use/use-navigate'; |
|||
|
|||
export default defineComponent({ |
|||
name: 'NsViewAddForm', |
|||
props: { |
|||
api: { |
|||
type: String, |
|||
required: true, |
|||
}, |
|||
title: String, |
|||
params: { |
|||
type: Object, |
|||
default: () => ({}), |
|||
}, |
|||
data: { |
|||
type: Object, |
|||
default: () => ({}), |
|||
}, |
|||
}, |
|||
setup(props, { attrs }) { |
|||
const mainRef = ref(); |
|||
const isLoading = ref(false); |
|||
const { navigateBack } = useNavigate(); |
|||
|
|||
const getBindValue = computed(() => ({ |
|||
...attrs, |
|||
...props, |
|||
})); |
|||
|
|||
const validateResult = computed(() => { |
|||
return !mainRef.value?.validateResult; |
|||
}); |
|||
function submit() { |
|||
mainRef.value |
|||
.triggerSubmit() |
|||
.then((data: any) => { |
|||
isLoading.value = true; |
|||
const config = { |
|||
headers: { |
|||
'Content-Type': 'multipart/form-data', |
|||
}, |
|||
|
|||
// params: params, |
|||
}; |
|||
console.log('myadd', data); |
|||
if (data.file && data.file.uid === '-1') { |
|||
data.file = null; |
|||
} |
|||
const formData = new FormData(); |
|||
Object.keys(data).map((item) => { |
|||
if (String(data[item]) !== 'null' && data[item] !== undefined) |
|||
formData.append(item, data[item]); |
|||
}); |
|||
// data.file. |
|||
http |
|||
.post(props.api, formData, config) |
|||
.then(() => { |
|||
isLoading.value = false; |
|||
NsMessage.success('操作成功', 1, () => { |
|||
navigateBack(); |
|||
}); |
|||
}) |
|||
.catch(() => { |
|||
isLoading.value = false; |
|||
}); |
|||
}) |
|||
.catch(() => { |
|||
isLoading.value = false; |
|||
}); |
|||
} |
|||
|
|||
return { mainRef, submit, getBindValue, isLoading, navigateBack, validateResult }; |
|||
}, |
|||
}); |
|||
</script> |
|||
<style lang="less" scoped> |
|||
//.ns-page-header { |
|||
// margin: 0px 16px 20px 0; |
|||
// border-bottom: 1px solid #f0f2f5; |
|||
//} |
|||
.ns-add-form .ns-vertical-form { |
|||
max-width: 600px; |
|||
margin: 0 auto; |
|||
min-width: 500px; |
|||
} |
|||
:deep(.ant-spin-nested-loading) { |
|||
height: 100%; |
|||
} |
|||
.ant-spin-nested-loading { |
|||
height: 100%; |
|||
} |
|||
// :deep(.ant-spin-container) { |
|||
// height: 100%; |
|||
// overflow: hidden; |
|||
// } |
|||
:deep(.ns-add-form) { |
|||
// height: calc(100% - 83px) !important; |
|||
overflow: auto; |
|||
} |
|||
:deep(.ns-form)::after { |
|||
height: 0; |
|||
} |
|||
</style> |
@ -1,95 +0,0 @@ |
|||
<!-- @format --> |
|||
|
|||
<template> |
|||
<div class="clearfix"> |
|||
<a-form enctype="multipart/form-data"> |
|||
<a-upload |
|||
:file-list="fileList" |
|||
@remove="handleRemove" |
|||
:before-upload="beforeUpload" |
|||
:customRequest="() => {}"> |
|||
<a-button> |
|||
<upload-outlined /> |
|||
文件上传 |
|||
</a-button> |
|||
</a-upload> |
|||
</a-form> |
|||
</div> |
|||
</template> |
|||
<script lang="ts"> |
|||
import { UploadOutlined } from '@ant-design/icons-vue'; |
|||
import { defineComponent, ref, watch } from 'vue'; |
|||
import type { UploadProps } from 'ant-design-vue'; |
|||
|
|||
export default defineComponent({ |
|||
components: { |
|||
UploadOutlined, |
|||
}, |
|||
props: { |
|||
fileName: { |
|||
type: String, |
|||
}, |
|||
}, |
|||
emits: ['change'], |
|||
setup(props, { emit, attrs }) { |
|||
console.log(props, attrs); |
|||
const fileList = ref<UploadProps['fileList']>([]); |
|||
if (props.fileName) { |
|||
(fileList.value[0] = { |
|||
uid: '-1', |
|||
name: props.fileName, |
|||
status: 'done', |
|||
}), |
|||
emit('change', fileList.value[0]); |
|||
} |
|||
const uploading = ref<boolean>(false); |
|||
|
|||
const handleRemove: UploadProps['onRemove'] = (file) => { |
|||
const index = fileList.value.indexOf(file); |
|||
const newFileList = fileList.value.slice(); |
|||
newFileList.splice(index, 1); |
|||
fileList.value = newFileList; |
|||
emit('change', fileList.value[0]); |
|||
}; |
|||
|
|||
const beforeUpload: UploadProps['beforeUpload'] = async (file) => { |
|||
fileList.value = [file]; |
|||
// fileList.value.push(await getBase64(file)); |
|||
// const formData = new FormData(); |
|||
// fileList.value.forEach((file: UploadProps['fileList'][number]) => { |
|||
// formData.append('file', file); |
|||
// formData.set('aaaaa', 'basbdbsadas'); |
|||
// }); |
|||
// uploading.value = true; |
|||
// console.log('forma', file); |
|||
emit('change', file); |
|||
// return false; |
|||
}; |
|||
|
|||
const handleUpload = () => { |
|||
// You can use any AJAX library you like |
|||
// request('https://www.mocky.io/v2/5cc8019d300000980a055e76', { |
|||
// method: 'post', |
|||
// data: formData, |
|||
// }) |
|||
// .then(() => { |
|||
// fileList.value = []; |
|||
// uploading.value = false; |
|||
// message.success('upload successfully.'); |
|||
// }) |
|||
// .catch(() => { |
|||
// uploading.value = false; |
|||
// message.error('upload failed.'); |
|||
// }); |
|||
}; |
|||
|
|||
return { |
|||
fileList, |
|||
uploading, |
|||
handleRemove, |
|||
beforeUpload, |
|||
handleUpload, |
|||
}; |
|||
}, |
|||
}); |
|||
</script> |
@ -1,85 +0,0 @@ |
|||
<!-- @format --> |
|||
|
|||
<template> |
|||
<ns-view-detail |
|||
title="查看详情" |
|||
api="/api/op_com/objs/admin/VersionConfigOper/queryVersionUpgradeConfigInfo" |
|||
:detail="detail" /> |
|||
</template> |
|||
<script lang="ts"> |
|||
import { defineComponent } from 'vue'; |
|||
import { dateUtil } from '/nerv-lib/util/date-util'; |
|||
import { useRouter } from 'vue-router'; |
|||
export default defineComponent({ |
|||
name: 'SoftwareVersionManageDetail', |
|||
setup() { |
|||
const router = useRouter(); |
|||
const { platformId } = router.currentRoute.value.query; |
|||
const detail = [ |
|||
{ |
|||
title: '基本信息', |
|||
items: [ |
|||
{ |
|||
label: '软件名称', |
|||
name: 'appName', |
|||
}, |
|||
{ |
|||
label: '版本号', |
|||
name: 'versionCode', |
|||
}, |
|||
{ |
|||
name: 'downUrl', |
|||
label: '下载地址', |
|||
}, |
|||
{ |
|||
label: '安装包', |
|||
name: 'appPackageName', |
|||
ifShow: ({ platformId }) => platformId == 1, |
|||
}, |
|||
{ |
|||
label: '下载方式', |
|||
name: 'downSource', |
|||
ifShow: ({ platformId }) => platformId == 1, |
|||
format: (value) => ['浏览器下载', '应用商城下载', '应用内下载'][value], |
|||
}, |
|||
// { |
|||
// name: 'md5', |
|||
// label: 'MD5码', |
|||
// }, |
|||
// { |
|||
// name: 'uniqueCode', |
|||
// label: '唯一code', |
|||
// }, |
|||
{ |
|||
name: 'updateFlag', |
|||
label: '是否需要更新', |
|||
format: (value, data) => { |
|||
return ['否', '是'][value]; |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'updateType', |
|||
label: '更新类型', |
|||
format: (value, data) => { |
|||
return ['建议更新', '强制更新'][value]; |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'versionState', |
|||
label: '是否最新版本', |
|||
format: (value, data) => { |
|||
return ['否', '是'][value]; |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'upgradeTips', |
|||
label: '更新日志', |
|||
}, |
|||
], |
|||
}, |
|||
]; |
|||
|
|||
return { detail }; |
|||
}, |
|||
}); |
|||
</script> |
@ -1,656 +0,0 @@ |
|||
<!-- @format --> |
|||
|
|||
<template> |
|||
<div> |
|||
<a-tabs default-active-key="0"> |
|||
<a-tab-pane v-for="(item, index) in tabPaneList" :key="index" :tab="item.title"> |
|||
<ns-view-list-table :model="data" v-bind="item.bindData" /> |
|||
</a-tab-pane> |
|||
</a-tabs> |
|||
<ns-modal |
|||
v-model:visible="qrcodeVisible" |
|||
title="查看二维码" |
|||
:centered="true" |
|||
style="text-align: center" |
|||
:width="230" |
|||
:footer="null"> |
|||
<qrcode-vue size="150" :value="qrCodeUrl" /> |
|||
</ns-modal> |
|||
</div> |
|||
</template> |
|||
<script lang="ts"> |
|||
import { defineComponent, reactive, ref } from 'vue'; |
|||
import { useRouter } from 'vue-router'; |
|||
import { dateUtil } from '/nerv-lib/util/date-util'; |
|||
import { NsMessage } from '/nerv-lib/component/message'; |
|||
import QrcodeVue from 'qrcode.vue'; |
|||
import Cookies from 'js-cookie'; |
|||
|
|||
export default defineComponent({ |
|||
name: 'AppVersionManageIndex', |
|||
components: { QrcodeVue }, |
|||
setup() { |
|||
const data = reactive({}); |
|||
const router = useRouter(); |
|||
const platformId = ref([, 'Android', 'IOS', 'H5']); |
|||
const qrCodeUrl = ref(''); |
|||
const qrcodeVisible = ref(false); |
|||
const openDownloadDialog = (url, saveName) => { |
|||
let aLink = document.createElement('a'); |
|||
aLink.href = url; |
|||
aLink.download = saveName || ''; // HTML5新增的属性,指定保存文件名,可以不要后缀,注意,file:///模式下不会生效 |
|||
document.body.appendChild(aLink); |
|||
aLink.click(); |
|||
document.body.removeChild(aLink); |
|||
}; |
|||
// 动态修改编辑页title |
|||
const handle = (a, title) => { |
|||
if (title == 'AppVersionDownload') { |
|||
if (a.downUrl) { |
|||
openDownloadDialog(a.downUrl, a.appPackageName); |
|||
} else { |
|||
NsMessage.warning('暂无下载地址', 1); |
|||
} |
|||
return; |
|||
} |
|||
router.push({ |
|||
name: 'AppVersionManageAdd', |
|||
query: { |
|||
title, |
|||
platformId: title == 'AndroidRelease' ? 1 : title == 'IOSRelease' ? 2 : 3, |
|||
}, |
|||
}); |
|||
}; |
|||
|
|||
const tableConfigAndroid = { |
|||
title: 'Android版本管理', |
|||
api: '/api/op_com/objs/admin/VersionConfigOper/queryVersionUpgradeConfigList', |
|||
headerActions: [ |
|||
{ |
|||
label: 'Android发版', |
|||
name: 'AndroidRelease', |
|||
type: 'primary', |
|||
handle, |
|||
}, |
|||
], |
|||
params: { |
|||
page: 0, |
|||
pageSize: 10, |
|||
platformId: 1, |
|||
}, |
|||
rowSelection: null, |
|||
columns: [ |
|||
{ |
|||
title: '软件名称', |
|||
textNumber: 8, |
|||
textEllipsis: true, |
|||
dataIndex: 'appName', |
|||
}, |
|||
{ |
|||
title: '版本号', |
|||
textNumber: 5, |
|||
dataIndex: 'versionCode', |
|||
}, |
|||
{ |
|||
title: '下载方式', |
|||
textNumber: 6, |
|||
dataIndex: 'downSource', |
|||
customRender: ({ value }) => { |
|||
return ['浏览器下载', '应用商城下载', '应用内下载'][value]; |
|||
}, |
|||
}, |
|||
{ |
|||
title: '安装包名', |
|||
textNumber: 10, |
|||
textEllipsis: true, |
|||
dataIndex: 'appPackageName', |
|||
}, |
|||
{ |
|||
title: '是否最新版本', |
|||
textNumber: 7, |
|||
dataIndex: 'versionState', |
|||
customRender: ({ value }) => { |
|||
return ['否', '是'][value]; |
|||
}, |
|||
}, |
|||
{ |
|||
title: '更新类型', |
|||
textNumber: 5, |
|||
dataIndex: 'versionUpdateType', |
|||
customRender: ({ value }) => { |
|||
return ['无需更新', '建议更新', '强制更新'][value]; |
|||
}, |
|||
}, |
|||
|
|||
{ |
|||
title: '发布时间', |
|||
textNumber: 8, |
|||
dataIndex: 'updateTime', |
|||
customRender: ({ value }) => { |
|||
return dateUtil(value).format('YYYY-MM-DD HH:mm:ss'); |
|||
}, |
|||
}, |
|||
{ |
|||
title: '操作人', |
|||
textNumber: 5, |
|||
dataIndex: 'updateUser', |
|||
}, |
|||
], |
|||
columnActions: { |
|||
title: '操作', |
|||
actions: [ |
|||
{ |
|||
label: '查看', |
|||
dynamicParams: ['uuid', 'platformId'], |
|||
name: 'AppVersionManageIndexDetail', |
|||
route: '/contentManage/systemManage/appVersionManage/detail', |
|||
}, |
|||
{ |
|||
label: '修改更新类型', |
|||
dynamicParams: 'uuid', |
|||
name: 'AppVersionChange', |
|||
// handle: viewHandle, |
|||
children: [ |
|||
{ |
|||
label: '无需更新', |
|||
dynamicParams: 'uuid', |
|||
defaultParams: { |
|||
versionUpdateType: 0, |
|||
}, |
|||
isReload: true, |
|||
confirm: true, |
|||
name: 'AppVersionChange', |
|||
api: '/api/op_com/objs/admin/VersionConfigOper/setVersionUpdateType', |
|||
}, |
|||
{ |
|||
label: '建议更新', |
|||
dynamicParams: 'uuid', |
|||
name: 'AppVersionChange', |
|||
defaultParams: { |
|||
versionUpdateType: 1, |
|||
}, |
|||
isReload: true, |
|||
confirm: true, |
|||
api: '/api/op_com/objs/admin/VersionConfigOper/setVersionUpdateType', |
|||
}, |
|||
{ |
|||
label: '强制更新', |
|||
dynamicParams: 'uuid', |
|||
name: 'AppVersionChange', |
|||
defaultParams: { |
|||
versionUpdateType: 2, |
|||
}, |
|||
isReload: true, |
|||
confirm: true, |
|||
api: '/api/op_com/objs/admin/VersionConfigOper/setVersionUpdateType', |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
label: '编辑', |
|||
dynamicParams: ['uuid', 'platformId'], |
|||
name: 'AppVersionManageEdit', |
|||
route: '/contentManage/systemManage/appVersionManage/edit', |
|||
}, |
|||
{ |
|||
label: '下载', |
|||
name: 'AppVersionDownload', |
|||
handle, |
|||
}, |
|||
{ |
|||
label: '查看二维码', |
|||
name: 'AppVersionQrCodeUrl', |
|||
handle: ({ downUrl }) => { |
|||
if (!downUrl) { |
|||
NsMessage.warning('暂无二维码', 1); |
|||
return; |
|||
} |
|||
qrCodeUrl.value = downUrl; |
|||
qrcodeVisible.value = true; |
|||
}, |
|||
}, |
|||
{ |
|||
label: '删除', |
|||
dynamicParams: { |
|||
uuid: 'uuid', |
|||
}, |
|||
name: 'AppVersionDelete', |
|||
confirm: true, |
|||
isReload: true, |
|||
api: '/api/op_com/objs/admin/VersionConfigOper/deleteVersionConfig', |
|||
}, |
|||
], |
|||
}, |
|||
|
|||
formConfig: { |
|||
schemas: [ |
|||
{ |
|||
field: 'appName', |
|||
label: '软件名称', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
placeholder: '请输入', |
|||
}, |
|||
}, |
|||
{ |
|||
field: 'versionCode', |
|||
label: '版本号', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
placeholder: '请输入', |
|||
}, |
|||
}, |
|||
{ |
|||
field: 'time', |
|||
label: '发布时间', |
|||
component: 'NsRangePicker', |
|||
fieldMap: ['startTime', 'endTime'], |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD', |
|||
format: 'YYYY-MM-DD', |
|||
}, |
|||
}, |
|||
], |
|||
params: {}, |
|||
}, |
|||
rowKey: 'uuid', |
|||
}; |
|||
const tableConfigIOS = { |
|||
title: 'IOS版本管理', |
|||
api: '/api/op_com/objs/admin/VersionConfigOper/queryVersionUpgradeConfigList', |
|||
headerActions: [ |
|||
{ |
|||
label: 'IOS发版', |
|||
name: 'IOSRelease', |
|||
type: 'primary', |
|||
handle, |
|||
}, |
|||
], |
|||
rowSelection: null, |
|||
params: { |
|||
page: 0, |
|||
pageSize: 10, |
|||
platformId: 2, |
|||
}, |
|||
columns: [ |
|||
{ |
|||
title: '软件名称', |
|||
textNumber: 8, |
|||
textEllipsis: true, |
|||
dataIndex: 'appName', |
|||
}, |
|||
{ |
|||
title: '版本号', |
|||
textNumber: 5, |
|||
|
|||
dataIndex: 'versionCode', |
|||
}, |
|||
|
|||
{ |
|||
title: '下载地址', |
|||
textNumber: 8, |
|||
dataIndex: 'downUrl', |
|||
textEllipsis: true, |
|||
}, |
|||
{ |
|||
title: '是否最新版本', |
|||
textNumber: 7, |
|||
dataIndex: 'versionState', |
|||
customRender: ({ value }) => { |
|||
return ['否', '是'][value]; |
|||
}, |
|||
}, |
|||
{ |
|||
title: '更新类型', |
|||
textNumber: 5, |
|||
dataIndex: 'versionUpdateType', |
|||
customRender: ({ value }) => { |
|||
return ['无需更新', '建议更新', '强制更新'][value]; |
|||
}, |
|||
}, |
|||
|
|||
{ |
|||
title: '发布时间', |
|||
textNumber: 9, |
|||
dataIndex: 'updateTime', |
|||
customRender: ({ value }) => { |
|||
return dateUtil(value).format('YYYY-MM-DD HH:mm:ss'); |
|||
}, |
|||
}, |
|||
{ |
|||
title: '操作人', |
|||
textNumber: 5, |
|||
|
|||
dataIndex: 'updateUser', |
|||
}, |
|||
], |
|||
columnActions: { |
|||
title: '操作', |
|||
// width: 220, |
|||
// autoMergeAction: false, |
|||
actions: [ |
|||
{ |
|||
label: '查看', |
|||
dynamicParams: ['uuid', 'platformId'], |
|||
name: 'AppVersionManageIndexDetail', |
|||
route: '/contentManage/systemManage/appVersionManage/detail', |
|||
}, |
|||
{ |
|||
label: '修改更新类型', |
|||
dynamicParams: 'uuid', |
|||
name: 'AppVersionIOSChange', |
|||
// handle: viewHandle, |
|||
children: [ |
|||
{ |
|||
label: '无需更新', |
|||
dynamicParams: 'uuid', |
|||
defaultParams: { |
|||
versionUpdateType: 0, |
|||
}, |
|||
name: 'AppVersionIOSChange', |
|||
isReload: true, |
|||
confirm: true, |
|||
|
|||
api: '/api/op_com/objs/admin/VersionConfigOper/setVersionUpdateType', |
|||
}, |
|||
{ |
|||
label: '建议更新', |
|||
dynamicParams: 'uuid', |
|||
name: 'AppVersionIOSChange', |
|||
defaultParams: { |
|||
versionUpdateType: 1, |
|||
}, |
|||
isReload: true, |
|||
confirm: true, |
|||
|
|||
api: '/api/op_com/objs/admin/VersionConfigOper/setVersionUpdateType', |
|||
}, |
|||
{ |
|||
label: '强制更新', |
|||
dynamicParams: 'uuid', |
|||
name: 'AppVersionIOSChange', |
|||
defaultParams: { |
|||
versionUpdateType: 2, |
|||
}, |
|||
isReload: true, |
|||
confirm: true, |
|||
api: '/api/op_com/objs/admin/VersionConfigOper/setVersionUpdateType', |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
label: '编辑', |
|||
dynamicParams: ['uuid', 'platformId'], |
|||
name: 'AppVersionManageIOSEdit', |
|||
route: '/contentManage/systemManage/appVersionManage/edit', |
|||
// ifShow: (record) => { |
|||
// return record.reserveStatus === 0; |
|||
// }, |
|||
}, |
|||
{ |
|||
label: '查看二维码', |
|||
name: 'AppVersionQrCodeUrl', |
|||
handle: ({ downUrl }) => { |
|||
if (!downUrl) { |
|||
NsMessage.warning('暂无二维码', 1); |
|||
return; |
|||
} |
|||
qrCodeUrl.value = downUrl; |
|||
qrcodeVisible.value = true; |
|||
}, |
|||
}, |
|||
{ |
|||
label: '删除', |
|||
dynamicParams: { |
|||
uuid: 'uuid', |
|||
}, |
|||
name: 'AppVersionIOSDelete', |
|||
confirm: true, |
|||
isReload: true, |
|||
// ifShow: (record) => { |
|||
// return record.reserveStatus === 0; |
|||
// }, |
|||
api: '/api/op_com/objs/admin/VersionConfigOper/deleteVersionConfig', |
|||
}, |
|||
], |
|||
}, |
|||
|
|||
formConfig: { |
|||
schemas: [ |
|||
{ |
|||
field: 'appName', |
|||
label: '软件名称', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
placeholder: '请输入', |
|||
}, |
|||
}, |
|||
{ |
|||
field: 'versionCode', |
|||
label: '版本号', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
placeholder: '请输入', |
|||
}, |
|||
}, |
|||
{ |
|||
field: 'time', |
|||
label: '发布时间', |
|||
component: 'NsRangePicker', |
|||
fieldMap: ['startTime', 'endTime'], |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD', |
|||
format: 'YYYY-MM-DD', |
|||
}, |
|||
}, |
|||
], |
|||
params: {}, |
|||
}, |
|||
rowKey: 'uuid', |
|||
}; |
|||
const tableConfigH5 = { |
|||
title: '应用内容版本管理', |
|||
api: '/api/op_com/objs/admin/VersionConfigOper/queryVersionUpgradeConfigList', |
|||
headerActions: [ |
|||
{ |
|||
label: '应用内容发版', |
|||
name: 'H5Release', |
|||
type: 'primary', |
|||
handle, |
|||
// route: '/contentManage/systemManage/appVersionManage/add', |
|||
}, |
|||
], |
|||
rowSelection: null, |
|||
// scroll: { x: 1550 }, |
|||
params: { |
|||
page: 0, |
|||
pageSize: 10, |
|||
platformId: 3, |
|||
}, |
|||
columns: [ |
|||
{ |
|||
title: '软件名称', |
|||
textNumber: 6, |
|||
textEllipsis: true, |
|||
dataIndex: 'appName', |
|||
}, |
|||
{ |
|||
title: '版本号', |
|||
textNumber: 4, |
|||
dataIndex: 'versionCode', |
|||
}, |
|||
{ |
|||
title: '下载地址', |
|||
textNumber: 10, |
|||
dataIndex: 'downUrl', |
|||
textEllipsis: true, |
|||
}, |
|||
{ |
|||
title: '是否最新版本', |
|||
textNumber: 7, |
|||
dataIndex: 'versionState', |
|||
customRender: ({ value }) => { |
|||
return ['否', '是'][value]; |
|||
}, |
|||
}, |
|||
{ |
|||
title: '更新类型', |
|||
textNumber: 5, |
|||
dataIndex: 'versionUpdateType', |
|||
customRender: ({ value }) => { |
|||
return ['无需更新', '建议更新', '强制更新'][value]; |
|||
}, |
|||
}, |
|||
|
|||
{ |
|||
title: '发布时间', |
|||
// textNumber: 9, |
|||
dataIndex: 'updateTime', |
|||
customRender: ({ value }) => { |
|||
return dateUtil(value).format('YYYY-MM-DD HH:mm:ss'); |
|||
}, |
|||
}, |
|||
{ |
|||
title: '操作人', |
|||
textNumber: 5, |
|||
dataIndex: 'updateUser', |
|||
}, |
|||
], |
|||
columnActions: { |
|||
title: '操作', |
|||
// width: 220, |
|||
actions: [ |
|||
{ |
|||
label: '查看', |
|||
dynamicParams: ['uuid', 'platformId'], |
|||
name: 'AppVersionManageIndexDetail', |
|||
route: '/contentManage/systemManage/appVersionManage/detail', |
|||
}, |
|||
{ |
|||
label: '修改更新类型', |
|||
dynamicParams: 'uuid', |
|||
name: 'AppVersionH5Change', |
|||
children: [ |
|||
{ |
|||
label: '无需更新', |
|||
dynamicParams: 'uuid', |
|||
defaultParams: { |
|||
versionUpdateType: 0, |
|||
}, |
|||
name: 'AppVersionH5Change', |
|||
confirm: true, |
|||
isReload: true, |
|||
api: '/api/op_com/objs/admin/VersionConfigOper/setVersionUpdateType', |
|||
}, |
|||
{ |
|||
label: '建议更新', |
|||
dynamicParams: 'uuid', |
|||
name: 'AppVersionH5Change', |
|||
defaultParams: { |
|||
versionUpdateType: 1, |
|||
}, |
|||
confirm: true, |
|||
isReload: true, |
|||
api: '/api/op_com/objs/admin/VersionConfigOper/setVersionUpdateType', |
|||
}, |
|||
{ |
|||
label: '强制更新', |
|||
dynamicParams: 'uuid', |
|||
name: 'AppVersionH5Change', |
|||
defaultParams: { |
|||
versionUpdateType: 2, |
|||
}, |
|||
confirm: true, |
|||
isReload: true, |
|||
api: '/api/op_com/objs/admin/VersionConfigOper/setVersionUpdateType', |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
label: '编辑', |
|||
dynamicParams: ['uuid', 'platformId'], |
|||
name: 'AppVersionManageH5Edit', |
|||
route: '/contentManage/systemManage/appVersionManage/edit', |
|||
|
|||
// ifShow: (record) => { |
|||
// return record.reserveStatus === 0; |
|||
// }, |
|||
}, |
|||
|
|||
{ |
|||
label: '删除', |
|||
dynamicParams: { |
|||
uuid: 'uuid', |
|||
}, |
|||
name: 'AppVersionIOSDelete', |
|||
confirm: true, |
|||
isReload: true, |
|||
// ifShow: (record) => { |
|||
// return record.reserveStatus === 0; |
|||
// }, |
|||
api: '/api/op_com/objs/admin/VersionConfigOper/deleteVersionConfig', |
|||
}, |
|||
], |
|||
}, |
|||
|
|||
formConfig: { |
|||
schemas: [ |
|||
{ |
|||
field: 'appName', |
|||
label: '软件名称', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
placeholder: '请输入', |
|||
}, |
|||
}, |
|||
{ |
|||
field: 'versionCode', |
|||
label: '版本号', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
placeholder: '请输入', |
|||
}, |
|||
}, |
|||
{ |
|||
field: 'time', |
|||
label: '发布时间', |
|||
component: 'NsRangePicker', |
|||
fieldMap: ['startTime', 'endTime'], |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD', |
|||
format: 'YYYY-MM-DD', |
|||
}, |
|||
}, |
|||
], |
|||
params: {}, |
|||
}, |
|||
rowKey: 'uuid', |
|||
}; |
|||
const tabPaneList = [ |
|||
{ |
|||
title: 'Android版本管理', |
|||
bindData: tableConfigAndroid, |
|||
}, |
|||
{ |
|||
title: 'IOS版本管理', |
|||
bindData: tableConfigIOS, |
|||
}, |
|||
{ |
|||
title: '应用内容版本管理', |
|||
bindData: tableConfigH5, |
|||
}, |
|||
]; |
|||
if (Cookies.get('type') == 'wechat') { |
|||
tabPaneList.splice(0, 2); |
|||
} |
|||
|
|||
return { |
|||
data, |
|||
tabPaneList, |
|||
qrCodeUrl, |
|||
qrcodeVisible, |
|||
}; |
|||
}, |
|||
}); |
|||
</script> |
|||
<style lang="less" scoped></style> |
@ -1,332 +0,0 @@ |
|||
<!-- @format --> |
|||
|
|||
<template> |
|||
<my-add-form |
|||
formLayout="修改" |
|||
:schemas="formSchema" |
|||
:model="data" |
|||
:title="uuid ? '编辑banner' : '新增banner'" |
|||
:dataHandle="dataHandle" |
|||
:api=" |
|||
uuid |
|||
? '/api/op_com/objs/admin/AdvertisingMarketingOper/releaseBanner' |
|||
: '/api/op_com/objs/admin/AdvertisingMarketingOper/releaseBanner' |
|||
" |
|||
draftApi="/api/op_com/objs/admin/AdvertisingMarketingOper/saveBanner" /> |
|||
</template> |
|||
<script lang="ts"> |
|||
import { defineComponent, reactive, ref, provide } from 'vue'; |
|||
import { useRouter } from 'vue-router'; |
|||
import myAddForm from '../components/add-form.vue'; |
|||
import myURL from '../components/myURL.vue'; |
|||
import myRadio from '../components/radio.vue'; |
|||
import { http } from '/nerv-lib/util/http'; |
|||
import { dateUtil } from '/nerv-lib/util/date-util'; |
|||
import Cookies from 'js-cookie'; |
|||
|
|||
export default defineComponent({ |
|||
name: 'BannerManageAdd', |
|||
components: { myAddForm, myURL, myRadio }, |
|||
setup() { |
|||
provide('components', () => { |
|||
return { myURL, myRadio }; |
|||
}); |
|||
let data = ref({}); |
|||
// 投放渠道:0-管控平台-pc、3-小程序-wechat、5-APP-mobile |
|||
const type = Cookies.get('type') || 'wechat'; |
|||
const typeBucket = { |
|||
pc: 0, |
|||
wechat: 3, |
|||
mobile: 5, |
|||
}; |
|||
const rouer = useRouter(); |
|||
let isDisabled = ref(false); |
|||
const { uuid } = rouer.currentRoute.value.query; |
|||
let fileUrl = ref(); |
|||
let fileUuid = ref(); |
|||
let defaultUrl = ref(); |
|||
let defaultPutChannel = ref(); |
|||
let defaultChecked = ref(); |
|||
let dynamicSelect = ref(); |
|||
let chooseChannel = ref(); |
|||
const formSchema = ref(); |
|||
const request = () => { |
|||
return new Promise((resolve, reject) => { |
|||
http |
|||
.get('/api/op_com/objs/admin/AdvertisingMarketingOper/bannerDetail', { uuid }) |
|||
.then((res) => { |
|||
const detail = res.data; |
|||
|
|||
resolve(detail); |
|||
}) |
|||
.catch((err) => { |
|||
reject(err); |
|||
}); |
|||
}); |
|||
}; |
|||
|
|||
let formSchemaDetail = [ |
|||
{ |
|||
field: 'uuid', |
|||
defaultValue: uuid, |
|||
}, |
|||
{ |
|||
field: 'field111', |
|||
label: '', |
|||
displayFormItem: false, |
|||
class: 'ns-form-item-full', |
|||
component: 'NsChildForm', |
|||
componentProps: { |
|||
title: 'banner内容', |
|||
schemas: [ |
|||
{ |
|||
field: 'name', |
|||
label: 'banner名称', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
placeholder: '请输入', |
|||
}, |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: '请输入banner名称', |
|||
trigger: 'blur', |
|||
}, |
|||
{ min: 0, max: 20, message: '最多可输入20个字符', trigger: 'change' }, |
|||
], |
|||
}, |
|||
{ |
|||
field: 'dataType', |
|||
label: 'banner类型', |
|||
component: 'NsSelect', |
|||
defaultValue: 99, |
|||
show: false, |
|||
}, |
|||
{ |
|||
field: 'fileUrl', |
|||
component: 'NsUpload', |
|||
label: 'banner图片', |
|||
componentProps: { |
|||
// 上传的地址 |
|||
url: '/api/fileunify/objs/admin/MaterialFile', |
|||
// 上传的图片大小 |
|||
maxSize: 5242880, |
|||
// 上传的图片类型 |
|||
fileType: ['jpg', 'png', 'jpeg'], |
|||
// 展示图片数量 |
|||
count: 1, |
|||
// 上传的文件类型,0-证书,1-图片,2-身份证件 |
|||
uploadType: 1, |
|||
baseImageUrl: fileUrl, |
|||
params: { |
|||
groupCode: 'mobile_img', |
|||
}, |
|||
}, |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: '', |
|||
trigger: 'blur', |
|||
}, |
|||
{ |
|||
validator: async (rule, value) => { |
|||
if (!value) { |
|||
return Promise.reject('请上传一张banner图片'); |
|||
} |
|||
}, |
|||
trigger: 'change', |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
field: 'deliveryChannelList', |
|||
defaultValue: [typeBucket[type]], |
|||
}, |
|||
{ |
|||
field: 'finalUrl', |
|||
label: '跳转路径', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
placeholder: '请输入', |
|||
}, |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: '请输入跳转路径', |
|||
trigger: 'change', |
|||
}, |
|||
], |
|||
}, |
|||
], |
|||
}, |
|||
}, |
|||
{ |
|||
field: 'field111', |
|||
label: '', |
|||
displayFormItem: false, |
|||
class: 'ns-form-item-full', |
|||
component: 'NsChildForm', |
|||
componentProps: { |
|||
title: '投放规则', |
|||
schemas: [ |
|||
{ |
|||
field: 'time', |
|||
label: '投放时间', |
|||
component: 'NsRangePicker', |
|||
fieldMap: ['startTime', 'endTime'], |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
format: 'YYYY-MM-DD HH:mm:ss', |
|||
showTime: true, |
|||
'show-time': { |
|||
hideDisabledOptions: true, |
|||
defaultValue: [ |
|||
dateUtil('00:00:00', 'HH:mm:ss'), |
|||
dateUtil('23:59:59', 'HH:mm:ss'), |
|||
], |
|||
}, |
|||
}, |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: '请选择投放时间', |
|||
type: 'array', |
|||
trigger: 'change', |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
field: 'field', |
|||
label: '展示栏位', |
|||
component: 'NsSelect', |
|||
componentProps: { |
|||
placeholder: '请选择', |
|||
options: [ |
|||
{ |
|||
label: '1', |
|||
value: 1, |
|||
}, |
|||
{ |
|||
label: '2', |
|||
value: 2, |
|||
}, |
|||
{ |
|||
label: '3', |
|||
value: 3, |
|||
}, |
|||
{ |
|||
label: '4', |
|||
value: 4, |
|||
}, |
|||
{ |
|||
label: '5', |
|||
value: 5, |
|||
}, |
|||
{ |
|||
label: '6', |
|||
value: 6, |
|||
}, |
|||
], |
|||
}, |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: '请选择展示栏位', |
|||
type: 'number', |
|||
trigger: 'blur', |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
field: 'pushCrowd', |
|||
defaultValue: 0, |
|||
}, |
|||
// { |
|||
// field: 'pushCrowd', |
|||
// label: '推送人群', |
|||
// component: 'NsSelect', |
|||
// componentProps: { |
|||
// placeholder: '请选择', |
|||
// options: [ |
|||
// { |
|||
// label: '所有人群', |
|||
// value: 0, |
|||
// }, |
|||
// { |
|||
// label: '注册用户', |
|||
// value: 1, |
|||
// }, |
|||
// { |
|||
// label: '新用户', |
|||
// value: 2, |
|||
// }, |
|||
// // { |
|||
// // label: '白名单组', |
|||
// // value: 5, |
|||
// // }, |
|||
// ], |
|||
// }, |
|||
// rules: [ |
|||
// { |
|||
// required: true, |
|||
// message: '请选择推送人群', |
|||
// type: 'number', |
|||
// trigger: 'blur', |
|||
// }, |
|||
// ], |
|||
// }, |
|||
], |
|||
}, |
|||
}, |
|||
]; |
|||
if (uuid) { |
|||
request().then((res: any) => { |
|||
data.value = res; |
|||
fileUrl.value = res.fileUrl; |
|||
defaultUrl.value = [res.httpUrl, res.wxAppletsUrl]; |
|||
defaultPutChannel.value = [ |
|||
res.wxAppletsUrl, |
|||
// res.wxOpenUrl, |
|||
// res.wstUrl, |
|||
res.appUrl, |
|||
// res.alipayUrl, |
|||
]; |
|||
defaultChecked.value = res.deliveryChannel?.split(','); |
|||
chooseChannel.value = res.deliveryChannel; |
|||
data.value.time = [ |
|||
dateUtil(res.startTime).format('YYYY-MM-DD HH:mm:ss'), |
|||
dateUtil(res.endTime).format('YYYY-MM-DD HH:mm:ss'), |
|||
]; |
|||
data.value.finalUrl = res.appUrl || res.wxAppletsUrl || res.webUrl; |
|||
formSchema.value = Object.assign([], formSchemaDetail); |
|||
}); |
|||
} else { |
|||
formSchema.value = Object.assign([], formSchemaDetail); |
|||
} |
|||
|
|||
const dataHandle = (data) => { |
|||
const bucket = { |
|||
pc: 'webUrl', |
|||
wechat: 'wxAppletsUrl', |
|||
mobile: 'appUrl', |
|||
}; |
|||
data[bucket[type]] = data.finalUrl; |
|||
return data; |
|||
}; |
|||
return { |
|||
data, |
|||
formSchema, |
|||
uuid, |
|||
dataHandle, |
|||
}; |
|||
}, |
|||
|
|||
methods: {}, |
|||
}); |
|||
</script> |
|||
<style lang="less" scoped> |
|||
:deep(.ns-form .ns-child-form-title) { |
|||
text-align: left; |
|||
margin: 10 0 0 0 !important; |
|||
} |
|||
</style> |
@ -1,109 +0,0 @@ |
|||
<!-- @format --> |
|||
|
|||
<template> |
|||
<div> |
|||
<customerDetail |
|||
title="查看banner" |
|||
api="/api/op_com/objs/admin/AdvertisingMarketingOper/bannerDetail" |
|||
:detail="detail" |
|||
checkApi="/api/op_com/objs/admin/AdvertisingMarketingOper/approvalBanner" /> |
|||
</div> |
|||
</template> |
|||
<script lang="ts"> |
|||
import { defineComponent, reactive, ref } from 'vue'; |
|||
import customerDetail from '../components/customerDetail.vue'; |
|||
import { dateUtil } from '/nerv-lib/util/date-util'; |
|||
import { useRouter } from 'vue-router'; |
|||
|
|||
export default defineComponent({ |
|||
name: 'BannerManageDetail', |
|||
components: { customerDetail }, |
|||
setup() { |
|||
const rouer = useRouter(); |
|||
let status = ref(); |
|||
status.value = rouer.currentRoute.value.query.pushCrowd; |
|||
|
|||
const detail = reactive([ |
|||
{ |
|||
title: 'banner内容', |
|||
items: [ |
|||
{ |
|||
label: 'banner名称', |
|||
name: 'name', |
|||
}, |
|||
{ |
|||
label: 'banner图片', |
|||
name: 'fileUrl', |
|||
type: 'image', |
|||
}, |
|||
|
|||
{ |
|||
label: '跳转路径', |
|||
name: 'url', |
|||
format: (value, res) => { |
|||
return res.appUrl || res.wxAppletsUrl || res.webUrl || '-'; |
|||
}, |
|||
}, |
|||
// { |
|||
// label: '投放渠道', |
|||
// name: 'pileType', |
|||
// type: 'html', |
|||
// format: (value, data) => { |
|||
// let channel = ['', '', '皖事通H5', '小程序', '微信公众号', 'APP', '支付宝']; |
|||
// let url = ['', '', 'wstUrl', 'wxAppletsUrl', 'wxOpenUrl', 'appUrl', 'appUrl']; |
|||
// let final = ''; |
|||
// data.deliveryChannelList?.map((item) => { |
|||
// final += `${channel[item]}: ${data[url[item]] || '-'}` + '<br />'; |
|||
// }); |
|||
// return final; |
|||
// }, |
|||
// }, |
|||
], |
|||
}, |
|||
{ |
|||
title: '投放规则', |
|||
items: [ |
|||
{ |
|||
label: '投放时间', |
|||
name: 'pileCode', |
|||
format: (value, data) => { |
|||
return ( |
|||
dateUtil(data?.startTime).format('YYYY-MM-DD HH:mm:ss') + |
|||
' - ' + |
|||
dateUtil(data?.endTime).format('YYYY-MM-DD HH:mm:ss') |
|||
); |
|||
}, |
|||
}, |
|||
{ |
|||
label: '展示栏位', |
|||
name: 'field', |
|||
}, |
|||
// { |
|||
// label: '推送人群', |
|||
// name: 'pushCrowd', |
|||
// format: (value, data) => { |
|||
// return ['所有人群', '注册用户', '新用户', '白名单组'][value]; |
|||
// }, |
|||
// }, |
|||
], |
|||
}, |
|||
]); |
|||
// if (status.value == 3) { |
|||
// detail[1]['items'].push({ |
|||
// label: '白名单组名称', |
|||
// name: 'relationList', |
|||
// format: (value, data) => { |
|||
// let str = ''; |
|||
// data.relationList?.map((item, index) => { |
|||
// str += item.label + `${index == data.relationList?.length - 1 ? '' : '、'}`; |
|||
// }); |
|||
// return str; |
|||
// }, |
|||
// }); |
|||
// } |
|||
return { |
|||
detail, |
|||
}; |
|||
}, |
|||
}); |
|||
</script> |
@ -1,303 +0,0 @@ |
|||
<!-- @format --> |
|||
|
|||
<template> |
|||
<ns-view-list-table v-bind="tableConfig" :model="data" rowKey="uuid"> |
|||
<template #bodyCell="{ record, column }"> |
|||
<template v-if="column.dataIndex === 'status'"> |
|||
<a-badge v-bind="checkStatus[record.status]" /> |
|||
</template> |
|||
</template> |
|||
</ns-view-list-table> |
|||
</template> |
|||
<script> |
|||
import { defineComponent, reactive } from 'vue'; |
|||
import { dateUtil } from '/nerv-lib/util/date-util'; |
|||
|
|||
export default defineComponent({ |
|||
name: 'BannerManageIndex', |
|||
setup() { |
|||
const data = reactive({}); |
|||
const tableConfig = { |
|||
title: 'banner管理', |
|||
api: '/api/op_com/objs/admin/AdvertisingMarketingOper/bannerList', |
|||
params: { |
|||
page: 0, |
|||
pageSize: 10, |
|||
}, |
|||
rowSelection: null, |
|||
// scroll: { x: 1100 }, |
|||
columns: [ |
|||
{ |
|||
title: 'banner名称', |
|||
// textNumber: 8, |
|||
// textEllipsis: true, |
|||
width: '30%', |
|||
dataIndex: 'name', |
|||
}, |
|||
{ |
|||
title: '投放时间段', |
|||
// textNumber: 17, |
|||
dataIndex: 'applyTime', |
|||
customRender: ({ text, record }) => { |
|||
return `${dateUtil(record.startTime).format('YYYY-MM-DD HH:mm:ss')} - ${dateUtil( |
|||
record.endTime, |
|||
).format('YYYY-MM-DD HH:mm:ss')}`; |
|||
}, |
|||
}, |
|||
|
|||
// { |
|||
// title: '投放渠道', |
|||
// // textNumber: 5, |
|||
// dataIndex: 'deliveryChannelList', |
|||
// customRender: ({ text, record }) => { |
|||
// return record.deliveryChannelText; |
|||
// }, |
|||
// }, |
|||
// { |
|||
// title: '推送人群', |
|||
// textNumber: 5, |
|||
// dataIndex: 'pushCrowd', |
|||
// customRender: ({ text, record }) => { |
|||
// return ['所有人群', '注册用户', '新用户', '', '', '白名单组'][text]; |
|||
// }, |
|||
// }, |
|||
{ |
|||
title: '状态', |
|||
// textNumber: 13, |
|||
dataIndex: 'status', |
|||
}, |
|||
], |
|||
columnActions: { |
|||
title: '操作', |
|||
// width: 50, |
|||
// textNumber: 2, |
|||
actionNumber: 2, |
|||
// fixed: 'right', |
|||
autoMergeAction: false, |
|||
actions: [ |
|||
{ |
|||
label: '编辑', |
|||
name: 'BannerManageEdit', |
|||
dynamicParams: ['uuid', 'status'], |
|||
ifShow: ({ status }) => status !== 2 && status !== 3 && status !== 5, |
|||
route: '/contentManage/systemManage/bannerManage/edit', |
|||
}, |
|||
{ |
|||
label: '查看', |
|||
name: 'BannerManageDetail', |
|||
dynamicParams: ['uuid', 'pushCrowd'], |
|||
ifShow: ({ status }) => status === 3 || status === 2 || status === 5, |
|||
route: '/contentManage/systemManage/bannerManage/detail', |
|||
}, |
|||
{ |
|||
label: '审批', |
|||
name: 'BannerManageDetailCheck', |
|||
dynamicParams: ['uuid', 'pushCrowd', 'status'], |
|||
ifShow: ({ status }) => status === 5, |
|||
route: '/contentManage/systemManage/bannerManage/detailCheck', |
|||
}, |
|||
{ |
|||
label: '失效', |
|||
dynamicParams: 'uuid', |
|||
ifShow: ({ status }) => status === 0 || status === 4, |
|||
name: 'BannerManageInvalidation', |
|||
confirm: true, |
|||
isReload: true, |
|||
api: '/api/op_com/objs/admin/AdvertisingMarketingOper/invalidationBanner', |
|||
}, |
|||
{ |
|||
label: '删除', |
|||
dynamicParams: 'uuid', |
|||
ifShow: ({ status }) => status !== 0 && status !== 4 && status !== 5, |
|||
name: 'BannerManageRemove', |
|||
confirm: true, |
|||
isReload: true, |
|||
api: '/api/op_com/objs/admin/AdvertisingMarketingOper/deleteBanner', |
|||
}, |
|||
], |
|||
}, |
|||
headerActions: [ |
|||
{ |
|||
label: '新增', |
|||
name: 'BannerManageAdd', |
|||
type: 'primary', |
|||
route: '/contentManage/systemManage/bannerManage/add', |
|||
}, |
|||
], |
|||
formConfig: { |
|||
schemas: [ |
|||
{ |
|||
field: 'name', |
|||
label: 'banner名称', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
placeholder: '请输入', |
|||
}, |
|||
}, |
|||
{ |
|||
field: 'time', |
|||
label: '投放时间段', |
|||
component: 'NsRangePicker', |
|||
fieldMap: ['startTime', 'endTime'], |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
format: 'YYYY-MM-DD HH:mm:ss', |
|||
showTime: true, |
|||
'show-time': { |
|||
hideDisabledOptions: true, |
|||
defaultValue: [ |
|||
dateUtil('00:00:00', 'HH:mm:ss'), |
|||
dateUtil('23:59:59', 'HH:mm:ss'), |
|||
], |
|||
}, |
|||
}, |
|||
}, |
|||
// { |
|||
// field: 'deliveryChannel', |
|||
// label: '投放渠道', |
|||
// component: 'NsSelect', |
|||
// defaultValue: '', |
|||
// componentProps: { |
|||
// options: [ |
|||
// { |
|||
// label: '全部', |
|||
// value: '', |
|||
// }, |
|||
// { |
|||
// label: '微信小程序', |
|||
// value: 3, |
|||
// }, |
|||
// { |
|||
// label: '微信公众号', |
|||
// value: 4, |
|||
// }, |
|||
// { |
|||
// label: '皖事通H5', |
|||
// value: 2, |
|||
// }, |
|||
// { |
|||
// label: 'APP', |
|||
// value: 5, |
|||
// }, |
|||
// { |
|||
// label: '支付宝', |
|||
// value: 6, |
|||
// }, |
|||
// ], |
|||
// }, |
|||
// }, |
|||
{ |
|||
field: 'status', |
|||
label: '状态', |
|||
component: 'NsSelect', |
|||
defaultValue: '', |
|||
componentProps: { |
|||
options: [ |
|||
{ |
|||
label: '全部', |
|||
value: '', |
|||
}, |
|||
{ |
|||
label: '进行中', |
|||
value: 0, |
|||
}, |
|||
{ |
|||
label: '存草稿', |
|||
value: 1, |
|||
}, |
|||
{ |
|||
label: '已结束', |
|||
value: 2, |
|||
}, |
|||
{ |
|||
label: '已失效', |
|||
value: 3, |
|||
}, |
|||
{ |
|||
label: '未开始', |
|||
value: 4, |
|||
}, |
|||
{ |
|||
label: '待审核', |
|||
value: 5, |
|||
}, |
|||
{ |
|||
label: '审核驳回', |
|||
value: 6, |
|||
}, |
|||
], |
|||
}, |
|||
}, |
|||
// { |
|||
// field: 'pushCrowd', |
|||
// label: '推送人群', |
|||
// component: 'NsSelect', |
|||
// defaultValue: '', |
|||
// componentProps: { |
|||
// options: [ |
|||
// { |
|||
// label: '全部', |
|||
// value: '', |
|||
// }, |
|||
// { |
|||
// label: '所有人群', |
|||
// value: 0, |
|||
// }, |
|||
// { |
|||
// label: '注册用户', |
|||
// value: 1, |
|||
// }, |
|||
// { |
|||
// label: '新用户', |
|||
// value: 2, |
|||
// }, |
|||
// { |
|||
// label: '白名单组', |
|||
// value: 3, |
|||
// }, |
|||
// ], |
|||
// }, |
|||
// }, |
|||
], |
|||
params: {}, |
|||
}, |
|||
rowKey: 'uuid', |
|||
}; |
|||
const checkStatus = [ |
|||
{ |
|||
status: 'processing', |
|||
text: '进行中', |
|||
}, |
|||
{ |
|||
status: 'error', |
|||
text: '存草稿', |
|||
}, |
|||
{ |
|||
status: 'default', |
|||
text: '已结束', |
|||
}, |
|||
{ |
|||
color: '#000000', |
|||
text: '已失效', |
|||
}, |
|||
{ |
|||
status: 'success', |
|||
text: '未开始', |
|||
}, |
|||
{ |
|||
status: 'error', |
|||
text: '待审核', |
|||
}, |
|||
{ |
|||
color: '#000000', |
|||
text: '审核驳回', |
|||
}, |
|||
]; |
|||
return { |
|||
tableConfig, |
|||
data, |
|||
checkStatus, |
|||
}; |
|||
}, |
|||
}); |
|||
</script> |
@ -1,150 +0,0 @@ |
|||
<!-- @format --> |
|||
|
|||
<template> |
|||
<a-spin :spinning="isLoading"> |
|||
<ns-page-header class="ns-page-header" style="margin-bottom: 0" :title="title"> |
|||
<template #extra> |
|||
<!-- todo 隐藏取消--> |
|||
<a-button @click="back">返回</a-button> |
|||
<a-button |
|||
v-if="!uuid || status == 1" |
|||
:disabled="validateResult" |
|||
style="margin-left: 10px" |
|||
@click="submit('draftApi')" |
|||
>存草稿</a-button |
|||
> |
|||
<a-button |
|||
style="margin-left: 10px" |
|||
:disabled="validateResult" |
|||
type="primary" |
|||
@click="submit('api')" |
|||
>提交</a-button |
|||
> |
|||
</template> |
|||
</ns-page-header> |
|||
<div class="ns-add-form"> |
|||
<ns-form ref="mainRef" v-bind="getBindValue"> |
|||
<template #[item]="data" v-for="item in Object.keys($slots)"> |
|||
<slot :name="item" v-bind="data || {}"></slot> |
|||
</template> |
|||
</ns-form> |
|||
</div> |
|||
</a-spin> |
|||
</template> |
|||
|
|||
<script lang="ts"> |
|||
import { computed, defineComponent, ref } from 'vue'; |
|||
import { http } from '/nerv-lib/util/http'; |
|||
import { NsMessage } from '/nerv-lib/component/message'; |
|||
import { useRouter } from 'vue-router'; |
|||
|
|||
export default defineComponent({ |
|||
name: 'MyAddForm', |
|||
props: { |
|||
api: { |
|||
type: String, |
|||
required: true, |
|||
}, |
|||
draftApi: { |
|||
type: String, |
|||
// required: true, |
|||
}, |
|||
title: String, |
|||
params: { |
|||
type: Object, |
|||
default: () => ({}), |
|||
}, |
|||
data: { |
|||
type: Object, |
|||
default: () => ({}), |
|||
}, |
|||
parkInfo: { |
|||
type: Array, |
|||
}, |
|||
backName: String, |
|||
dataHandle: Function, |
|||
}, |
|||
setup(props, { attrs }) { |
|||
const mainRef = ref(); |
|||
const router = useRouter(); |
|||
let status = ref(); |
|||
let uuid = ref(); |
|||
status.value = router.currentRoute.value.query.status; |
|||
uuid.value = router.currentRoute.value.query.uuid; |
|||
const back = () => { |
|||
if (props.backName) { |
|||
router.push({ name: props.backName }); |
|||
// 清空缓存 |
|||
localStorage.removeItem('integral'); |
|||
} else { |
|||
router.back(); |
|||
} |
|||
}; |
|||
const isLoading = ref(false); |
|||
|
|||
const getBindValue = computed(() => ({ |
|||
...attrs, |
|||
...props, |
|||
})); |
|||
const validateResult = computed(() => { |
|||
return !mainRef.value?.validateResult; |
|||
}); |
|||
function submit(api) { |
|||
mainRef.value |
|||
.triggerSubmit() |
|||
.then((data: any) => { |
|||
console.log(data); |
|||
|
|||
isLoading.value = true; |
|||
// let datas = { |
|||
// ...data, |
|||
// activityParkList: data.isAllPark ? [] : props.parkInfo, |
|||
// }; |
|||
data = props.dataHandle ? props.dataHandle(data) : data; |
|||
|
|||
http |
|||
.post(props[api], data) |
|||
.then(() => { |
|||
isLoading.value = false; |
|||
NsMessage.success('操作成功', 1, () => { |
|||
back(); |
|||
}); |
|||
}) |
|||
.catch(() => { |
|||
isLoading.value = false; |
|||
}); |
|||
}) |
|||
.catch(() => {}); |
|||
} |
|||
|
|||
return { mainRef, submit, getBindValue, isLoading, status, uuid, back, validateResult }; |
|||
}, |
|||
}); |
|||
</script> |
|||
<style lang="less" scoped> |
|||
//.ns-page-header { |
|||
// margin: 0px 16px 20px 0; |
|||
// border-bottom: 1px solid #f0f2f5; |
|||
//} |
|||
.ns-add-form .ns-vertical-form { |
|||
max-width: 600px; |
|||
margin: 0 auto; |
|||
} |
|||
:deep(.ant-spin-nested-loading) { |
|||
height: 100%; |
|||
} |
|||
.ant-spin-nested-loading { |
|||
height: 100%; |
|||
} |
|||
:deep(.ant-spin-container) { |
|||
height: 100%; |
|||
overflow: hidden; |
|||
} |
|||
:deep(.ns-add-form) { |
|||
height: calc(100% - 83px) !important; |
|||
overflow: auto; |
|||
} |
|||
:deep(.ns-add-form .ns-vertical-form) { |
|||
min-width: 420px; |
|||
} |
|||
</style> |
@ -1,368 +0,0 @@ |
|||
<!-- @format --> |
|||
|
|||
<template> |
|||
<div class="ns-skeleton"> |
|||
<ns-page-header class="ns-page-header" :title="title"> |
|||
<template #extra> |
|||
<ns-button @click="onBack()">返回</ns-button> |
|||
<ns-button v-if="status == 5" type="primary" @click="checkReq('pass')">审核通过</ns-button> |
|||
<ns-button v-if="status == 5" type="primary" @click="checkReq('reject')" |
|||
>审核驳回</ns-button |
|||
> |
|||
</template> |
|||
</ns-page-header> |
|||
<div class="ns-detail-content"> |
|||
<Skeleton |
|||
active |
|||
v-for="(detailGroup, index) in getDetail" |
|||
:key="index" |
|||
:loading="loading" |
|||
:paragraph="detailGroup.SkeletonParagraphProps" |
|||
:title="SkeletonTitleProps"> |
|||
<div class="ns-detail"> |
|||
<a-descriptions :title="detailGroup.title"> |
|||
<template v-if="detailGroup.items"> |
|||
<template v-for="(item, index) in detailGroup.items" :key="index"> |
|||
<a-descriptions-item v-bind="item" v-if="item.ifShow"> |
|||
<!--默认--> |
|||
|
|||
<template v-if="!item.type"> |
|||
<span class="ns-detail-text">{{ item.value ? item.value : '-' }}</span> |
|||
</template> |
|||
<!--富文本--> |
|||
<template v-if="item.type == 'html'"> |
|||
<div class="ns-detail-html" v-html="item.value"></div> |
|||
</template> |
|||
<!--链接--> |
|||
|
|||
<template v-if="item.type == 'link'"> |
|||
<a class="ns-detail-link" target="_blank" :href="item.value">发票链接 </a> |
|||
</template> |
|||
<!--图片 值为数组则为图片列表 可继续扩展--> |
|||
|
|||
<template v-if="item.type === 'image'"> |
|||
<template v-if="typeof item.value == 'object'"> |
|||
<div |
|||
class="ns-detail-image-list" |
|||
v-for="src in item.value" |
|||
:key="src" |
|||
style="display: inline-block; margin: 0 5px 5px 0"> |
|||
<a-image |
|||
:width="100" |
|||
:src="src" |
|||
fallback="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg==" /> |
|||
</div> |
|||
</template> |
|||
<template v-else> |
|||
<a-image |
|||
v-if="item.value" |
|||
class="ns-detail-image" |
|||
:width="64" |
|||
:src="item.value" |
|||
fallback="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg==" /> |
|||
<span v-else>-</span> |
|||
</template> |
|||
</template> |
|||
|
|||
<!--表格--> |
|||
<template v-else-if="item.type === 'table'"> |
|||
<ns-basic-table |
|||
class="ns-detail-table" |
|||
:dataSource="dataRef[item.props.listField]" |
|||
:columns="item.props.columns" |
|||
:pagination="false" |
|||
:rowKey="item.props.rowKey" /> |
|||
</template> |
|||
|
|||
<!--表格--> |
|||
<template v-else-if="item.type === 'NsViewListTable'"> |
|||
<NsViewListTable v-bind="item.props.tableConfig" /> |
|||
</template> |
|||
|
|||
<template v-for="slot in Object.keys($slots)" :key="slot"> |
|||
<div v-if="item.type === slot" :style="item.style" :class="`ns-detail-${slot}`"> |
|||
<slot :name="slot" v-bind="item || {}"> </slot> |
|||
</div> |
|||
</template> |
|||
</a-descriptions-item> |
|||
</template> |
|||
</template> |
|||
</a-descriptions> |
|||
</div> |
|||
</Skeleton> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script lang="ts"> |
|||
import { computed, defineComponent, ref, watch, PropType, createVNode } from 'vue'; |
|||
import { http } from '/nerv-lib/util/http'; |
|||
import { useRouter } from 'vue-router'; |
|||
import { cloneDeep, get, isFunction, isUndefined } from 'lodash-es'; |
|||
import { Skeleton } from 'ant-design-vue'; |
|||
import { NsModal } from '/nerv-lib/component/modal'; |
|||
import { NsMessage } from '/nerv-lib/component/message'; |
|||
|
|||
export interface DetailItem { |
|||
label: string; |
|||
name: string; |
|||
ifShow?: Boolean | Function; |
|||
value?: string; |
|||
format?: Function; |
|||
type?: string; // 现支持image |
|||
} |
|||
|
|||
export interface DetailGroup { |
|||
title: string; |
|||
items: Array<DetailItem>; |
|||
} |
|||
|
|||
export default defineComponent({ |
|||
name: 'NsViewDetail', |
|||
components: { Skeleton }, |
|||
props: { |
|||
detail: { |
|||
type: Array as PropType<DetailGroup[]>, |
|||
default: () => [], |
|||
}, |
|||
api: { |
|||
type: String, |
|||
}, |
|||
checkApi: { |
|||
type: String, |
|||
}, |
|||
title: { |
|||
type: String, |
|||
default: '查看', |
|||
}, |
|||
formLayout: { |
|||
type: String, |
|||
default: '', |
|||
}, |
|||
dataHandle: Function, |
|||
}, |
|||
setup(props) { |
|||
const SkeletonTitleProps = ref({ |
|||
width: 150, |
|||
}); |
|||
const router = useRouter(); |
|||
const status = ref(); |
|||
const { query } = router.currentRoute.value; |
|||
status.value = query.status; |
|||
// const check = query.status == 5 ? true : false; |
|||
const dataRef = ref([]); |
|||
const textTitle = props.title?.slice(2); |
|||
const checkReq = (type) => { |
|||
const text = { |
|||
pass: { |
|||
title: '审核通过', |
|||
content: `审核通过后将发布${textTitle}`, |
|||
value: 1, |
|||
}, |
|||
reject: { |
|||
title: '审核驳回', |
|||
content: `确认驳回该${textTitle}发布内容?`, |
|||
value: 0, |
|||
}, |
|||
}; |
|||
NsModal.confirm({ |
|||
title: createVNode('div', { style: 'font-weight:600;font-size: 16px' }, text[type].title), |
|||
content: createVNode('div', { style: 'font-size: 14px' }, text[type].content), |
|||
// icon: createVNode(ExclamationCircleOutlined), |
|||
okText: '确认', |
|||
cancelText: '取消', |
|||
onOk() { |
|||
req(text[type].value); |
|||
}, |
|||
onCancel() {}, |
|||
}); |
|||
}; |
|||
const req = (val) => { |
|||
const data = { |
|||
...query, |
|||
approvalStatus: val, |
|||
}; |
|||
http.post(props.checkApi, data).then((res) => { |
|||
NsMessage.success('操作成功', 1, () => { |
|||
router.back(); |
|||
}); |
|||
}); |
|||
}; |
|||
const formatTable = (a) => { |
|||
if (a) { |
|||
// content = content.replace(/<br[^>]*\/>/gi, ''); |
|||
a = a.replace(/<th[^<>]*>/gi, '<th style="background-color:#F0F3F4;padding:5px 5px">'); |
|||
a = a.replace(/<td[^<>]*>/gi, '<td style="padding:5px 5px">'); |
|||
a = a.replace( |
|||
/<table[^>]*>/gi, |
|||
'<table cellpadding="0" cellspacing="0" max-width="100%" border="1" style=" text-align:center;border: 1px solid #ccc;"', |
|||
); |
|||
return a; |
|||
} else { |
|||
return null; |
|||
} |
|||
}; |
|||
|
|||
let loading = ref<boolean>(true); |
|||
function request() { |
|||
// const { query } = route; |
|||
http.get(props.api, query).then((res) => { |
|||
// dataRef.value = res.data; |
|||
dataRef.value = props.dataHandle ? props.dataHandle(res.data) : res.data; |
|||
loading.value = false; |
|||
}); |
|||
} |
|||
|
|||
request(); |
|||
|
|||
const getDetail = computed(() => { |
|||
const detail = cloneDeep(props.detail); |
|||
return (detail as Array<DetailGroup>).map((group: DetailGroup) => { |
|||
const SkeletonWidth = []; |
|||
for (let i = 0; i < group.items.length; i++) { |
|||
if (group.items[i].type === 'table') { |
|||
SkeletonWidth.push('80%'); |
|||
} else { |
|||
SkeletonWidth.push('30%'); |
|||
} |
|||
} |
|||
const { title, items } = group; |
|||
return { |
|||
title: title, |
|||
items: items.map((item) => { |
|||
if (!loading.value) { |
|||
const { ifShow } = item; |
|||
item.value = get(dataRef.value, item.name); |
|||
item.ifShow = isFunction(ifShow) |
|||
? ifShow(dataRef.value) |
|||
: isUndefined(ifShow) |
|||
? true |
|||
: ifShow; |
|||
if (item.format) { |
|||
item.value = item.format(item.value, dataRef.value); |
|||
} |
|||
} |
|||
return item; |
|||
}), |
|||
SkeletonParagraphProps: { |
|||
rows: items.length, |
|||
width: SkeletonWidth, |
|||
}, |
|||
SkeletonTitleProps: { |
|||
width: 150, |
|||
}, |
|||
}; |
|||
}); |
|||
}); |
|||
return { |
|||
request, |
|||
getDetail, |
|||
loading, |
|||
SkeletonTitleProps, |
|||
formatTable, |
|||
checkReq, |
|||
status, |
|||
}; |
|||
}, |
|||
// created() { |
|||
// this.request(); |
|||
// }, |
|||
methods: { |
|||
onBack() { |
|||
this.$router.back(); |
|||
}, |
|||
}, |
|||
}); |
|||
</script> |
|||
|
|||
<style lang="less" scoped> |
|||
.ns-detail-content { |
|||
padding: 0 24px; |
|||
} |
|||
|
|||
:deep(.ant-skeleton-paragraph) { |
|||
display: flex; |
|||
flex-wrap: wrap; |
|||
} |
|||
|
|||
:deep(.ant-skeleton-paragraph li:nth-child(n)) { |
|||
display: block; |
|||
margin-right: 4%; |
|||
margin-top: 16px; |
|||
margin-bottom: 4px; |
|||
} |
|||
|
|||
:deep(.ant-skeleton-paragraph li:nth-child(3n + 3)) { |
|||
margin-right: 0; |
|||
} |
|||
|
|||
:deep(.ant-skeleton-content) { |
|||
padding: 0 8px 10px 10px; |
|||
} |
|||
|
|||
:deep(.ant-descriptions-item-label), |
|||
:deep(.ant-descriptions-item-content) { |
|||
line-height: 22px; |
|||
} |
|||
|
|||
:deep(.ant-descriptions-view) { |
|||
padding-bottom: 8px; |
|||
} |
|||
|
|||
:deep(.ant-descriptions-item) { |
|||
padding-right: 20px; |
|||
&:nth-child(2n) { |
|||
padding-left: 20px; |
|||
} |
|||
&:nth-child(3n) { |
|||
padding-left: 20px; |
|||
padding-right: 0; |
|||
} |
|||
} |
|||
|
|||
.ns-detail { |
|||
border-bottom: 1px solid #ecedef; |
|||
&:last-child { |
|||
border-bottom-width: 0; |
|||
} |
|||
:deep(.ant-descriptions-header) { |
|||
margin-top: 24px; |
|||
margin-bottom: 24px; |
|||
.ant-descriptions-title { |
|||
line-height: 16px; |
|||
font-size: 16px; |
|||
} |
|||
} |
|||
} |
|||
.ns-detail-html { |
|||
:deep(table) { |
|||
border-top: 1px solid #ffffff; |
|||
border-left: 1px solid #ffffff; |
|||
:deep(p) { |
|||
font-size: 12px; |
|||
color: #898e91; |
|||
} |
|||
} |
|||
:deep(th) { |
|||
border-right: 1px solid #ffffff; |
|||
font-size: 13px; |
|||
padding-top: 5px; |
|||
padding-bottom: 5px; |
|||
font-weight: normal; |
|||
background: #eff0f2; |
|||
} |
|||
:deep(td) { |
|||
border-top: 1px solid #ffffff; |
|||
border-right: 1px solid #ffffff; |
|||
padding-top: 5px; |
|||
padding-bottom: 5px; |
|||
font-size: 12px; |
|||
color: #606060; |
|||
text-align: center; |
|||
:deep(text) { |
|||
border-bottom: 1px solid #ffffff; |
|||
} |
|||
background: rgba(240, 242, 245, 0.5); |
|||
} |
|||
} |
|||
</style> |
@ -1,178 +0,0 @@ |
|||
<template> |
|||
<div> |
|||
<a-form-item-rest> |
|||
<div class="urlInput" style="margin-bottom: 16px" v-for="(item, index) in url" :key="index"> |
|||
<ns-checkbox |
|||
v-if="$attrs.isMultiSelect" |
|||
style="margin-bottom: 10px" |
|||
v-model:checked="checked[index]" |
|||
>{{ $attrs.multiSelectTitle[index]['label'] }}</ns-checkbox |
|||
> |
|||
<a-input |
|||
v-model:value="urlArr[index].middle" |
|||
:disabled="$attrs.isMultiSelect && !checked[index]" |
|||
:placeholder="item.placeholder" |
|||
allowClear |
|||
> |
|||
<!-- 需求优化,取消select --> |
|||
<!-- <template #addonBefore> |
|||
<a-select |
|||
v-model:value="urlArr[index].before" |
|||
:disabled="$attrs.isMultiSelect && !checked[index]" |
|||
style="min-width: 90px" |
|||
> |
|||
<a-select-option v-for="item2 in item.addonBefore" :value="item2" :key="item2">{{ |
|||
item2 |
|||
}}</a-select-option> |
|||
</a-select> |
|||
</template> |
|||
<template #addonAfter> |
|||
<a-select |
|||
v-model:value="urlArr[index].after" |
|||
:disabled="$attrs.isMultiSelect && !checked[index]" |
|||
style="min-width: 60px" |
|||
> |
|||
<a-select-option v-for="item2 in item.addonAfter" :value="item2" :key="item2">{{ |
|||
item2 |
|||
}}</a-select-option> |
|||
</a-select> |
|||
</template> --> |
|||
</a-input> |
|||
</div> |
|||
</a-form-item-rest> |
|||
</div> |
|||
</template> |
|||
<script lang="ts"> |
|||
import { defineComponent, reactive, watch, ref, nextTick } from 'vue'; |
|||
export default defineComponent({ |
|||
emits: ['change'], |
|||
setup(props, { attrs, emit }) { |
|||
// console.log(props, attrs); |
|||
let checked = reactive([]); |
|||
let url = reactive(attrs.url); |
|||
let emitArr = reactive([]); |
|||
const { defaultUrl, defaultChecked } = attrs; |
|||
// console.log(defaultUrl); |
|||
let urlArr = ref([]); |
|||
url?.map((item) => { |
|||
urlArr.value.push({ |
|||
before: item['addonBefore'][item['defaultAddonBefore'] || attrs.defaultAddonBefore || 0], |
|||
middle: '', |
|||
after: item['addonAfter'][item['defaultAddonAfter'] || attrs.defaultAddonAfter || 0], |
|||
}); |
|||
}); |
|||
if (defaultUrl) { |
|||
let propArr = []; |
|||
let emitMiddle = ref(); |
|||
defaultUrl?.map((item2, index) => { |
|||
// 需求更改 |
|||
// const beforeIndex = |
|||
// item2?.indexOf('//') !== -1 ? item2?.indexOf('//') + 1 : item2?.indexOf('//'); |
|||
// const afterIndex = item2?.lastIndexOf('.'); |
|||
// const before = item2?.slice(0, beforeIndex + 1) || urlArr.value[index].before; |
|||
// const after = item2?.slice(afterIndex) || urlArr.value[index].after; |
|||
// const middle = item2?.slice(beforeIndex + 1, afterIndex); |
|||
propArr.push({ |
|||
before: '', |
|||
middle: item2, |
|||
after: '', |
|||
}); |
|||
}); |
|||
urlArr.value = propArr; |
|||
} else { |
|||
// url?.map((item) => { |
|||
// urlArr.value.push({ |
|||
// before: |
|||
// item['addonBefore'][item['defaultAddonBefore'] || attrs.defaultAddonBefore || 0], |
|||
// middle: '', |
|||
// after: item['addonAfter'][item['defaultAddonAfter'] || attrs.defaultAddonAfter || 0], |
|||
// }); |
|||
// }); |
|||
} |
|||
|
|||
const getCheckArr = (chooseItem) => { |
|||
attrs.multiSelectTitle.map((item, index) => { |
|||
defaultChecked |
|||
? item.value == chooseItem |
|||
? (checked[index] = true) |
|||
: '' |
|||
: (checked[index] = false); |
|||
}); |
|||
}; |
|||
attrs.isMultiSelect ? getCheckArr() : ''; |
|||
const isChecked = () => { |
|||
defaultChecked.map((chooseItem) => { |
|||
getCheckArr(chooseItem); |
|||
// checked[item] = true; |
|||
}); |
|||
}; |
|||
defaultChecked ? isChecked() : ''; |
|||
|
|||
const urlJoin = (item) => { |
|||
if (item.middle) { |
|||
return Object.values(item).join(''); |
|||
} |
|||
return ''; |
|||
}; |
|||
const putChancel = () => { |
|||
let arr = []; |
|||
checked.map((item, index) => { |
|||
item ? arr.push(attrs.multiSelectTitle[index]['value']) : ''; |
|||
}); |
|||
return arr; |
|||
}; |
|||
watch( |
|||
() => attrs.url, |
|||
(value) => { |
|||
url = attrs.url; |
|||
}, |
|||
{ deep: true } |
|||
); |
|||
watch( |
|||
() => urlArr.value, |
|||
(value) => { |
|||
emitArr = reactive([]); |
|||
// console.log('value', value); |
|||
|
|||
value.map((item) => { |
|||
// 需求更改 |
|||
// emitArr.push(urlJoin(item)); |
|||
emitArr.push(item.middle); |
|||
}); |
|||
if (attrs.isMultiSelect) { |
|||
emit('change', [putChancel(), ...emitArr]); |
|||
// console.log('change', putChancel(), emitArr); |
|||
} else { |
|||
emit('change', emitArr); |
|||
// console.log('change', emitArr); |
|||
} |
|||
}, |
|||
{ deep: true, immediate: defaultUrl ? true : false } |
|||
); |
|||
watch( |
|||
() => checked, |
|||
(value) => { |
|||
// console.log('value', value); |
|||
|
|||
// emitArr = reactive([]); |
|||
// value.map((item) => { |
|||
// emitArr.push(urlJoin(item)); |
|||
// }); |
|||
emit('change', [putChancel(), ...emitArr]); |
|||
// console.log('change', putChancel(), emitArr); |
|||
}, |
|||
{ deep: true } |
|||
); |
|||
return { |
|||
url, |
|||
urlArr, |
|||
checked, |
|||
}; |
|||
}, |
|||
}); |
|||
</script> |
|||
<style lang="less" scoped> |
|||
.urlInput:last-child { |
|||
margin-bottom: 0 !important; |
|||
} |
|||
</style> |
@ -1,122 +0,0 @@ |
|||
<template> |
|||
<a-radio-group v-model:value="value"> |
|||
<a-radio v-for="(item, index) in $attrs.valueOptions" :value="item.value" :key="index"> |
|||
{{ item.label }} |
|||
</a-radio> |
|||
<div v-if="value == 2" style="margin-top: 10px; font-size: 14px"> |
|||
<!-- <a-radio> --> |
|||
<div v-if="$attrs.customDay"> |
|||
{{ $attrs.customDay.textBefore }} |
|||
|
|||
<a-input-number |
|||
:min="1" |
|||
:placeholder="$attrs.customDay.placeholder" |
|||
v-model:value="customInput" |
|||
:disabled="customSelect ? true : false" |
|||
style="width: 200px; margin-left: 5px" |
|||
allowClear |
|||
onkeyup="this.value= this.value.match(/[1-9]\d*/) ? this.value.match(/[1-9]\d*/)[0] : ''" |
|||
onblur="this.value= this.value.match(/[1-9]\d*/) ? this.value.match(/[1-9]\d*/)[0] : ''" |
|||
onfocus="this.value= this.value.match(/[1-9]\d*/) ? this.value.match(/[1-9]\d*/)[0] : ''" |
|||
/> |
|||
{{ $attrs.customDay.textAfter }} |
|||
</div> |
|||
<!-- </a-radio> --> |
|||
<!-- <a-radio style="margin-top: 10px"> --> |
|||
<div v-if="$attrs.customWeek" style="margin-top: 10px"> |
|||
{{ $attrs.customWeek.textBefore }} |
|||
<a-select |
|||
:options="$attrs.customWeek.options" |
|||
:placeholder="$attrs.customWeek.placeholder" |
|||
v-model:value="customSelect" |
|||
:disabled="customInput ? true : false" |
|||
style="width: 200px; margin-left: 5px" |
|||
allowClear |
|||
/> |
|||
{{ $attrs.customWeek.textAfter }} |
|||
</div> |
|||
<!-- </a-radio> --> |
|||
</div> |
|||
</a-radio-group> |
|||
</template> |
|||
<script lang="ts"> |
|||
import { defineComponent, reactive, ref, watch } from 'vue'; |
|||
export default defineComponent({ |
|||
emits: ['change'], |
|||
setup(props, { emit, attrs }) { |
|||
// console.log(attrs); |
|||
|
|||
// 选中的类型 |
|||
const value = ref<number>(attrs.defaultRadio && attrs.defaultRadio[0]); |
|||
|
|||
const changeIndex = ref<number>(); |
|||
// if (attrs.defaultRadio && String(attrs.defaultRadio)) { |
|||
// value.value = Number(attrs.defaultRadios); |
|||
// changeIndex.value = Number(attrs.defaultRadios); |
|||
// } |
|||
// 自定义频率的日 周 |
|||
const typeValue = ref<number>(attrs.defaultRadio && attrs.defaultRadio[1]); |
|||
const customInput = ref(); |
|||
const customSelect = ref(); |
|||
const customDisabled = ref(); |
|||
if (attrs.defaultRadio) { |
|||
typeValue.value == 0 |
|||
? (customInput.value = attrs.defaultRadio[2]) |
|||
: (customSelect.value = attrs.defaultRadio[2]); |
|||
} |
|||
const emitValue = () => { |
|||
const emitArr = [ |
|||
value.value, |
|||
typeValue.value, |
|||
typeValue.value == 0 ? customInput.value : customSelect.value, |
|||
]; |
|||
if (value.value !== 2) { |
|||
delete emitArr[1]; |
|||
delete emitArr[2]; |
|||
} |
|||
emit('change', emitArr); |
|||
}; |
|||
watch( |
|||
value, |
|||
(newVal, oldVal) => { |
|||
emitValue(); |
|||
}, |
|||
{ immediate: attrs.defaultRadio ? true : false } |
|||
); |
|||
watch(customInput, (newVal, oldVal) => { |
|||
if (value.value == 2) { |
|||
typeValue.value = customInput.value ? 0 : customSelect.value ? 1 : ''; |
|||
emitValue(); |
|||
} |
|||
}); |
|||
watch(customSelect, (newVal, oldVal) => { |
|||
if (value.value == 2) { |
|||
typeValue.value = customInput.value ? 0 : customSelect.value ? 1 : ''; |
|||
emitValue(); |
|||
} |
|||
}); |
|||
return { |
|||
customInput, |
|||
customDisabled, |
|||
customSelect, |
|||
value, |
|||
changeIndex, |
|||
}; |
|||
}, |
|||
}); |
|||
</script> |
|||
<style lang="less" scoped> |
|||
:deep(.ant-radio-group) { |
|||
font-size: 14px; |
|||
} |
|||
:deep(.ant-radio-wrapper) { |
|||
display: inline-block !important; |
|||
} |
|||
:deep(.ant-radio) { |
|||
top: 3px; |
|||
} |
|||
:deep(.ant-radio-inner::after) { |
|||
width: 8px; |
|||
height: 8px; |
|||
} |
|||
</style> |
@ -1,169 +0,0 @@ |
|||
<!-- @format --> |
|||
|
|||
<template> |
|||
<ns-view-list-table v-bind="tableConfig" :model="data" rowKey="uuid" /> |
|||
</template> |
|||
<script lang="ts"> |
|||
import { defineComponent, reactive } from 'vue'; |
|||
import { dateUtil } from '/nerv-lib/util/date-util'; |
|||
|
|||
export default defineComponent({ |
|||
name: 'LogManageIndex', |
|||
setup() { |
|||
const data = reactive({}); |
|||
const tableConfig = { |
|||
title: '日志管理', |
|||
api: '/api/op_com/objs/admin/LoggerOper', |
|||
headerActions: [{}], |
|||
params: { |
|||
page: 0, |
|||
pageSize: 10, |
|||
}, |
|||
rowSelection: null, |
|||
formConfig: { |
|||
schemas: [ |
|||
{ |
|||
field: 'opType', |
|||
label: '操作类型', |
|||
component: 'NsSelect', |
|||
defaultValue: '', |
|||
componentProps: { |
|||
options: [ |
|||
{ |
|||
label: '全部', |
|||
value: '', |
|||
}, |
|||
{ |
|||
label: '登录', |
|||
value: 1, |
|||
}, |
|||
{ |
|||
label: '退出', |
|||
value: 2, |
|||
}, |
|||
{ |
|||
label: '新增', |
|||
value: 3, |
|||
}, |
|||
{ |
|||
label: '删除', |
|||
value: 4, |
|||
}, |
|||
{ |
|||
label: '更新', |
|||
value: 5, |
|||
}, |
|||
{ |
|||
label: '导入', |
|||
value: 6, |
|||
}, |
|||
{ |
|||
label: '导出', |
|||
value: 7, |
|||
}, |
|||
{ |
|||
label: '上传', |
|||
value: 8, |
|||
}, |
|||
{ |
|||
label: '下载', |
|||
value: 9, |
|||
}, |
|||
{ |
|||
label: '其他', |
|||
value: 10, |
|||
}, |
|||
], |
|||
}, |
|||
}, |
|||
{ |
|||
field: 'ip', |
|||
label: 'IP地址', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
placeholder: '请输入', |
|||
}, |
|||
}, |
|||
{ |
|||
field: 'time', |
|||
label: '操作时间', |
|||
component: 'NsRangePicker', |
|||
fieldMap: ['startTime', 'endTime'], |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
format: 'YYYY-MM-DD HH:mm:ss', |
|||
showTime: true, |
|||
'show-time': { |
|||
hideDisabledOptions: true, |
|||
defaultValue: [ |
|||
dateUtil('00:00:00', 'HH:mm:ss'), |
|||
dateUtil('23:59:59', 'HH:mm:ss'), |
|||
], |
|||
}, |
|||
}, |
|||
}, |
|||
], |
|||
params: {}, |
|||
}, |
|||
columns: [ |
|||
{ |
|||
title: '操作人', |
|||
textNumber: 6, |
|||
dataIndex: 'accountName', |
|||
}, |
|||
{ |
|||
title: '操作类型', |
|||
// width: 150, |
|||
textNumber: 6, |
|||
dataIndex: 'opType', |
|||
customRender: ({ text, record }) => { |
|||
return [ |
|||
'', |
|||
'登录', |
|||
'退出', |
|||
'新增', |
|||
'删除', |
|||
'更新', |
|||
'导入', |
|||
'导出', |
|||
'上传', |
|||
'下载', |
|||
'其他', |
|||
][text]; |
|||
}, |
|||
}, |
|||
{ |
|||
title: '日志内容', |
|||
// width: 150, |
|||
dataIndex: 'description', |
|||
}, |
|||
{ |
|||
title: '操作时间', |
|||
// width: 160, |
|||
dataIndex: 'opTime', |
|||
customRender: (value) => { |
|||
return value.text && dateUtil(value.text).format('YYYY-MM-DD HH:mm:ss'); |
|||
}, |
|||
}, |
|||
{ |
|||
title: '浏览器', |
|||
// width: 150, |
|||
// textNumber: 4, |
|||
dataIndex: 'browserName', |
|||
}, |
|||
{ |
|||
title: 'IP地址', |
|||
// width: 150, |
|||
dataIndex: 'ip', |
|||
}, |
|||
], |
|||
rowKey: 'uuid', |
|||
}; |
|||
|
|||
return { |
|||
tableConfig, |
|||
data, |
|||
}; |
|||
}, |
|||
}); |
|||
</script> |
@ -1,336 +0,0 @@ |
|||
<!-- @format --> |
|||
|
|||
<template> |
|||
<my-add-form |
|||
formLayout="修改" |
|||
:schemas="formSchema" |
|||
:model="data" |
|||
:title="uuid ? '编辑开屏广告' : '新增开屏广告'" |
|||
:api=" |
|||
uuid |
|||
? '/api/op_com/objs/admin/AdvertisingMarketingOper/releaseOpenScreen' |
|||
: '/api/op_com/objs/admin/AdvertisingMarketingOper/releaseOpenScreen' |
|||
" |
|||
draftApi="/api/op_com/objs/admin/AdvertisingMarketingOper/saveOpenScreen" /> |
|||
</template> |
|||
<script lang="ts"> |
|||
import { defineComponent, reactive, ref } from 'vue'; |
|||
import { useRouter } from 'vue-router'; |
|||
import myAddForm from '../components/add-form.vue'; |
|||
import { http } from '/nerv-lib/util/http'; |
|||
import { dateUtil } from '/nerv-lib/util/date-util'; |
|||
|
|||
export default defineComponent({ |
|||
name: 'OpenScreenManageAdd', |
|||
components: { myAddForm }, |
|||
setup() { |
|||
let data = ref({}); |
|||
const rouer = useRouter(); |
|||
const { uuid } = rouer.currentRoute.value.query; |
|||
let fileUrl = ref(); |
|||
const formSchema = ref(); |
|||
const request = () => { |
|||
return new Promise((resolve, reject) => { |
|||
http |
|||
.get('/api/op_com/objs/admin/AdvertisingMarketingOper/openScreenDetail', { uuid }) |
|||
.then((res) => { |
|||
const detail = res.data; |
|||
|
|||
resolve(detail); |
|||
}) |
|||
.catch((err) => { |
|||
reject(err); |
|||
}); |
|||
}); |
|||
}; |
|||
|
|||
let formSchemaDetail = [ |
|||
{ |
|||
field: 'uuid', |
|||
defaultValue: uuid, |
|||
}, |
|||
{ |
|||
field: 'field111', |
|||
label: '', |
|||
displayFormItem: false, |
|||
class: 'ns-form-item-full', |
|||
component: 'NsChildForm', |
|||
componentProps: { |
|||
title: '开屏广告内容', |
|||
schemas: [ |
|||
{ |
|||
field: 'name', |
|||
label: '开屏广告名称', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
placeholder: '请输入', |
|||
}, |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: '请输入开屏广告名称', |
|||
trigger: 'blur', |
|||
}, |
|||
{ min: 0, max: 20, message: '最多可输入20个字符', trigger: 'change' }, |
|||
], |
|||
}, |
|||
{ |
|||
field: 'fileUrl', |
|||
component: 'NsUpload', |
|||
label: '开屏广告图片', |
|||
componentProps: { |
|||
// 上传的地址 |
|||
url: '/api/fileunify/objs/admin/MaterialFile', |
|||
// 上传的图片大小 |
|||
maxSize: 5242880, |
|||
// 上传的图片类型 |
|||
fileType: ['jpg', 'png', 'jpeg'], |
|||
// 展示图片数量 |
|||
count: 1, |
|||
// 上传的文件类型,0-证书,1-图片,2-身份证件 |
|||
uploadType: 1, |
|||
baseImageUrl: fileUrl, |
|||
|
|||
params: { |
|||
groupCode: 'mobile_img', |
|||
}, |
|||
}, |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: '', |
|||
// type: 'array', |
|||
trigger: 'change', |
|||
}, |
|||
{ |
|||
validator: async (rule, value) => { |
|||
// // console.log('validator', value); |
|||
if (!value) { |
|||
return Promise.reject('请上传一张banner图片'); |
|||
} |
|||
}, |
|||
trigger: 'change', |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
field: 'httpUrl', |
|||
label: '跳转路径', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
placeholder: '请输入跳转链接', |
|||
}, |
|||
}, |
|||
{ |
|||
field: 'buttonText', |
|||
label: '按钮文字', |
|||
component: 'NsInput', |
|||
ifShow: (formModel) => { |
|||
if (formModel.httpUrl) { |
|||
return true; |
|||
} |
|||
return false; |
|||
}, |
|||
componentProps: { |
|||
placeholder: '请输入', |
|||
}, |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: '请输入按钮文字', |
|||
trigger: 'change', |
|||
}, |
|||
{ min: 0, max: 20, message: '最多可输入20个字符', trigger: 'change' }, |
|||
], |
|||
}, |
|||
{ |
|||
field: 'buttonText', |
|||
label: '按钮文字', |
|||
component: 'NsInput', |
|||
show: (formModel) => { |
|||
if (formModel.httpUrl) { |
|||
return false; |
|||
} |
|||
return true; |
|||
}, |
|||
componentProps: { |
|||
placeholder: '请输入', |
|||
}, |
|||
rules: [ |
|||
{ |
|||
required: false, |
|||
message: '请输入按钮文字', |
|||
trigger: 'blur', |
|||
}, |
|||
{ min: 0, max: 20, message: '最多可输入20个字符', trigger: 'change' }, |
|||
], |
|||
}, |
|||
], |
|||
}, |
|||
}, |
|||
{ |
|||
field: 'field111', |
|||
label: '', |
|||
displayFormItem: false, |
|||
class: 'ns-form-item-full', |
|||
component: 'NsChildForm', |
|||
componentProps: { |
|||
title: '投放规则', |
|||
schemas: [ |
|||
{ |
|||
field: 'time', |
|||
label: '投放时间', |
|||
component: 'NsRangePicker', |
|||
fieldMap: ['startTime', 'endTime'], |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
format: 'YYYY-MM-DD HH:mm:ss', |
|||
showTime: true, |
|||
'show-time': { |
|||
hideDisabledOptions: true, |
|||
defaultValue: [ |
|||
dateUtil('00:00:00', 'HH:mm:ss'), |
|||
dateUtil('23:59:59', 'HH:mm:ss'), |
|||
], |
|||
}, |
|||
}, |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: '请选择投放时间', |
|||
type: 'array', |
|||
trigger: 'change', |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
field: 'field', |
|||
label: '开屏广告排序', |
|||
component: 'NsSelect', |
|||
componentProps: { |
|||
placeholder: '请选择', |
|||
options: [ |
|||
{ |
|||
label: '1', |
|||
value: 1, |
|||
}, |
|||
{ |
|||
label: '2', |
|||
value: 2, |
|||
}, |
|||
{ |
|||
label: '3', |
|||
value: 3, |
|||
}, |
|||
{ |
|||
label: '4', |
|||
value: 4, |
|||
}, |
|||
{ |
|||
label: '5', |
|||
value: 5, |
|||
}, |
|||
{ |
|||
label: '6', |
|||
value: 6, |
|||
}, |
|||
], |
|||
}, |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: '请选择展示栏位', |
|||
type: 'number', |
|||
trigger: 'blur', |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
field: 'pushFrequency', |
|||
label: '推送频次', |
|||
component: 'NsRadioGroup', |
|||
componentProps: { |
|||
radioType: 'radio', |
|||
options: [ |
|||
{ label: '每日首次启动', value: 4 }, |
|||
{ label: '每次启动', value: 3 }, |
|||
{ label: '每次进入', value: 1 }, |
|||
], |
|||
}, |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: '请选择推送频次', |
|||
type: 'number', |
|||
trigger: 'blur', |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
field: 'customFrequencyValue', |
|||
label: '展示时间', |
|||
component: 'NsRadioGroup', |
|||
componentProps: { |
|||
radioType: 'radio', |
|||
options: [ |
|||
{ label: '3秒', value: '3' }, |
|||
{ label: '5秒', value: '5' }, |
|||
], |
|||
}, |
|||
rules: [ |
|||
{ |
|||
required: true, |
|||
message: '请选择展示时间', |
|||
type: 'string', |
|||
trigger: 'blur', |
|||
}, |
|||
], |
|||
}, |
|||
], |
|||
}, |
|||
}, |
|||
]; |
|||
if (uuid) { |
|||
request().then((res: any) => { |
|||
data.value = res; |
|||
fileUrl.value = res.fileUrl; |
|||
// 处理时间投放格式 |
|||
data.value.time = [ |
|||
dateUtil(res.startTime).format('YYYY-MM-DD HH:mm:ss'), |
|||
dateUtil(res.endTime).format('YYYY-MM-DD HH:mm:ss'), |
|||
]; |
|||
formSchema.value = Object.assign([], formSchemaDetail); |
|||
}); |
|||
} else { |
|||
formSchema.value = Object.assign([], formSchemaDetail); |
|||
} |
|||
|
|||
return { |
|||
data, |
|||
formSchema, |
|||
uuid, |
|||
}; |
|||
}, |
|||
|
|||
methods: {}, |
|||
}); |
|||
</script> |
|||
<style lang="less" scoped> |
|||
:deep(.ns-form .ns-child-form-title) { |
|||
text-align: left; |
|||
margin: 10 0 0 0 !important; |
|||
} |
|||
:deep(.ant-radio-group) { |
|||
font-size: 14px; |
|||
} |
|||
// :deep(.ant-radio-wrapper) { |
|||
// display: inline-block !important; |
|||
// } |
|||
:deep(.ant-radio) { |
|||
top: 1px; |
|||
} |
|||
// :deep(.ant-radio-inner::after) { |
|||
// width: 8px; |
|||
// height: 8px; |
|||
// } |
|||
</style> |
@ -1,96 +0,0 @@ |
|||
<!-- @format --> |
|||
|
|||
<template> |
|||
<div> |
|||
<customerDetail |
|||
title="查看开屏广告" |
|||
api="/api/op_com/objs/admin/AdvertisingMarketingOper/openScreenDetail" |
|||
:detail="detail" |
|||
checkApi="/api/op_com/objs/admin/AdvertisingMarketingOper/approvalOpenScreen" /> |
|||
</div> |
|||
</template> |
|||
<script lang="ts"> |
|||
import { defineComponent, reactive, ref } from 'vue'; |
|||
import customerDetail from '../components/customerDetail.vue'; |
|||
|
|||
import { dateUtil } from '/nerv-lib/util/date-util'; |
|||
import { useRouter } from 'vue-router'; |
|||
|
|||
export default defineComponent({ |
|||
name: 'OpenScreenManageDetail', |
|||
components: { customerDetail }, |
|||
setup() { |
|||
const rouer = useRouter(); |
|||
let status = ref(); |
|||
status.value = rouer.currentRoute.value.query.pushCrowd; |
|||
|
|||
const detail = reactive([ |
|||
{ |
|||
title: '开屏广告内容', |
|||
items: [ |
|||
{ |
|||
label: '开屏广告名称', |
|||
name: 'name', |
|||
}, |
|||
{ |
|||
label: '开屏广告图片', |
|||
name: 'fileUrl', |
|||
type: 'image', |
|||
}, |
|||
|
|||
{ |
|||
label: '跳转路径', |
|||
// type: 'html', |
|||
name: 'httpUrl', |
|||
// format: (value, data) => { |
|||
// return `H5:${data.httpUrl || '--'}<br />小程序:${data.appletsUrl || '--'}`; |
|||
// }, |
|||
}, |
|||
{ |
|||
label: '按钮文字', |
|||
name: 'buttonText', |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
title: '投放规则', |
|||
items: [ |
|||
{ |
|||
label: '投放时间', |
|||
name: 'pileCode', |
|||
format: (value, data) => { |
|||
return ( |
|||
dateUtil(data.startTime).format('YYYY-MM-DD HH:mm:ss') + |
|||
'~' + |
|||
dateUtil(data.endTime).format('YYYY-MM-DD HH:mm:ss') |
|||
); |
|||
}, |
|||
}, |
|||
{ |
|||
label: '开屏广告排序', |
|||
name: 'field', |
|||
}, |
|||
{ |
|||
label: '推送频次', |
|||
name: 'pushFrequency', |
|||
format: (value, data) => { |
|||
return ['', '每次进入', '', '每次启动', '每日首次启动'][value]; |
|||
}, |
|||
}, |
|||
{ |
|||
label: '展示时间', |
|||
name: 'customFrequencyValue', |
|||
format: (value, data) => { |
|||
return value + '秒'; |
|||
}, |
|||
}, |
|||
], |
|||
}, |
|||
]); |
|||
|
|||
return { |
|||
detail, |
|||
}; |
|||
}, |
|||
}); |
|||
</script> |
@ -1,226 +0,0 @@ |
|||
<!-- @format --> |
|||
|
|||
<template> |
|||
<ns-view-list-table v-bind="tableConfig" :model="data" rowKey="uuid"> |
|||
<template #bodyCell="{ record, column }"> |
|||
<template v-if="column.dataIndex === 'status'"> |
|||
<a-badge v-bind="checkStatus[record.status]" /> |
|||
</template> |
|||
</template> |
|||
</ns-view-list-table> |
|||
</template> |
|||
<script> |
|||
import { defineComponent, reactive } from 'vue'; |
|||
import { dateUtil } from '/nerv-lib/util/date-util'; |
|||
|
|||
export default defineComponent({ |
|||
name: 'OpenScreenManageIndex', |
|||
setup() { |
|||
const data = reactive({}); |
|||
const tableConfig = { |
|||
title: '开屏广告管理', |
|||
api: '/api/op_com/objs/admin/AdvertisingMarketingOper/openScreenList', |
|||
params: { |
|||
page: 0, |
|||
pageSize: 10, |
|||
}, |
|||
rowSelection: null, |
|||
// scroll: { x: 1000 }, |
|||
columns: [ |
|||
{ |
|||
title: '开屏广告名称', |
|||
// width: 100, |
|||
dataIndex: 'name', |
|||
}, |
|||
{ |
|||
title: '投放时间段', |
|||
// width: 110, |
|||
textNumber: 20, |
|||
dataIndex: 'applyTime', |
|||
customRender: ({ text, record }) => { |
|||
return `${dateUtil(record.startTime).format('YYYY-MM-DD HH:mm:ss')}~${dateUtil( |
|||
record.endTime, |
|||
).format('YYYY-MM-DD HH:mm:ss')}`; |
|||
}, |
|||
}, |
|||
{ |
|||
title: '开屏广告排序', |
|||
textNumber: 12, |
|||
dataIndex: 'field', |
|||
}, |
|||
{ |
|||
title: '状态', |
|||
dataIndex: 'status', |
|||
textNumber: 11, |
|||
}, |
|||
], |
|||
columnActions: { |
|||
title: '操作', |
|||
// width: 40, |
|||
// textNumber: 2, |
|||
actionNumber: 2, |
|||
autoMergeAction: false, |
|||
// fixed: 'right', |
|||
actions: [ |
|||
{ |
|||
label: '编辑', |
|||
name: 'OpenScreenManageEdit', |
|||
dynamicParams: ['uuid', 'status'], |
|||
ifShow: ({ status }) => status !== 2 && status !== 3 && status !== 5, |
|||
route: '/contentManage/systemManage/openScreenManage/edit', |
|||
}, |
|||
{ |
|||
label: '查看', |
|||
name: 'OpenScreenManageDetail', |
|||
dynamicParams: ['uuid', 'pushCrowd'], |
|||
ifShow: ({ status }) => status === 3 || status === 2 || status === 5, |
|||
route: '/contentManage/systemManage/openScreenManage/detail', |
|||
}, |
|||
{ |
|||
label: '审批', |
|||
name: 'OpenScreenManageDetailCheck', |
|||
dynamicParams: ['uuid', 'pushCrowd', 'status'], |
|||
ifShow: ({ status }) => status === 5, |
|||
route: '/contentManage/systemManage/openScreenManage/detailCheck', |
|||
}, |
|||
{ |
|||
label: '失效', |
|||
dynamicParams: 'uuid', |
|||
ifShow: ({ status }) => status === 0 || status === 4, |
|||
name: 'OpenScreenManageInvalidation', |
|||
confirm: true, |
|||
isReload: true, |
|||
api: '/api/op_com/objs/admin/AdvertisingMarketingOper/invalidationOpenScreen', |
|||
}, |
|||
{ |
|||
label: '删除', |
|||
dynamicParams: 'uuid', |
|||
ifShow: ({ status }) => status !== 0 && status !== 4 && status !== 5, |
|||
name: 'OpenScreenManageRemove', |
|||
confirm: true, |
|||
isReload: true, |
|||
api: '/api/op_com/objs/admin/AdvertisingMarketingOper/deleteOpenScreen', |
|||
}, |
|||
], |
|||
}, |
|||
headerActions: [ |
|||
{ |
|||
label: '新增', |
|||
name: 'OpenScreenManageAdd', |
|||
type: 'primary', |
|||
route: '/contentManage/systemManage/openScreenManage/add', |
|||
}, |
|||
], |
|||
formConfig: { |
|||
schemas: [ |
|||
{ |
|||
field: 'name', |
|||
label: '开屏广告名称', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
placeholder: '请输入', |
|||
}, |
|||
}, |
|||
{ |
|||
field: 'time', |
|||
label: '投放时间段', |
|||
component: 'NsRangePicker', |
|||
fieldMap: ['startTime', 'endTime'], |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
format: 'YYYY-MM-DD HH:mm:ss', |
|||
showTime: true, |
|||
'show-time': { |
|||
hideDisabledOptions: true, |
|||
defaultValue: [ |
|||
dateUtil('00:00:00', 'HH:mm:ss'), |
|||
dateUtil('23:59:59', 'HH:mm:ss'), |
|||
], |
|||
}, |
|||
}, |
|||
}, |
|||
{ |
|||
field: 'status', |
|||
label: '状态', |
|||
component: 'NsSelect', |
|||
defaultValue: '', |
|||
componentProps: { |
|||
options: [ |
|||
{ |
|||
label: '全部', |
|||
value: '', |
|||
}, |
|||
{ |
|||
label: '进行中', |
|||
value: 0, |
|||
}, |
|||
{ |
|||
label: '存草稿', |
|||
value: 1, |
|||
}, |
|||
{ |
|||
label: '已结束', |
|||
value: 2, |
|||
}, |
|||
{ |
|||
label: '已失效', |
|||
value: 3, |
|||
}, |
|||
{ |
|||
label: '未开始', |
|||
value: 4, |
|||
}, |
|||
{ |
|||
label: '待审核', |
|||
value: 5, |
|||
}, |
|||
{ |
|||
label: '审核驳回', |
|||
value: 6, |
|||
}, |
|||
], |
|||
}, |
|||
}, |
|||
], |
|||
params: {}, |
|||
}, |
|||
rowKey: 'uuid', |
|||
}; |
|||
const checkStatus = [ |
|||
{ |
|||
status: 'processing', |
|||
text: '进行中', |
|||
}, |
|||
{ |
|||
status: 'error', |
|||
text: '存草稿', |
|||
}, |
|||
{ |
|||
status: 'default', |
|||
text: '已结束', |
|||
}, |
|||
{ |
|||
color: '#000000', |
|||
text: '已失效', |
|||
}, |
|||
{ |
|||
status: 'success', |
|||
text: '未开始', |
|||
}, |
|||
{ |
|||
status: 'error', |
|||
text: '待审核', |
|||
}, |
|||
{ |
|||
color: '#000000', |
|||
text: '审核驳回', |
|||
}, |
|||
]; |
|||
return { |
|||
tableConfig, |
|||
data, |
|||
checkStatus, |
|||
}; |
|||
}, |
|||
}); |
|||
</script> |
@ -1,51 +0,0 @@ |
|||
{ |
|||
"compilerOptions": { |
|||
"allowJs": true, |
|||
"baseUrl": "./", |
|||
"esModuleInterop": true, |
|||
"forceConsistentCasingInFileNames": true, |
|||
"jsx": "preserve", |
|||
"lib": ["esnext", "dom"], |
|||
"module": "esnext", |
|||
"moduleResolution": "node", |
|||
"noUnusedLocals": true, |
|||
"noUnusedParameters": true, |
|||
"paths": { |
|||
"/@/*": [ |
|||
"src/*" |
|||
], |
|||
"/nerv-lib/*": [ |
|||
"../lib/*" |
|||
], |
|||
"/nerv-base/*": [ |
|||
"../lib/saas/*" |
|||
], |
|||
"/type/*": [ |
|||
"../type/*" |
|||
] |
|||
}, |
|||
"resolveJsonModule": true, |
|||
"skipLibCheck": true, |
|||
"sourceMap": true, |
|||
"strict": true, |
|||
"strictFunctionTypes": false, |
|||
"target": "esnext", |
|||
"typeRoots": [ |
|||
"../node_modules/@types", |
|||
"../node_modules/@vue", |
|||
"../type" |
|||
], |
|||
"types": ["vite/client"] |
|||
}, |
|||
"include": [ |
|||
"src/**/*", |
|||
"type/**/*", |
|||
"mock/**/*", |
|||
"vite.config.ts" |
|||
], |
|||
"exclude": [ |
|||
"node_modules", |
|||
"dist", |
|||
"**/*.js" |
|||
] |
|||
} |
@ -1,43 +0,0 @@ |
|||
/** @format */ |
|||
|
|||
import configFun from '../build/vite-default.config'; |
|||
const dirname = __dirname; |
|||
const proxy = { |
|||
'/api/web': { |
|||
// target: 'http://100.73.156.51:8080/api',
|
|||
target: 'http://100.86.13.179:8080/api', |
|||
|
|||
changeOrigin: true, |
|||
rewrite: (path) => path.replace(/^\/api\/web/, ''), |
|||
}, |
|||
'/api/content': { |
|||
target: 'http://100.86.13.144:8088/api', |
|||
changeOrigin: true, |
|||
rewrite: (path) => path.replace(/^\/api\/content/, ''), |
|||
}, |
|||
'/api/op_com': { |
|||
target: 'http://100.86.13.109:8082/api', |
|||
changeOrigin: true, |
|||
rewrite: (path) => path.replace(/^\/api\/op_com/, ''), |
|||
}, |
|||
'/api/fileunify': { |
|||
// target: 'http://100.73.156.51:8082/api',
|
|||
target: 'http://100.86.13.37:8085/api', |
|||
changeOrigin: true, |
|||
rewrite: (path) => path.replace(/^\/api\/fileunify/, ''), |
|||
}, |
|||
'/api/community': { |
|||
// target: 'http://100.73.156.51:8080/api',
|
|||
target: 'http://100.86.13.13:8080/api', |
|||
// target: 'http://100.86.13.123:8082/api',
|
|||
changeOrigin: true, |
|||
rewrite: (path) => path.replace(/^\/api\/community/, ''), |
|||
}, |
|||
'/qa': { |
|||
target: 'http://100.86.13.179:8080/qa', |
|||
// target: 'http://100.86.13.206:8081/qa',
|
|||
changeOrigin: true, |
|||
rewrite: (path) => path.replace(/^\/qa/, ''), |
|||
}, |
|||
}; |
|||
export default configFun({ dirname, proxy, serviceMode: 'saas', baseDir: '../' }); |
@ -1,10 +0,0 @@ |
|||
# port |
|||
VITE_PORT = 3301 |
|||
#mode |
|||
VITE_GLOB_APP_RUN_TYPE = saas |
|||
|
|||
# spa-title |
|||
VITE_GLOB_APP_TITLE = Smart Parking Depositor |
|||
|
|||
# spa shortname |
|||
VITE_GLOB_APP_SHORT_NAME = smart-parking-depositor |
@ -1,22 +0,0 @@ |
|||
# Whether to open mock |
|||
VITE_USE_MOCK = true |
|||
|
|||
# public path |
|||
VITE_PUBLIC_PATH = / |
|||
|
|||
# Cross-domain proxy, you can configure multiple |
|||
# Please note that no line breaks http://100.73.70.51 |
|||
|
|||
#VITE_PROXY = {"/community":{ "target":"http://100.73.70.51","changeOrigin": true,"prependPath":false},"/parking":{ "target":"http://100.73.70.246:8080","changeOrigin": true,"iprependPath":false}} |
|||
# VITE_PROXY=[["/api","http://100.73.70.51"],["/parking","http://100.73.70.246:8080"]] |
|||
# Delete console |
|||
VITE_DROP_CONSOLE = false |
|||
|
|||
# Basic interface address SPA |
|||
VITE_GLOB_API_URL=/basic-api |
|||
|
|||
# File upload address, optional |
|||
VITE_GLOB_UPLOAD_URL=/upload |
|||
|
|||
# Interface prefix |
|||
VITE_GLOB_API_URL_PREFIX= |
@ -1,35 +0,0 @@ |
|||
# Whether to open mock |
|||
VITE_USE_MOCK = true |
|||
|
|||
# public path |
|||
VITE_PUBLIC_PATH = / |
|||
|
|||
# Delete console |
|||
VITE_DROP_CONSOLE = true |
|||
|
|||
# Whether to enable gzip or brotli compression |
|||
# Optional: gzip | brotli | none |
|||
# If you need multiple forms, you can use `,` to separate |
|||
VITE_BUILD_COMPRESS = 'none' |
|||
|
|||
# Whether to delete origin files when using compress, default false |
|||
VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false |
|||
|
|||
# Basic interface address SPA |
|||
VITE_GLOB_API_URL=/basic-api |
|||
|
|||
# File upload address, optional |
|||
# It can be forwarded by nginx or write the actual address directly |
|||
VITE_GLOB_UPLOAD_URL=/upload |
|||
|
|||
# Interface prefix |
|||
VITE_GLOB_API_URL_PREFIX= |
|||
|
|||
# Whether to enable image compression |
|||
VITE_USE_IMAGEMIN= true |
|||
|
|||
# use pwa |
|||
VITE_USE_PWA = false |
|||
|
|||
# Is it compatible with older browsers |
|||
VITE_LEGACY = false |
@ -1 +0,0 @@ |
|||
2.1.19 |
@ -1,74 +0,0 @@ |
|||
#!/bin/bash |
|||
SOURCE="$0" |
|||
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink |
|||
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" |
|||
SOURCE="$(readlink "$SOURCE")" |
|||
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located |
|||
done |
|||
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" |
|||
|
|||
if [ -z $WORKSPACE ];then |
|||
echo "WORKSPACE not exists" |
|||
else |
|||
set DIR=$WORKSPACE |
|||
fi |
|||
|
|||
echo "current dir" |
|||
echo "$DIR" |
|||
|
|||
cd "$DIR" |
|||
projectname=$(basename `pwd`) |
|||
|
|||
npm run parking-build |
|||
|
|||
if [ -d "$DIR/dist" ];then |
|||
|
|||
cd "$DIR/dist" |
|||
|
|||
# copy module.json |
|||
cp ../module.json ./ |
|||
|
|||
# package |
|||
VERSION=$(cat ../.version) |
|||
lastdir=../release/ |
|||
if [ -d ${lastdir} ];then |
|||
echo "删除旧release文件夹" |
|||
rm -rf ${lastdir} |
|||
else |
|||
echo "文件夹不存在!" |
|||
fi |
|||
mkdir -p ${lastdir} |
|||
|
|||
dir=../release/nerv/$projectname/$VERSION |
|||
mkdir -p ${dir} |
|||
tar -zcvf "${dir}/$projectname-$VERSION.tgz" ./* |
|||
|
|||
templatedir=../release/resources/templates/nerv/$projectname/$VERSION/$projectname |
|||
mkdir -p ${templatedir} |
|||
cp -r ../resources/templates/* ${templatedir} |
|||
|
|||
cd ../ |
|||
|
|||
releasefile=nerv-$projectname-$VERSION.tgz |
|||
if [ -f ${releasefile} ];then |
|||
echo "删除旧包!" |
|||
rm -rf ${releasefile} |
|||
fi |
|||
|
|||
tar -zcvf ${releasefile} ./release/* release.yaml |
|||
|
|||
mkdir -p ./release/nervui |
|||
cp -r ./release/nerv/* ./release/nervui |
|||
|
|||
if [ -f ${releasefile} ];then |
|||
echo "编译成功!" |
|||
mv ${releasefile} ./release |
|||
else |
|||
echo "编译失败!!!" |
|||
exit 1 |
|||
fi |
|||
|
|||
else |
|||
echo "编译失败!!!" |
|||
exit 1 |
|||
fi |
@ -1,24 +0,0 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en"> |
|||
<head> |
|||
<meta charset="UTF-8" /> |
|||
<link rel="icon" href="/favicon.ico" /> |
|||
<meta name="referrer" content="never" /> |
|||
<!-- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/leaflet.css" /> |
|||
<link rel="stylesheet" href="https://iclient.supermap.io/dist/leaflet/iclient-leaflet.min.css" /> |
|||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/leaflet.js"></script> |
|||
<script type="text/javascript" src="https://iclient.supermap.io/dist/leaflet/iclient-leaflet.js"></script> --> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
|||
<script type="text/javascript"> |
|||
window._AMapSecurityConfig = { |
|||
securityJsCode: '09e43004c09d39c0e61f8fd65d5e6a5a', |
|||
}; |
|||
</script> |
|||
<title>smart-parking</title> |
|||
</head> |
|||
<body> |
|||
<div id="app"></div> |
|||
<script type="module" src="./src/main.ts"></script> |
|||
|
|||
</body> |
|||
</html> |
@ -1,95 +0,0 @@ |
|||
import type { MockConfig, MockMethod } from 'vite-plugin-mock'; |
|||
|
|||
import { getRequestToken, resultError, resultSuccess } from '/nerv-base/util/mock'; |
|||
|
|||
const fakeUserList = [ |
|||
{ |
|||
userId: '1', |
|||
username: 'vben', |
|||
realName: 'Vben Admin', |
|||
avatar: '', |
|||
desc: 'manager', |
|||
password: '123456', |
|||
accessToken: 'fakeAdminToken', |
|||
homePath: '/dashboard', |
|||
roles: [ |
|||
{ |
|||
roleName: 'Super Admin', |
|||
value: 'super', |
|||
}, |
|||
], |
|||
}, |
|||
{ |
|||
userId: '2', |
|||
username: 'test', |
|||
password: '123456', |
|||
realName: 'test user', |
|||
avatar: '', |
|||
desc: 'tester', |
|||
accessToken: 'fakeTestToken', |
|||
homePath: '/dashboard/workbench', |
|||
roles: [ |
|||
{ |
|||
roleName: 'Tester', |
|||
value: 'test', |
|||
}, |
|||
], |
|||
}, |
|||
]; |
|||
|
|||
export default (_config: MockConfig): MockMethod[] => { |
|||
return [ |
|||
{ |
|||
url: '/req-api/login', |
|||
timeout: 200, |
|||
method: 'post', |
|||
response: ({ body }) => { |
|||
const { username, password } = body; |
|||
const checkUser = fakeUserList.find( |
|||
(item) => item.username === username && password === item.password, |
|||
); |
|||
if (!checkUser) { |
|||
return resultError('Incorrect account or password!'); |
|||
} |
|||
const { userId, username: _username, accessToken, realName, desc, roles } = checkUser; |
|||
return resultSuccess({ |
|||
roles, |
|||
userId, |
|||
username: _username, |
|||
accessToken, |
|||
realName, |
|||
desc, |
|||
}); |
|||
}, |
|||
}, |
|||
{ |
|||
url: '/req-api/getUserInfo', |
|||
method: 'get', |
|||
timeout: 100, |
|||
response: (request) => { |
|||
const token = getRequestToken(request) || 'fakeAdminToken'; |
|||
if (!token) return resultError('Invalid token'); |
|||
const checkUser = fakeUserList.find((item) => item.accessToken === token); |
|||
if (!checkUser) { |
|||
return resultError('The corresponding user information was not obtained!'); |
|||
} |
|||
const { accessToken: _token, password: _pwd, ...rest } = checkUser; |
|||
return resultSuccess(rest); |
|||
}, |
|||
}, |
|||
{ |
|||
url: '/req-api/logout', |
|||
timeout: 200, |
|||
method: 'get', |
|||
response: (request) => { |
|||
const token = getRequestToken(request); |
|||
if (!token) return resultError('Invalid token'); |
|||
const checkUser = fakeUserList.find((item) => item.accessToken === token); |
|||
if (!checkUser) { |
|||
return resultError('Invalid token!'); |
|||
} |
|||
return resultSuccess(undefined, { message: 'Token has been destroyed' }); |
|||
}, |
|||
}, |
|||
]; |
|||
}; |