@ -0,0 +1,23 @@ |
|||
root = true |
|||
|
|||
[*] |
|||
charset = utf-8 |
|||
indent_style = space |
|||
end_of_line = lf |
|||
insert_final_newline = true |
|||
trim_trailing_whitespace = true |
|||
|
|||
[*.md] |
|||
trim_trailing_whitespace = false |
|||
|
|||
[*.js] |
|||
indent_size = 2 |
|||
|
|||
[*.vue] |
|||
indent_size = 2 |
|||
|
|||
[*.css] |
|||
indent_size = 2 |
|||
|
|||
[Makefile] |
|||
indent_style = tab |
|||
@ -0,0 +1,23 @@ |
|||
# just a flag |
|||
ENV='development' |
|||
port=3003 |
|||
# vue enviroment |
|||
|
|||
VUE_APP_ENVIRONMENT='development' |
|||
VUE_APP_CMS_INNER_BASE_URL='http://bipaas.elinkservice.cn/linkdata' |
|||
VUE_APP_BIPASS_API_SERVER='/linkdata/linkdata-gateway/route' |
|||
VUE_APP_CMS_BASE_URL='//store.linkkids.cn' |
|||
VUE_APP_OPTION_PAGE_URL='http://test.kiop.linkkids.cn/kiop-web/field/toRuleList.do' |
|||
VUE_APP_EXPORT_PAGE_URL='http://test.kiop.linkkids.cn/kiop-web/task/toTaskList.do' |
|||
VUE_APP_MINI_APP_URL='https://miniapi.linkkids.cn' |
|||
VUE_APP_BI_URL='http://49.234.48.41:3000' |
|||
VUE_APP_LAYOUT_URL='https://st.linkkids.cn' |
|||
VUE_APP_BI_DOMAIN='//linkdatatest.retailo2o.com' |
|||
VUE_APP_ST_DOMAIN='//st.retailo2o.com/p/h5-databi/' |
|||
VUE_APP_STORE_URL='//dev.retailo2o.com:3003' |
|||
VUE_APP_CSCS_URL='http://test.cscs.retailo2o.com' |
|||
VUE_APP_MINI_API_URL='//miniapi.retailo2o.com' |
|||
VUE_APP_LOWCODE_URL='//ams.retailo2o.com/api' |
|||
VUE_APP_LOWCODE_DESIGN='//ams.retailo2o.com/page-designer' |
|||
VUE_APP_LOWCODE_VIEWER='//ams.retailo2o.com/page-viewer' |
|||
|
|||
@ -0,0 +1,24 @@ |
|||
# just a flag |
|||
ENV='production' |
|||
port=3003 |
|||
# vue enviroment |
|||
|
|||
|
|||
VUE_APP_ENVIRONMENT='development' |
|||
VUE_APP_CMS_INNER_BASE_URL='http://bipaas.elinkservice.cn/linkdata' |
|||
VUE_APP_CMS_BASE_URL='//store.linkkids.cn' |
|||
VUE_APP_BIPASS_API_SERVER = 'https://epmet-preview.elinkservice.cn/linkdata/linkdata-gateway/route' |
|||
VUE_APP_OPTION_PAGE_URL='http://test.kiop.linkkids.cn/kiop-web/field/toRuleList.do' |
|||
VUE_APP_EXPORT_PAGE_URL='http://test.kiop.linkkids.cn/kiop-web/task/toTaskList.do' |
|||
VUE_APP_MINI_APP_URL='https://miniapi.linkkids.cn' |
|||
VUE_APP_BI_URL='http://49.234.48.41:3000' |
|||
VUE_APP_LAYOUT_URL='https://st.linkkids.cn' |
|||
VUE_APP_BI_DOMAIN='//linkdatatest.retailo2o.com' |
|||
VUE_APP_ST_DOMAIN='//st.retailo2o.com/p/h5-databi/' |
|||
VUE_APP_STORE_URL='//dev.retailo2o.com:3003' |
|||
VUE_APP_CSCS_URL='http://test.cscs.retailo2o.com' |
|||
VUE_APP_MINI_API_URL='//miniapi.retailo2o.com' |
|||
VUE_APP_LOWCODE_URL='//ams.retailo2o.com/api' |
|||
VUE_APP_LOWCODE_DESIGN='//ams.retailo2o.com/page-designer' |
|||
VUE_APP_LOWCODE_VIEWER='//ams.retailo2o.com/page-viewer' |
|||
|
|||
@ -0,0 +1,4 @@ |
|||
build/*.js |
|||
src/assets |
|||
public |
|||
dist |
|||
@ -0,0 +1,8 @@ |
|||
module.exports = { |
|||
root: true, |
|||
extends: [], |
|||
|
|||
// add your custom rules here
|
|||
// it is base on https://github.com/vuejs/eslint-config-vue
|
|||
rules: {}, |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
.DS_Store |
|||
node_modules/ |
|||
dist |
|||
dist* |
|||
npm-debug.log* |
|||
yarn-debug.log* |
|||
yarn-error.log* |
|||
package-lock.json |
|||
tests/**/coverage/ |
|||
.env.*.local |
|||
# Editor directories and files |
|||
.idea |
|||
.history |
|||
.vscode |
|||
*.suo |
|||
*.ntvs* |
|||
*.njsproj |
|||
*.sln |
|||
@ -0,0 +1,2 @@ |
|||
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/ |
|||
registry=http://npmneibu.linkkids.cn/ |
|||
@ -0,0 +1,5 @@ |
|||
language: node_js |
|||
node_js: 10 |
|||
script: npm run test |
|||
notifications: |
|||
email: false |
|||
@ -0,0 +1,21 @@ |
|||
MIT License |
|||
|
|||
Copyright (c) 2017-present PanJiaChen |
|||
|
|||
Permission is hereby granted, free of charge, to any person obtaining a copy |
|||
of this software and associated documentation files (the "Software"), to deal |
|||
in the Software without restriction, including without limitation the rights |
|||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|||
copies of the Software, and to permit persons to whom the Software is |
|||
furnished to do so, subject to the following conditions: |
|||
|
|||
The above copyright notice and this permission notice shall be included in all |
|||
copies or substantial portions of the Software. |
|||
|
|||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
|||
SOFTWARE. |
|||
@ -0,0 +1,51 @@ |
|||
# vue-admin-template |
|||
|
|||
## 功能点 |
|||
- 集成了友盟的上报js |
|||
- 请求axios集成了上报功能 |
|||
|
|||
## 构建 |
|||
|
|||
```bash |
|||
# 克隆项目 |
|||
git clone http://code.linkkids.cn/fe_web_public/vue-admin-template.git |
|||
|
|||
# 进入项目目录 |
|||
cd vue-admin-template |
|||
|
|||
# 安装依赖 |
|||
npm install |
|||
|
|||
npm install --registry=http://npmneibu.linkkids.cn |
|||
|
|||
# 启动服务 |
|||
npm run dev |
|||
``` |
|||
|
|||
浏览器访问 [http://localhost:9528](http://localhost:9528) |
|||
|
|||
## 发布 |
|||
|
|||
```bash |
|||
# 构建测试环境 |
|||
npm run build:stage |
|||
|
|||
# 构建生产环境 |
|||
npm run build:prod |
|||
``` |
|||
|
|||
## 其它 |
|||
|
|||
```bash |
|||
# 预览发布环境效果 |
|||
npm run preview |
|||
|
|||
# 预览发布环境效果 + 静态资源分析 |
|||
npm run preview -- --report |
|||
|
|||
# 代码格式检查 |
|||
npm run lint |
|||
|
|||
# 代码格式检查并自动修复 |
|||
npm run lint -- --fix |
|||
``` |
|||
@ -0,0 +1,24 @@ |
|||
const prodPlugins = [] |
|||
if (process.env.VUE_APP_CONSOLE_CLOSE === 'true') { |
|||
prodPlugins.push('transform-remove-console') |
|||
} |
|||
module.exports = { |
|||
presets: [ |
|||
[ |
|||
// https://github.com/vuejs/vue-cli/tree/master/packages/@vue/babel-preset-app
|
|||
'@vue/cli-plugin-babel/preset', |
|||
{ |
|||
useBuiltIns: 'usage', |
|||
corejs: '3.5', |
|||
}, |
|||
], |
|||
], |
|||
env: { |
|||
development: { |
|||
// babel-plugin-dynamic-import-node plugin only does one thing by converting all import() to require().
|
|||
// This plugin can significantly increase the speed of hot updates, when you have a large number of pages.
|
|||
// https://panjiachen.github.io/vue-element-admin-site/guide/advanced/lazy-loading.html
|
|||
plugins: ['dynamic-import-node', ...prodPlugins], |
|||
}, |
|||
}, |
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
#!/bin/bash |
|||
NODE_HOME=/opt/nodejs/v11.6.1 |
|||
export PATH=$NODE_HOME/bin:$PATH |
|||
export NODE_PATH=$NODE_HOME/lib/node_modules |
|||
node -v |
|||
npm -v |
|||
ls -al |
|||
npm set registry http://npmneibu.linkkids.cn |
|||
npm install |
|||
if [ "$SER_ENV" == "IDC" ]; then |
|||
npm run build:hzw |
|||
else |
|||
npm run build:hzw-stage |
|||
fi |
|||
@ -0,0 +1,14 @@ |
|||
#!/bin/bash |
|||
NODE_HOME=/opt/nodejs/v12.22.12 |
|||
export PATH=$NODE_HOME/bin:$PATH |
|||
export NODE_PATH=$NODE_HOME/lib/node_modules |
|||
node -v |
|||
npm -v |
|||
ls -al |
|||
npm set registry http://npmneibu.linkkids.cn |
|||
npm install |
|||
if [ "$ENV" == "prod" ]; then |
|||
npm run build:prod |
|||
else |
|||
npm run build:stage |
|||
fi |
|||
@ -0,0 +1,35 @@ |
|||
const { run } = require('runjs') |
|||
const chalk = require('chalk') |
|||
const config = require('../vue.config.js') |
|||
const rawArgv = process.argv.slice(2) |
|||
const args = rawArgv.join(' ') |
|||
|
|||
if (process.env.npm_config_preview || rawArgv.includes('--preview')) { |
|||
const report = rawArgv.includes('--report') |
|||
|
|||
run(`vue-cli-service build ${args}`) |
|||
|
|||
const port = 9526 |
|||
const publicPath = config.publicPath |
|||
|
|||
var connect = require('connect') |
|||
var serveStatic = require('serve-static') |
|||
const app = connect() |
|||
|
|||
app.use( |
|||
publicPath, |
|||
serveStatic('./dist', { |
|||
index: ['index.html', '/'] |
|||
}) |
|||
) |
|||
|
|||
app.listen(port, function () { |
|||
console.log(chalk.green(`> Preview at http://localhost:${port}${publicPath}`)) |
|||
if (report) { |
|||
console.log(chalk.green(`> Report at http://localhost:${port}${publicPath}report.html`)) |
|||
} |
|||
|
|||
}) |
|||
} else { |
|||
run(`vue-cli-service build ${args}`) |
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
module.exports = { |
|||
moduleFileExtensions: ['js', 'jsx', 'json', 'vue'], |
|||
transform: { |
|||
'^.+\\.vue$': 'vue-jest', |
|||
'.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub', |
|||
'^.+\\.jsx?$': 'babel-jest', |
|||
}, |
|||
moduleNameMapper: { |
|||
'^@/(.*)$': '<rootDir>/src/$1', |
|||
}, |
|||
snapshotSerializers: ['jest-serializer-vue'], |
|||
testMatch: ['**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)'], |
|||
collectCoverageFrom: [ |
|||
'src/utils/**/*.{js,vue}', |
|||
'!src/utils/auth.js', |
|||
'!src/utils/request.js', |
|||
'src/components/**/*.{js,vue}', |
|||
], |
|||
coverageDirectory: '<rootDir>/tests/unit/coverage', |
|||
// 'collectCoverage': true,
|
|||
coverageReporters: ['lcov', 'text-summary'], |
|||
testURL: 'http://localhost/', |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
{ |
|||
"compilerOptions": { |
|||
"baseUrl": "./", |
|||
"paths": { |
|||
"@/*": ["src/*"] |
|||
} |
|||
}, |
|||
"exclude": ["node_modules", "dist"] |
|||
} |
|||
@ -0,0 +1,102 @@ |
|||
{ |
|||
"name": "data-bi", |
|||
"version": "1.0.0", |
|||
"description": "A project named template-manage", |
|||
"scripts": { |
|||
"dev": "vue-cli-service serve", |
|||
"build": "vue-cli-service build", |
|||
"build:prod": "vue-cli-service build", |
|||
"build:test": "vue-cli-service build --mode development", |
|||
"build:stage": "vue-cli-service build --mode staging", |
|||
"build:drtest": "vue-cli-service build --mode drtest", |
|||
"build:drprod": "vue-cli-service build --mode drprod", |
|||
"build:hzw": "vue-cli-service build --mode hzw", |
|||
"build:tm": "vue-cli-service build --mode tm", |
|||
"build:bx": "vue-cli-service build --mode bx", |
|||
"build:yl": "vue-cli-service build --mode yl", |
|||
"preview": "node build/index.js --preview", |
|||
"svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml", |
|||
"lint": "vue-cli-service lint", |
|||
"test:unit": "jest --clearCache && vue-cli-service test:unit", |
|||
"test:ci": "npm run lint && npm run test:unit", |
|||
"deploy:linkkids": "scp dist/index.html linkkids@10.250.14.5:/data/web/pc/linkbi && scp -r dist/* linkkids@10.250.14.5:/data/static/pc/linkbi/", |
|||
"deploy:elinkservice": "scp dist/index.html bizcent@10.254.0.144:/data/web/pc/linkbi && scp -r dist/* bizcent@10.254.0.144:/data/static/pc/linkbi/", |
|||
"deploylc:elinkservice": "scp dist/index.html bizcent@10.254.0.144:/data/web/pc/linkbi && scp -r dist/* bizcent@10.254.0.144:/data/static/pc/linkbi", |
|||
"deploy:bx": "scp -r dist/* root@10.0.2.13:/data/web/linkbi", |
|||
"deploy": "npm run deploy:linkkids && npm run deploy:elinkservice" |
|||
}, |
|||
"dependencies": { |
|||
"@sweetjs/link-style": "1.0.0-beta.3", |
|||
"@sweetjs/post-message-tool": "^1.0.4", |
|||
"@sweetjs/request": "2.0.9", |
|||
"@formily/core": "2.0.11", |
|||
"@formily/element": "2.0.11", |
|||
"@formily/vue": "2.0.11", |
|||
"@riophae/vue-treeselect": "^0.4.0", |
|||
"@vue/composition-api": "^1.4.6", |
|||
"axios": "^0.19.0", |
|||
"babel-plugin-transform-remove-console": "^6.9.4", |
|||
"clipboard": "^2.0.10", |
|||
"codemirror": "^5.63.3", |
|||
"core-js": "^3.37.1", |
|||
"crypto-js": "^4.1.1", |
|||
"dai-js": "^0.0.12", |
|||
"dayjs": "^1.11.3", |
|||
"echarts": "^5.4.1", |
|||
"element-theme-chalk": "^2.14.1", |
|||
"element-ui": "2.15.6", |
|||
"file-saver": "^2.0.5", |
|||
"js-cookie": "2.2.0", |
|||
"lodash-es": "^4.17.21", |
|||
"nanoid": "^4.0.0", |
|||
"normalize.css": "7.0.0", |
|||
"nprogress": "0.2.0", |
|||
"path-to-regexp": "2.4.0", |
|||
"relation-graph": "^2.0.24", |
|||
"uuid": "^8.3.2", |
|||
"v-jsoneditor": "^1.4.4", |
|||
"vue": "2.6.13", |
|||
"vue-router": "^3.5.3", |
|||
"vuedraggable": "^2.24.3", |
|||
"vuex": "3.1.0", |
|||
"vxe-table": "^2.10.22", |
|||
"xe-utils": "3.1.11" |
|||
}, |
|||
"devDependencies": { |
|||
"@vue/cli-plugin-babel": "4.4.4", |
|||
"@vue/cli-plugin-eslint": "4.4.4", |
|||
"@vue/cli-plugin-unit-jest": "4.4.4", |
|||
"@vue/cli-service": "4.4.4", |
|||
"@vue/test-utils": "1.0.0-beta.29", |
|||
"autoprefixer": "9.5.1", |
|||
"babel-eslint": "10.1.0", |
|||
"babel-jest": "23.6.0", |
|||
"babel-plugin-dynamic-import-node": "2.3.3", |
|||
"chalk": "2.4.2", |
|||
"connect": "3.6.6", |
|||
"eslint": "^7.22.0", |
|||
"eslint-plugin-import": "^2.22.1", |
|||
"eslint-plugin-prettier": "^3.3.1", |
|||
"eslint-plugin-vue": "^7.7.0", |
|||
"html-webpack-plugin": "3.2.0", |
|||
"mockjs": "1.0.1-beta3", |
|||
"prettier": "^2.2.1", |
|||
"runjs": "4.3.2", |
|||
"sass": "^1.52.1", |
|||
"sass-loader": "8.0.2", |
|||
"script-ext-html-webpack-plugin": "2.1.3", |
|||
"serve-static": "1.13.2", |
|||
"svg-sprite-loader": "4.1.3", |
|||
"svgo": "1.2.2", |
|||
"vue-template-compiler": "2.6.13" |
|||
}, |
|||
"browserslist": [ |
|||
"> 1%", |
|||
"last 2 versions" |
|||
], |
|||
"engines": { |
|||
"node": ">=8.9", |
|||
"npm": ">= 3.0.0" |
|||
}, |
|||
"license": "MIT" |
|||
} |
|||
@ -0,0 +1,8 @@ |
|||
// https://github.com/michael-ciniawsky/postcss-load-config
|
|||
|
|||
module.exports = { |
|||
plugins: { |
|||
// to edit target browsers: use "browserslist" field in package.json
|
|||
autoprefixer: {}, |
|||
}, |
|||
} |
|||
@ -0,0 +1,45 @@ |
|||
body, |
|||
html { |
|||
height: 100%; |
|||
margin: 0; |
|||
padding: 0; |
|||
} |
|||
body { |
|||
background: #f0f4f7; |
|||
} |
|||
.page-root { |
|||
height: 100%; |
|||
display: flex; |
|||
flex-direction: column; |
|||
} |
|||
.page-root > [class^="page-node-"] { |
|||
margin: 5px 10px; |
|||
} |
|||
|
|||
.page-node-form-filter, |
|||
.page-node-table { |
|||
background: #fff; |
|||
border-radius: 4px; |
|||
padding: 3px 6px; |
|||
margin: 6px; |
|||
box-shadow: 0 0 6px 0 #dfdfdf; |
|||
} |
|||
.page-node-table { |
|||
flex: 1; |
|||
overflow: hidden; |
|||
} |
|||
:root { |
|||
--el-color-primary: #3862fe; |
|||
--el-color-danger: #f56c6c; |
|||
--el-color-danger-light-3: #ff3a00; |
|||
--el-color-success: #36850f; |
|||
--el-text-color-primary: #121212; |
|||
--el-text-color-regular: #121212; |
|||
--el-font-size-base: 12px; |
|||
--grid-item-content-border-radius:18px; |
|||
} |
|||
.el-button--primary.is-link, |
|||
.el-button--primary.is-plain, |
|||
.el-button--primary.is-text { |
|||
--el-button-text-color: #274ffb; |
|||
} |
|||
@ -0,0 +1,21 @@ |
|||
body,html{height:100%; margin:0;padding:0} |
|||
body{background:#f0f2f5} |
|||
.page-root{height:100%;display:flex;flex-direction:column} |
|||
.page-node-form-filter,.page-node-table{background:#fff;border-radius:4px;padding:3px 6px;margin:6px;box-shadow:0 0 6px 0 #dfdfdf} |
|||
.page-node-table{flex:1;overflow:hidden} |
|||
:root{ |
|||
--el-color-primary:#3862FE; |
|||
--el-color-danger:#F56C6C; |
|||
--el-color-danger-light-3:#FF3A00; |
|||
--el-color-success:#36850F; |
|||
--el-text-color-primary:#121212; |
|||
--el-text-color-regular:#121212; |
|||
--el-font-size-base:12px; |
|||
} |
|||
.el-button--primary.is-link, .el-button--primary.is-plain, .el-button--primary.is-text{ |
|||
--el-button-text-color:#274FFB; |
|||
} |
|||
.el-button.el-button--small { |
|||
font-size: 12px; |
|||
padding: 5px 11px; |
|||
} |
|||
@ -0,0 +1,17 @@ |
|||
<!DOCTYPE html> |
|||
<html> |
|||
<head> |
|||
<meta charset="utf-8"> |
|||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> |
|||
<meta name="project-name" content="bi报表"> |
|||
<title><%= webpackConfig.name %></title> |
|||
</head> |
|||
<body> |
|||
<noscript> |
|||
<strong>We're sorry but <%= webpackConfig.name %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> |
|||
</noscript> |
|||
<div id="app"></div> |
|||
<!-- built files will be auto injected --> |
|||
</body> |
|||
</html> |
|||
@ -0,0 +1,3 @@ |
|||
{ |
|||
"cjy-backend.darryring.com/linkdata-gateway":"cjy-testlinkdata.darryring.com/linkdata-gateway" |
|||
} |
|||
@ -0,0 +1,3 @@ |
|||
{ |
|||
|
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
<template> |
|||
<div id="app"> |
|||
<router-view /> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
name: 'App', |
|||
} |
|||
</script> |
|||
@ -0,0 +1,3 @@ |
|||
// const host = process.env.NODE_ENV === 'production' ? '10.250.14.114' : 'dev.linkkids.cn/_dev_proxy'
|
|||
|
|||
export const COMMON_API = `${process.env.VUE_APP_BI_DOMAIN}/${process.env.VUE_APP_LINKDATA_GATEWAY || 'linkdata-gateway'}/route` |
|||
@ -0,0 +1,227 @@ |
|||
/* |
|||
* @Descripttion: |
|||
* @version: |
|||
* @Author: 张齐 |
|||
* @Date: 2021-07-12 19:33:47 |
|||
* @LastEditors: 张齐 |
|||
* @LastEditTime: 2021-07-28 18:57:42 |
|||
*/ |
|||
import request from '@/utils/request' |
|||
|
|||
/** |
|||
* 新增CMS |
|||
* @param {*} elmentObj |
|||
* |
|||
*/ |
|||
const addCMS = (elmentObj, site = 100996) => { |
|||
const addJson = { |
|||
type: 'add', // add/copy/link,默认add
|
|||
page: { |
|||
// 初始化页面信息,type为add时可修改所有,type为copy/link时page字段可不传,如果修改,只能初始化page下name,outputPath,validityEnd
|
|||
name: elmentObj.name || '新增页面', // 页面名,大于2字符
|
|||
description: '描述', |
|||
category: elmentObj.category || 'activity', // 分类,channel/activity/config,默认channel
|
|||
htmlPath: '', // 前端页面地址,原样返回,[siteId][pageId]需前台自行替换
|
|||
outputPath: elmentObj.outputPath || '', // 自定义路径,默认为'' 只能是字母、数字、/、-、_,且最后文件名不能为纯数字,开头结尾不能为/
|
|||
autoPublish: true, // 是否自动发布,页面内容会随时间变化的选true,默认false
|
|||
validityStart: 0, // 开始时间,默认0,时间戳或字符串(返回到前台,后台无逻辑处理)
|
|||
validityEnd: '2099/12/31 00:00:00', // 结束时间,时间戳或字符串,默认一个月后,超过结束时间页面不会自动发布
|
|||
isV: false, // 是否可视化页面,默认false
|
|||
outputType: 'json', // 输出类型 json/jsonp/html,默认json
|
|||
template: { |
|||
// 输出类型为html,且isV为false时手动配置模板,默认可不填
|
|||
engine: '', // 目前只支持hbs
|
|||
source: '', // 模板文件,有值时tmpl不起作用
|
|||
tmpl: '', // 模板内容
|
|||
layout: '', // 模板layout
|
|||
}, |
|||
dataSchema: elmentObj.dataSchema, // type为add且isV为false时可初始化dataSchema,可不填
|
|||
data: elmentObj.data, // type为add且isV为false时可初始化data,可不填
|
|||
}, |
|||
sourceSiteId: 0, // type为copy/link时许指定源页面siteId
|
|||
sourcePageId: 0, // type为copy/link时许指定源页面pageId
|
|||
source: 'cms', |
|||
platform: elmentObj.platform, // 如果没有指定租户,则是100100租户
|
|||
} |
|||
return request.post(`${process.env.VUE_APP_CMS_INNER_BASE_URL}/v4/api/third/pages/${site}`, addJson) |
|||
} |
|||
/** |
|||
* 添加CMS页面 |
|||
* @param {*} initData |
|||
*/ |
|||
const addCMSPage = (initData) => { |
|||
return addCMS({ |
|||
platform: initData.platform || '100100', |
|||
dataSchema: initData.dataSchema, |
|||
data: initData.data, |
|||
name: initData.name, |
|||
outputPath: initData.outputPath, |
|||
category: 'config', |
|||
}) |
|||
} |
|||
/** |
|||
* 导入Data和Dataschame |
|||
*/ |
|||
const importschema = (elmentObj, siteId, pageId, platfrom = '100100') => { |
|||
return request.post(`${process.env.VUE_APP_CMS_INNER_BASE_URL}/v4/api/third/pages/${siteId}/importschema`, { |
|||
dataSchema: elmentObj.dataSchema, |
|||
data: elmentObj.data, |
|||
source: 'cms', |
|||
platform: platfrom, |
|||
pageId, |
|||
}) |
|||
} |
|||
/** |
|||
* 更新基础数据 |
|||
* @param {*} elmentObj |
|||
* @param {*} siteId |
|||
* @param {*} pageId |
|||
*/ |
|||
const updateBaseInfo = (elmentObj, siteId, pageId, platform = '100100') => { |
|||
elmentObj.autoPublish = true |
|||
elmentObj.validityEnd = '2099/12/31 00:00:00' |
|||
return request.put(`${process.env.VUE_APP_CMS_INNER_BASE_URL}/v4/api/third/pages/${siteId}/baseinfo`, { |
|||
page: elmentObj, |
|||
source: 'cms', |
|||
platform, |
|||
pageId, |
|||
}) |
|||
} |
|||
/** |
|||
* 更新CMS |
|||
* @param {*} elmentObj |
|||
* @param {*} sitId |
|||
* @param {*} pageId |
|||
*/ |
|||
const updateCMS = async (elmentObj, sitId, pageId, pageDes, platform = '100100') => { |
|||
// 如果有页面描述,此字段作为记录页面冗余字段携带
|
|||
if (pageDes) { |
|||
elmentObj.data.description.data = [{ value: JSON.stringify(pageDes) }] |
|||
} |
|||
const { code: inportCode } = await importschema(elmentObj, sitId, pageId, platform) |
|||
const { code: baseUpdateCode } = await updateBaseInfo(elmentObj, sitId, pageId, platform) |
|||
const importFlag = inportCode === 0 |
|||
const baseUpdateFlag = baseUpdateCode === 0 |
|||
return importFlag && baseUpdateFlag |
|||
} |
|||
/** |
|||
* 发布页面 |
|||
*/ |
|||
const publishCMS = (siteId, pageId, platform = '100100') => { |
|||
return request.post(`${process.env.VUE_APP_CMS_INNER_BASE_URL}/v4/api/third/pages/${siteId}/publish`, { |
|||
source: 'cms', |
|||
platform, |
|||
pageId, |
|||
}) |
|||
} |
|||
/** |
|||
* 添加模板页面 |
|||
*/ |
|||
const addCMSPage4Tem = async (name = '', outputPath = '') => { |
|||
const dataSchema = [ |
|||
{ |
|||
name: 'config', |
|||
description: 'config', |
|||
tips: '', |
|||
dataType: 'input', |
|||
typeName: '文本', |
|||
meta: null, |
|||
api: null, |
|||
uuid: '74089936-252f-42cf-a640-0abff3c527dd', |
|||
index: '0', |
|||
count: 1, |
|||
path: ['config'], |
|||
key: 'config', |
|||
lock: false, |
|||
fieldsInfo: { |
|||
returnType: 2, |
|||
fieldType: 2, |
|||
fields: [{ type: 'input', name: '', desc: '', defaultValue: '' }], |
|||
}, |
|||
}, |
|||
] |
|||
const data = { |
|||
config: { |
|||
data: [ |
|||
{ |
|||
value: '', |
|||
}, |
|||
], |
|||
dataType: 'input', |
|||
}, |
|||
} |
|||
return addCMSPage({ dataSchema, data, name, outputPath }) |
|||
} |
|||
|
|||
/** |
|||
* 服务端增加模板数据--增加 |
|||
*/ |
|||
const addCMSPage4TemService = (params) => { |
|||
return request.post(`${process.env.VUE_APP_CMS_BASE_URL}/template/templateAdd`, params) |
|||
} |
|||
/** |
|||
* 服务端模板数据--编辑 |
|||
*/ |
|||
const updateCMSPage4TemService = (params) => { |
|||
return request.post(`${process.env.VUE_APP_CMS_BASE_URL}/template/templateEdit`, params) |
|||
} |
|||
|
|||
/** |
|||
* 根据 outputPath 获取pageId |
|||
* @param {*} outputPath |
|||
*/ |
|||
const getPageId = (outputPath, siteId = '100996') => { |
|||
return request.get( |
|||
`${process.env.VUE_APP_CMS_INNER_BASE_URL}/v4/api/third/pages/${siteId}/pageid?outputPath=${outputPath}&source=cms&_platform_num=100100` |
|||
) |
|||
} |
|||
/** |
|||
* 根据siteId,pageId获取CMS |
|||
* @param {*} siteId |
|||
* @param {*} pageId |
|||
*/ |
|||
const getCMS = (siteId, pageId, platfrom = '100100') => { |
|||
return request.get( |
|||
`${process.env.VUE_APP_CMS_INNER_BASE_URL}/v4/api/third/pages/${siteId}?platform=${platfrom}&source=cms&pageId=${pageId}` |
|||
) |
|||
} |
|||
/** |
|||
* 获取站点下页面列表 |
|||
* @param {*} siteId |
|||
*/ |
|||
const getPages = (siteId, platfrom = 100100) => { |
|||
return request.get( |
|||
`${process.env.VUE_APP_CMS_INNER_BASE_URL}/v4/api/third/pages/${siteId}/list?platform=${platfrom}&source=cms` |
|||
) |
|||
} |
|||
// 获取模板数据
|
|||
const getTemsInfo = () => { |
|||
return request.get( |
|||
`${process.env.VUE_APP_MINI_APP_URL}/common/cms/publish/999/lowcode_templates.json?_platform_num=100100`, |
|||
{ |
|||
withCredentials: false, |
|||
} |
|||
) |
|||
} |
|||
const getDynamicTabList = () => { |
|||
return request.get( |
|||
`${process.env.VUE_APP_MINI_API_URL}/common/cms/publish/999/dynamic-tab.json?_platform_num=100100`, |
|||
{ |
|||
withCredentials: false, |
|||
} |
|||
) |
|||
} |
|||
export default { |
|||
addCMSPage, // 添加页面
|
|||
addCMSPage4Tem, // 添加模板页面
|
|||
updateBaseInfo, // 更新基础信息
|
|||
updateCMS, // 更新cms
|
|||
publishCMS, // 发布cms
|
|||
getCMS, // 根据siteId,pageId获取CMS
|
|||
getPageId, // 根据 outputPath 获取pageId
|
|||
getPages, // 获取站点下页面列表
|
|||
addCMSPage4TemService, // 服务端增加模板数据
|
|||
updateCMSPage4TemService, // 服务端模板数据--编辑
|
|||
getTemsInfo, // 获取模板数据
|
|||
getDynamicTabList, // 获取CMS动态Tab栏配置信息
|
|||
} |
|||
@ -0,0 +1 @@ |
|||
export const DEMO_MOCK = `//mockneibu.linkkids.cn/mock/10/api/list` |
|||
@ -0,0 +1,39 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
export function create(id, name, templateName = 'bireport', outputPath = '') { |
|||
if (!outputPath) { |
|||
outputPath = `${templateName}-${id}` |
|||
} |
|||
return request.axios.post(`${process.env.VUE_APP_LOWCODE_URL}/page`, { |
|||
targetType: '4', |
|||
name, |
|||
terminal: 'Web', |
|||
outputPath, |
|||
path: 'none', |
|||
visibility: 0, |
|||
canGrayscale: false, |
|||
templateName, |
|||
}) |
|||
} |
|||
|
|||
export function publish(id) { |
|||
return request.axios.post(`${process.env.VUE_APP_LOWCODE_URL}/page/publish`, { |
|||
id, |
|||
}) |
|||
} |
|||
|
|||
export function fetchDetail(id) { |
|||
return request.axios.post( |
|||
`${process.env.VUE_APP_BI_DOMAIN}/${ |
|||
process.env.VUE_APP_LINKDATA_GATEWAY || 'linkdata-gateway' |
|||
}/route?/api/queryPageConf`, |
|||
{ |
|||
apiCode: '/api/queryPageConf', |
|||
dispatcherSystem: 'lowcode', |
|||
param: { |
|||
lowcode_id: id, |
|||
is_publish: 0, |
|||
}, |
|||
} |
|||
) |
|||
} |
|||
|
After Width: | Height: | Size: 96 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1005 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 917 B |
|
After Width: | Height: | Size: 554 B |
|
After Width: | Height: | Size: 249 B |
|
After Width: | Height: | Size: 411 B |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 1009 B |
|
After Width: | Height: | Size: 543 B |
|
After Width: | Height: | Size: 410 B |
|
After Width: | Height: | Size: 682 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 670 B |
|
After Width: | Height: | Size: 560 B |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 902 B |
|
After Width: | Height: | Size: 475 B |
|
After Width: | Height: | Size: 902 B |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 410 B |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 398 B |
|
After Width: | Height: | Size: 551 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 5.5 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 4.9 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 3.7 KiB |
|
After Width: | Height: | Size: 4.0 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 5.3 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 798 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 5.4 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 1.7 KiB |