"src/page/login/index1.vue" did not exist on "83d441347c400bb1fb1cd03f7cce8ae4bcd55852"
Commit e946ada6 authored by zhangxuanyu's avatar zhangxuanyu

cli4

parent 34eb8efd
Pipeline #52679 failed with stage
...@@ -7,6 +7,21 @@ clone: ...@@ -7,6 +7,21 @@ clone:
dns: 223.5.5.5 dns: 223.5.5.5
pipeline: pipeline:
read-cache:
image: registry.cn-qingdao.aliyuncs.com/wod/devops-cache:1.0
restore: true
mount:
- ./node_modules
volumes:
- /data/cache:/cache
build:
image: registry.cn-qingdao.aliyuncs.com/wod/devops-node:12.18.0-stretch
dns: 223.5.5.5
volumes:
- /data/cache/yarn:/usr/local/share/.cache/yarn
commands:
- yarn install
- yarn run build
docker-master: docker-master:
image: registry.cn-qingdao.aliyuncs.com/wod/devops-docker:1.0 image: registry.cn-qingdao.aliyuncs.com/wod/devops-docker:1.0
volumes: volumes:
...@@ -23,11 +38,11 @@ pipeline: ...@@ -23,11 +38,11 @@ pipeline:
- source: REGISTRY_PASSWORD - source: REGISTRY_PASSWORD
target: REGISTRY_PASSWORD target: REGISTRY_PASSWORD
when: when:
branch: master branch: [master,dev,cli4]
deploy: deploy:
image: registry.cn-qingdao.aliyuncs.com/wod/devops-kubernetes:1.0 image: registry.cn-qingdao.aliyuncs.com/wod/devops-kubernetes:1.0
namespace: tongliao namespace: tongliao
deployment: zj-hl deployment: zj-hl
container: zj-hl container: zj-hl
when: when:
branch: [master,dev] branch: [master,dev,cli4]
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
# cli4
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Lints and fixes files
```
npm run lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
module.exports = {
    presets: [
        '@vue/cli-plugin-babel/preset'
    ]
}
# prefix: /tyyh/login/
index: /zjhl/ index: /zjhl/
# login: /tyyh/login/#/
# logout: /tyyh/logout
\ No newline at end of file
...@@ -10,4 +10,4 @@ ARG TARGETOS ...@@ -10,4 +10,4 @@ ARG TARGETOS
ARG TARGETARCH ARG TARGETARCH
ADD ./dist /www ADD ./dist /www
ADD ./build/conf.yaml /www/conf.yaml ADD ./build/conf.yaml /www/conf.yaml
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
hello 111
</body>
</html>
\ No newline at end of file
This diff is collapsed.
{
"name": "cli4",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"@fortawesome/fontawesome-free": "^5.5.0",
"axios": "^0.19.2",
"core-js": "^3.6.5",
"echarts": "^4.9.0",
"element-ui": "^2.15.3",
"material-design-icons-iconfont": "^4.0.2",
"mavon-editor": "^2.6.17",
"vue": "^2.6.11",
"vue-cookies": "^1.7.4",
"vue-echarts": "^4.0.4",
"vue-i18n": "^8.18.2",
"vue-print-nb": "^1.7.4",
"vue-resource": "^1.5.1",
"vue-router": "^3.0.2",
"vuex": "^3.0.1"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"vue-template-compiler": "^2.6.11"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> 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>
; DO NOT EDIT (unless you know what you are doing)
;
; This subdirectory is a git "subrepo", and this file is maintained by the
; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme
;
[subrepo]
remote = https://github.com/vuetifyjs/templates-common.git
branch = subrepo/webpack-src
commit = 090741fa8ba4da0c6f85db64eff64550704123e1
parent = e05204fc0583a8c99f1963ce873eba1266838215
method = merge
cmdver = 0.4.0
<template>
<div id="app">
app
<router-view></router-view>
</div>
</template>
<script>
import services from "@/services";
export default {
data: () => ({}),
props: {},
mounted() {
console.log(this.$store);
},
components: {
},
methods: {
},
};
</script>
<style>
@import "./assets/css/index.css";
.container {
position: absolute;
width: 100%;
top: 60px;
bottom: 0px;
}
.wrap {
width: 100%;
height: 100%;
}
</style>
This diff is collapsed.
export const lang = {
event: 'event',
}
\ No newline at end of file
export const lang = {
totalelement:"全要素管理",
event: '事件管理',
pendingevent: '待受理事件',
eventdetail: '事件详情',
addevent: '新增事件',
dispatch: '待派遣事件 ',
toclose: '待结案事件 ',
closed: '已结案事件 ',
inquire: '事件查询 ',
myevent: '我的派遣事件 ',
handles: '待处置事件 ',
checkpending: '待审核事件 ',
judge: '研判分析 ',
personControl:"公共管理人员管控",
nonInterviewees:"非访人员预判",
earlywarning:"预警风险列表",
analyze:"专题研判分析",
organization:"组织管理",
nopubic:"非公有制经济组织",
nopubicdetail:"非公有制经济组织",
actualpopulation: "实有人口",
hjlist: "户籍人口",
hjdetail: "户籍详情",
emphasis:"重点人员",
jsbrlist:"精神病人",
jsbrdetail:"精神病人详情",
careobject:"关怀对象",
cjrlist:"残疾人",
cjrdetail:"残疾人详情",
keyunit:"重点单位",
ylcslist:"娱乐场所",
ylcsdetail:"娱乐场所详情",
ggsjyf:"公共管理事件预防",
gpsjyf:"高频事件预防",
highevent:"公共管理事件预防",
actualpopulation:"实有人口研判",
}
\ No newline at end of file
import '@fortawesome/fontawesome-free/css/all.css'
import 'material-design-icons-iconfont/dist/material-design-icons.css'
import Vue from 'vue'
import Vuex from 'vuex';
Vue.use(Vuex);
import store from '@/store';
import VueResource from 'vue-resource';
Vue.use(VueResource);
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);
import App from './App'
import router from './router'
// cookies
import VueCookies from 'vue-cookies'
Vue.use(VueCookies)
import mavonEditor from 'mavon-editor'
Vue.use(mavonEditor)
import 'mavon-editor/dist/css/index.css'
import "@/services/routeblocking";
Vue.config.productionTip = false
import Echarts from "echarts"
Vue.prototype.$chart = Echarts
import ECharts from 'vue-echarts/components/ECharts'
Vue.component('chart', ECharts)
// i18n
import VueI18n from 'vue-i18n'
Vue.use(VueI18n) // 通过插件的形式挂载
const i18n = new VueI18n({
locale: 'zh', // 语言标识 //this.$i18n.locale // 通过切换locale的值来实现语言切换
messages: {
'zh': require('./i18n/language-zh'), //引入language-zh.js language-en,js
'en': require('./i18n/language-en')
}
})
// 超级打印
import Print from 'vue-print-nb'
Vue.use(Print);
Vue.prototype.echartsResize = (ref) =>
{
window.onresize = function ()
{
for (var i = 0; i < ref.length; i++) {
ref[i].resize()
}
}
};
import api from '@/request/api.js'
Vue.prototype.$api = api;
new Vue({
router,
store,
i18n,
render: h => h(App)
}).$mount("#app")
<template>
<div>
index
<el-table
:data="tableData"
style="width: 100%">
<el-table-column
prop="date"
label="日期"
width="180">
</el-table-column>
<el-table-column
prop="name"
label="姓名"
width="180">
</el-table-column>
<el-table-column
prop="address"
label="地址">
</el-table-column>
</el-table>
</div>
</template>
<script>
export default {
data: () => ({
tableData: [{
date: '2016-05-02',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}, {
date: '2016-05-04',
name: '王小虎',
address: '上海市普陀区金沙江路 1517 弄'
}, {
date: '2016-05-01',
name: '王小虎',
address: '上海市普陀区金沙江路 1519 弄'
}, {
date: '2016-05-03',
name: '王小虎',
address: '上海市普陀区金沙江路 1516 弄'
}],
}),
created() {},
methods: {},
};
</script>
<style scoped>
</style>
// 容器服务
import common from '@/request/api/common';
import event from '@/request/api/event';
import system from '@/request/api/system';
import contact from '@/request/api/contact';
import personcontrol from '@/request/api/personcontrol';
import gis from '@/request/api/gis';
export default {
common,
event,
system,
contact,
personcontrol,
gis
}
\ No newline at end of file
import axios from '@/request/http'; // 导入http中创建的axios实例
import services from "@/services";
import qs from 'qs'; // 根据需求是否导入qs模块
const common = {
tablePagination(urlParams) {
return axios.get(`${urlParams.url}`,{
params:urlParams.params
});
},
getNowMenu(params) {
return axios.get(`/apaas/backmgt/menu/user/menu?teamName=${params.teamName}`);
},
deleteFile(params) {
return axios.delete(`/bgfile/bg/delete?url=${params.file_path}`);
},
logout(params) {
return axios.get(`/bgiam/api/logout?ReturnUrl=${params.return_url}`)
},
getNowUser() {
return axios.get(`/bgiam/api/getCurUser`);
},
headersave(data) {
return axios.post(`/sjgl/api/events/setlistview`,data);
},
getheaders(params) {
return axios.get(`/sjgl/api/events/getlistviewsetting?name=${params.name}`);
},
//菜单管理
getMenuList(){
return axios.get(`${services.systemapi}/menu/tree`);
},
//当前用户菜单
getUserMenuList(){
return axios.get(`/system/api/menu/userMenu`);
},
}
export default common;
\ No newline at end of file
import axios from '@/request/http'; // 导入http中创建的axios实例
import services from "@/services";
const contact = {
// 获取列表
contactList (data)
{
//?page=1&limit=5&search=
return axios.get(`/jczl/app/rest/equip/list?page=${data.page}&limit=${data.limit}&search=${data.search ? data.search : ''}`);
},
equipmentInfo (equipmentId)
{
return axios.get(`/jczl/app/rest/equip/object/${equipmentId}`);
},
groupList (data)
{
return axios.get(`/jczl/app/rest/group/groupList?page=${data.page}&limit=${data.limit}&name=${data.search ? data.search : ''}`);
},
addGroup (data)
{
return axios.post(`/jczl/app/rest/group/addGroup`, data);
},
delGroup (id)
{
return axios.get(`/jczl/app/rest/group/delGroup?id=` + id);
}
}
export default contact;
\ No newline at end of file
import axios from '@/request/http'; // 导入http中创建的axios实例
import services from "@/services";
import qs from 'qs'; // 根据需求是否导入qs模块
const event = {
// 新增事件
dialogSubmitjs(data) {
return axios.post(`${services.event}/add`, data);
},
// 事件详情
detailInfo(urlParams, user) {
if (user == 3 || user == 4) {
return axios.get(`/sjgl/api/village/events/detail?event_id=${urlParams.event_id}`);
} else {
return axios.get(`${services.event}/detail?event_id=${urlParams.event_id}`);
}
},
//事件编辑详情提交
editDetailSubmit(data, user) {
if (user == 1) {
return axios.post(`${services.event}/update/event/waitaccept`, data);
} else if (user == 2) {
return axios.post(`${services.event}/update/event/waitdispatch`, data);
} else if (user == 3) {
return axios.post(`/sjgl/api/village/events/update/event/waitaccept`, data);
} else if (user == 4) {
return axios.post(`/sjgl/api/village/events/update/event/waitdispatch`, data);
}
},
//撤销,受理
dialogSubmitRevoke(urlParams, data) {
console.log(urlParams)
if (urlParams.nextstep == '撤销') {
console.log('撤销')
return axios.post(`${services.event}/cancel`, data);
} else if (urlParams.nextstep == '受理' && urlParams.behavior <= 1 && urlParams.type == '转派遣') {
console.log('受理---市')
return axios.post(`${services.event}/accept`, data);
} else if (urlParams.nextstep == '受理' && urlParams.type == '退回') {
console.log('退回')
return axios.post(`/sjgl/api/events/back/village`, data);
} else if (urlParams.nextstep == '受理' && urlParams.type == '转派遣' && (urlParams.behavior == 2 || urlParams.behavior == 3 || urlParams.behavior == 4)) {
console.log('转派遣----乡')
return axios.post(`/sjgl/api/village/events/accept`, data);
} else if (urlParams.nextstep == '受理' && urlParams.type == '申请退回' && urlParams.behavior == 2) {
console.log('申请退回')
return axios.post(`/sjgl/api/village/events/back/accepttocounty`, data);
} else if (urlParams.nextstep == '受理' && urlParams.behavior == 5) {
console.log('同意自办自结')
return axios.post(`/sjgl/api/village/events/selfcase/accept`, data);
} else if (urlParams.nextstep == '拒绝') {
console.log('拒绝')
return axios.post(`/sjgl/api/village/events/refuse`, data);
}
},
//派遣,退回
dialogSubmitDispatch(urlParams, data) {
console.log(data)
console.log(urlParams)
if (urlParams.type == '派遣' && urlParams.user == 2 && urlParams.nextstep == '派遣') {
// console.log('市-派遣')
return axios.post(`${services.event}/dispatch`, data);
} else if (urlParams.nextstep == '退回' && urlParams.user == 2) {
// console.log('市-退回')
return axios.post(`${services.event}/back/accepts`, data);
} else if (urlParams.type == '转乡镇受理' && urlParams.user == 2) {
// console.log('市-转乡镇受理')
return axios.post(`${services.event}/tovillageaccept`, data);
} else if (urlParams.type == '派遣' && urlParams.user == 4 && urlParams.nextstep == '派遣') {
// console.log('乡-派遣')
return axios.post(`/sjgl/api/village/events/dispatch`, data);
} else if (urlParams.nextstep == '派遣' && urlParams.type == '转市级受理' && urlParams.user == 4) {
// console.log('乡-转市级受理')
return axios.post(`/sjgl/api/village/events/dispatchto/county`, data);
} else if (urlParams.nextstep == '退回' && urlParams.user == 4) {
// console.log('乡-退回')
return axios.post(`/sjgl/api/village/events/back/accepts`, data);
}
},
//结案审核
dialogSubmitToclose(urlParams, data) {
if (urlParams.type == '结案' && urlParams.user == 1) {
console.log('市-结案')
return axios.post(`${services.event}/finish`, data);
} else if (urlParams.type == '返工' && urlParams.user == 1) {
console.log('市-返工')
return axios.post(`${services.event}/back/dispatchs`, data);
} else if (urlParams.type == '结案' && urlParams.user == 3) {
console.log('乡-结案')
return axios.post(`/sjgl/api/village/events/finish`, data);
} else if (urlParams.type == '返工' && urlParams.user == 3) {
console.log('乡-返工')
return axios.post(`/sjgl/api/village/events/back/dispatchs`, data);
}
},
//审核
dialogSubmitCheck(urlParams, data) {
if (urlParams.type == '同意') {
return axios.post(`${services.event}/toaudit/pass`, data);
} else {
return axios.post(`${services.event}/toaudit/refuse`, data);
}
},
// 地图拾点
mapGetPoint(keywords) {
return axios.get(`https://restapi.amap.com/v3/place/text?keywords=${keywords}&city=320481&citylimit=true&output=json&offset=20&page=1&key=966cdd04fb6b722679bc24c5d630f04d`);
},
// 选择辖区列表
codeInfo() {
return axios.get(`${services.event}/area/listall`);
},
// 坐标点获取该点网格id
xyToGrid(x, y) {
return axios.get(`${services.gis}/xyToGrid?x=${x}&y=${y}`);
},
// 选择事件类型
eventTypeInfo() {
return axios.get(`/system/api/eventtypes/tree`);
},
// 立案条件-编辑页面
eventTypeInfo_latj(urlParams) {
return axios.get(`/system/api/eventtypes/latj?cate_id=${urlParams.cate_id}`);
},
// 处置时限-编辑页面
eventTypeInfo_czsj(urlParams) {
return axios.get(`/system/api/eventtypes/czsx?latj_id=${urlParams.latj_id}`);
},
// 选择处置人
handleuserInfo() {
return axios.get(`/system/api/department/list?limit=0`);
},
// 选择场所类型
placeTypeInfo() {
return axios.get(`/system/api/eventtypes/tree`);
},
}
export default event;
\ No newline at end of file
import axios from '@/request/http'; // 导入http中创建的axios实例
import services from "@/services";
import qs from 'qs'; // 根据需求是否导入qs模块
const event = {
}
export default event;
\ No newline at end of file
import axios from '@/request/http'; // 导入http中创建的axios实例
import services from "@/services";
import qs from 'qs'; // 根据需求是否导入qs模块
const personcontrol = {
typeInfo() {
return axios.get(`/sjgl/api/ffry/ffType`);
},
operateIgnore(data) {
return axios.post(`/sjgl/api/ffry/ignore/${data.id}`);
},
dialogSubmitjs(data,ids) {
return axios.post(`/sjgl/api/ffry/upEvent/${ids.id}`, data);
},
nondetails(data) {
return axios.get(`/sjgl/api/ffry/detail/${data.id}`);
},
}
export default personcontrol;
\ No newline at end of file
import axios from '@/request/http'; // 导入http中创建的axios实例
import services from "@/services";
import qs from 'qs'; // 根据需求是否导入qs模块
const system = {
//菜单管理
getMenuList(){
return axios.get(`${services.systemapi}/menu/tree`);
},
getMenu(query){
return axios.get(`${services.systemapi}/menu/object/${query.id}`);
},
addMenu(data){
return axios.post(`${services.systemapi}/menu`,data);
},
editMenu(query,data){
return axios.put(`${services.systemapi}/menu/object/${query.id}`,data);
},
delMenu(query){
return axios.delete(`${services.systemapi}/menu/object/${query.id}`);
},
positionMenu(params){
return axios.post(`${services.systemapi}/menu/order`,params);
},
// 事件类型管理
getEventTypeList(payload) {
return axios.get("/system/api/eventtypes/list", payload);
},
deleteEventTypeList(payload) {
return axios.post("/system/api/eventtypes/batchdel", payload);
},
updaterEventTypeList(payload) {
return axios.post("/system/api/eventtypes/update", payload);
},
getEventTypeDetail(payload) {
return axios.get("/system/api/eventtypes/detail", payload);
},
// 选择今日排班,明日排班
planersInfo() {
return axios.get(`/system/api/user/list?limit=0`);
},
}
export default system;
\ No newline at end of file
/**
* axios封装
* 请求拦截、响应拦截、错误统一处理
*/
import axios from 'axios';
import router from '../router';
import store from '../store/index';
function getCookie(name) {
var strCookie = document.cookie;
var arrCookie = strCookie.split("; ");
for (var i = 0; i < arrCookie.length; i++) {
var arr = arrCookie[i].split("=");
if (arr[0] == name) return arr[1];
}
return "";
}
const tip = msg => {
console.log(msg)
}
/**
* 跳转登录页
* 携带当前页面路由,以期在登录页面完成登录后返回当前页面
*/
// const toLogin = () => {
// router.replace({
// path: '/awecloud/login/#/',
// query: {
// redirect: router.currentRoute.fullPath
// }
// });
// }
/**
* 请求失败后的错误统一处理
* @param {Number} status 请求失败的状态码
*/
const errorHandle = (status, other) => {
// 状态码判断
switch (status) {
case 400: tip('请求错误(400)'); break;
// 401: 未登录状态,跳转登录页
case 401:
// toLogin();
break;
// 403 token过期
// 清除token并跳转登录页
case 403:
tip('登录过期,请重新登录');
localStorage.removeItem('token');
store.commit('loginSuccess', null);
setTimeout(() => {
// toLogin();
}, 1000);
break;
case 404: tip('请求的资源不存在'); break;
case 408: tip('请求超时(408)');
case 500: tip('服务器错误(500)');
case 501: tip('服务未实现(501)');
case 502: tip('网络错误(502)');
case 503: tip('服务不可用(503)');
case 504: tip('网络超时(504)');
case 505: tip('HTTP版本不受支持(505)');
default: tip(`连接出错,${other}`);
}
}
// 创建axios实例
var instance = axios.create({ timeout: 1000 * 12 });
// 设置post请求头
instance.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
/**
* 请求拦截器
* 每次请求前,如果存在token则在请求头中携带token
*/
instance.interceptors.request.use(
config => {
// const token = store.state.token;
// var token = 'Basic cm9vdA%3D%3D'
// token && (config.headers.Authorization = token);
// const token = store.state.token;
// var token = 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZXh0IjoibGltaW5nZSIsInR5cGUiOiJ1c2VyIn0.YUPQ-3nttgfRGOUV4T06JZ6osH46nZ0UUolYdEBhvSQ'
// token && (config.headers.Authorization = token);
// if(config.headers.Authorization!="headers"){
// const token = process.env.DRONE_TOKEN ? process.env.DRONE_TOKEN : Conf.token;
// var Authorization = `Bearer ${token}`
// token && (config.headers.Authorization = Authorization);
// }else{
// config.headers.Authorization = '';
// }
return config;
},
error => Promise.error(error))
// 响应拦截器
instance.interceptors.response.use(
// 请求成功
res => res.status === 200|| res.status === 201? Promise.resolve(res) : Promise.reject(res),
// 请求失败
error => {
const { response } = error;
if (response) {
// 请求已发出,但是不在2xx的范围
errorHandle(response.status, response.data.errmessage);
return Promise.reject(response);
}
});
export default instance;
import Vue from 'vue'
import Router from 'vue-router'
// 解决重复点击导航路由报错
const originalPush = Router.prototype.push;
Router.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err);
}
Vue.use(Router)
export default new Router({
// base: "/ldzh/ui",
// mode: "history",
routes: [
{
path: "/",
component: () => import("@/pages/index"),
}
]
})
This diff is collapsed.
let popupDomIndex = 1
class CustomPopup {
constructor(view, wkid, coord, appendDom, dom,offSet=[0,0]) {
this.view = view;
this.wkid = wkid;
this.appendDom = appendDom;
this.dom = dom;
this.coord = coord;
this.offSet = offSet //[x,y]
// this.domIndex = popupDomIndex //多弹窗时候 用于操作对应的弹窗
}
init() {
let _this = this
_this.view.when(function () {
let appendDom = typeof (_this.appendDom) === 'string' ? document.getElementById(_this.appendDom) : _this.appendDom
let fixedDom = document.createElement("div")
fixedDom.id = "cus_popup_id" + popupDomIndex++
fixedDom.className = "cus_popup_cls"
// fixedDom.setAttribute("style","position:absolute;z-index:999")
let isDom = typeof (_this.dom) === 'string' ? true : false
let dom;
if (isDom) {
dom = document.createElement('div')
dom.id = 'popupId' + _this.dom
dom.className = 'popup' + _this.dom
dom.setAttribute("style", "width:200px;height:200px;background:red;")
} else {
dom = _this.dom
}
let mapPoint = {
x: parseFloat(_this.coord[0]),
y: parseFloat(_this.coord[1]),
spatialReference: {
wkid: "4326",
},
};
fixedDom.appendChild(dom)
appendDom.appendChild(fixedDom)
let offSetLen = [dom.offsetWidth,dom.offsetHeight]
let screenPoint = _this.view.toScreen(mapPoint);
_this.locationPopup(fixedDom, screenPoint,offSetLen) //固定位置
_this.view.watch("extent", function () {
_this.upLocation(fixedDom, _this.coord,offSetLen);
});
_this.view.watch("rotation", function () {
_this.upLocation(fixedDom, _this.coord,offSetLen);
});
})
}
show() {
//先隐藏其他的弹窗
//再显示现有的弹窗
}
close() {
//关闭弹窗
let popupParent = document.getElementById("cus_popup_id")
if(popupParent){
popupParent.removeChild(popupParent.childNodes[0])
}
}
locationPopup(dom, screenPoint,offSetLen) {
let theDom = dom;
let screen_x = screenPoint.x - offSetLen[0]/2 - this.offSet[0]
let screen_y = screenPoint.y - offSetLen[1] - this.offSet[1]
console.log(screen_x)
theDom.setAttribute(
"style",
`position:absolute;z-index:999;transform:translate3d(${screen_x}px,${screen_y}px,0)`
);
}
upLocation(dom, point,offSetLen) {
// let theDom = dom;
let mapPoint = {
x: parseFloat(point[0]),
y: parseFloat(point[1]),
spatialReference: {
wkid: 4326
}
};
let screenPoint = this.view.toScreen(mapPoint);
let screen_x = screenPoint.x - offSetLen[0]/2 - this.offSet[0]
let screen_y = screenPoint.y - offSetLen[1] - this.offSet[1]
dom.setAttribute(
"style",
`position:absolute;z-index:999;transform:translate3d(${screen_x}px,${screen_y}px,0)`
);
}
}
export { CustomPopup }
// 导出页面为PDF格式
import html2Canvas from "html2canvas";
import JsPDF from "jspdf";
export default {
install(Vue, options) {
Vue.prototype.getPdf = function(id, title,imgw,top) {
return new Promise((resolve, reject) => {
let get1id = id.replace('#','')
debugger
html2Canvas(document.querySelector(id), {
allowTaint: true,
backgroundColor: 'white',
useCORS: true, //支持图片跨域
scale: 1, //设置放大的倍数
height: document.getElementById(get1id).scrollHeight+200,
windowHeight: document.getElementById(get1id).scrollHeight+200
}).then(function(canvas) {
debugger
let contentWidth = canvas.width;
let contentHeight = canvas.height;
let pageHeight = (contentWidth / 592.28) * 841.89;
let leftHeight = contentHeight;
let position = top;
const imgWidth = imgw;
let imgHeight = (imgw / contentWidth) * contentHeight;
let pageData = canvas.toDataURL("image/jpeg", 1.0);
// let PDF = new JsPDF("", "pt");
let PDF = new JsPDF("", "pt", "a4");
// PDF.addImage(pageData, "JPEG", 0, 0, contentWidth, contentHeight);
if (leftHeight < pageHeight) {
PDF.addImage(pageData, "JPEG", 65, 10, imgWidth, imgHeight);
} else {
while (leftHeight > 0) {
PDF.addImage(pageData, "JPEG", 65, position, imgWidth, imgHeight);
leftHeight -= pageHeight;
position -= 841.89;
if (leftHeight > 0) {
PDF.addPage();
}
}
}
PDF.save(title + ".pdf");
resolve(11);
});
});
};
}
};
module.exports.timestamp = function (timestamp) {
// 获取当前时间戳(毫秒)(new Date()).getTime()
// 毫秒->秒 /1000
let date = Math.floor(new Date().getTime() / 1000);
let time = date - timestamp;
if (time == 0) {
return 0;
} else if (time < 60) {
return time + "";
} else if (time / 60 < 60) {
return Math.round(time / 60) + "分钟前";
} else if (time / 60 / 60 < 24) {
return Math.round(time / 60 / 60) + "小时前";
} else if (time / 60 / 60 / 24 < 24) {
return Math.round(time / 60 / 60 / 24) + "天前";
} else if (time / 60 / 60 / 24 / 7 < 7) {
return Math.round(time / 60 / 60 / 24) + "周前";
}
}
module.exports.enqueuedtimes = function (finishedtime, starttime) {
let time = finishedtime - starttime;
if (time < 60 && time > 0) {
return time + "";
} else if (time / 60 < 60 && time > 0) {
return parseInt(time / 60) + "分钟" + (time % 60) + "";
} else if (time < 0) {
return "--";
}
}
module.exports.yuntimes = function (finishedtime, starttime) {
if (!finishedtime || !starttime) {
return "00:00"
}
let time = finishedtime - starttime;
var str = ""
if (time < 60 && time > 0) {
str += "00:"
if (time < 10) { str += "0" + time } else { str += time }
} else {
var minute = parseInt(time / 60)
var seconds = time % 60
console.log("m==>", minute, "| s==>", seconds)
if (minute < 10) {
str += "0" + minute
} else {
str += minute
}
str += ":"
if (seconds < 10) { str += "0" + seconds } else { str += seconds }
}
return str
}
module.exports.dateFormat = function (fmt, timestamp) {
let date = new Date(timestamp);
let ret;
const opt = {
"Y+": date.getFullYear().toString(), // 年
"m+": (date.getMonth() + 1).toString(), // 月
"d+": date.getDate().toString(), // 日
"H+": date.getHours().toString(), // 时
"M+": date.getMinutes().toString(), // 分
"S+": date.getSeconds().toString() // 秒
// 有其他格式化字符需求可以继续添加,必须转化成字符串
};
for (let k in opt) {
ret = new RegExp("(" + k + ")").exec(fmt);
if (ret) {
fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0")))
};
};
return fmt;
}
module.exports.GetProperty = function (obj, prop) {
if (!obj) return null;
let res = obj;
if (prop) {
let props = prop.split('.');
for (let i = 0; i < props.length; i++) {
res = res[props[i]];
if (typeof res == "undefined" || res == null) {
return null;
}
}
}
return res;
}
module.exports.GetTimeDifference = function (stop_date) {
let nowdate = new Date();
let stoopdate = new Date(stop_date);
return nowdate > stoopdate;
}
module.exports.dateStringTransform = function (date) {
/*
input: 2020-06-12T16:38:11+08:00
output: 2020-06-12 16:38:11
*/
if (String(date).indexOf("T") != -1) {
let arr = date.split("T");
let t = arr[1];
let tarr = t.split('.000');
let marr = tarr[0].split(':');
let h = parseInt(marr[0]) >= 10 ? parseInt(marr[0]) : "0" + parseInt(marr[0]);
let m = parseInt(marr[1]) >= 10 ? parseInt(marr[1]) : "0" + parseInt(marr[1]);
let s = parseInt(marr[2]) >= 10 ? parseInt(marr[2]) : "0" + parseInt(marr[2]);
let dd = arr[0] + " " + h + ":" + m + ":" + s;
return dd;
} else {
return date;
}
}
//时间戳转时间格式
module.exports.formatDateTime_date = function (date) {
var y = date.getFullYear();
var m = date.getMonth() + 1;
m = m < 10 ? ('0' + m) : m;
var d = date.getDate();
d = d < 10 ? ('0' + d) : d;
return y + '-' + m + '-' + d;
}
\ No newline at end of file
module.exports = {
"event": "/sjgl/api/events",
"gis": "/sjgl/api/gis",
"systemapi": "/system/api",
};
\ No newline at end of file
/**
* wgs84 地心坐标系 GPS原始知坐标体系。在中国,任何一个地图产品都不允许使用GPS坐标,据说是为了保密。GoogleEarth及GPS芯片使用
* bd09 百度
* gcj02 火星坐标系 高德、腾讯、Google中国地图使用
*/
let locationUtils = {};
var PI = 3.14159265358979324
var x_pi = PI * 3000.0 / 180.0;
function transformLat (x, y) {
var ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + 0.2 * Math.sqrt(Math.abs(x))
ret += (20.0 * Math.sin(6.0 * x * PI) + 20.0 * Math.sin(2.0 * x * PI)) * 2.0 / 3.0
ret += (20.0 * Math.sin(y * PI) + 40.0 * Math.sin(y / 3.0 * PI)) * 2.0 / 3.0
ret += (160.0 * Math.sin(y / 12.0 * PI) + 320 * Math.sin(y * PI / 30.0)) * 2.0 / 3.0
return ret
}
function transformLon (x, y) {
var ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * Math.sqrt(Math.abs(x))
ret += (20.0 * Math.sin(6.0 * x * PI) + 20.0 * Math.sin(2.0 * x * PI)) * 2.0 / 3.0
ret += (20.0 * Math.sin(x * PI) + 40.0 * Math.sin(x / 3.0 * PI)) * 2.0 / 3.0
ret += (150.0 * Math.sin(x / 12.0 * PI) + 300.0 * Math.sin(x / 30.0 * PI)) * 2.0 / 3.0
return ret
}
function locationDelta (lon, lat) {
var a = 6378245.0; // a: 卫星椭球坐标投影到平面地图坐标系的投影因子。
var ee = 0.00669342162296594323; // ee: 椭球的偏心率。
var dLat = transformLat(lon - 105.0, lat - 35.0)
var dLon = transformLon(lon - 105.0, lat - 35.0)
var radLat = lat / 180.0 * PI
var magic = Math.sin(radLat)
magic = 1 - ee * magic * magic
var sqrtMagic = Math.sqrt(magic)
dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * PI)
dLon = (dLon * 180.0) / (a / sqrtMagic * Math.cos(radLat) * PI)
return [dLon, dLat]
}
locationUtils.gcj02Towgs84 = function (lng, lat) {
var a = 6378245.0; // a: 卫星椭球坐标投影到平面地图坐标系的投影因子。
var ee = 0.00669342162296594323; // ee: 椭球的偏心率。
var lat = +lat;
var lng = +lng;
var dlat = transformLat(lng - 105.0, lat - 35.0);
var dlng = transformLon(lng - 105.0, lat - 35.0);
var radlat = lat / 180.0 * PI;
var magic = Math.sin(radlat);
magic = 1 - ee * magic * magic;
var sqrtmagic = Math.sqrt(magic);
dlat = (dlat * 180.0) / ((a * (1 - ee)) / (magic * sqrtmagic) * PI);
dlng = (dlng * 180.0) / (a / sqrtmagic * Math.cos(radlat) * PI);
var mglat = lat + dlat;
var mglng = lng + dlng;
return [lng * 2 - mglng, lat * 2 - mglat]
}
locationUtils.gcj02Tobd09 = function (lon, lat) {
var x = lon
var y = lat
var z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * x_pi)
var theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * x_pi)
var bdLon = z * Math.cos(theta) + 0.0065
var bdLat = z * Math.sin(theta) + 0.006
return [bdLon, bdLat]
}
locationUtils.bd09Towgs84 = function (lng, lat) {
let bd09ToGcj02Location = locationUtils.bd09Togcj02(lng, lat)
let gcj02towgs84Location = locationUtils.gcj02Towgs84(bd09ToGcj02Location[0], bd09ToGcj02Location[1])
return gcj02towgs84Location
}
locationUtils.bd09Togcj02 = function(bdLon, bdLat) {
var x = bdLon - 0.0065
var y = bdLat - 0.006
var z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * x_pi);
var theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * x_pi);
var gcjLon = z * Math.cos(theta);
var gcjLat = z * Math.sin(theta)
return [gcjLon, gcjLat]
}
locationUtils.wgs84Togcj02 = function (lon, lat) {
var lat = +lat;
var lon = +lon;
var d = locationDelta(lon, lat);
return [lon + d[0], lat + d[1]]
}
locationUtils.wgs84Tobd09 = function (lon, lat) {
var lat = +lat;
var lon = +lon;
let gcj02 = locationUtils.wgs84Togcj02(lon, lat)
return locationUtils.gcj02Tobd09(gcj02[0], gcj02[1])
}
export default locationUtils;
\ No newline at end of file
import esriLoader from "esri-loader";
esriLoader.loadScript({
url: window.location.origin + "/api_4.16/init.js"
// url: "https://js.arcgis.com/4.12/"
});
esriLoader.loadCss( window.location.origin + "/api_4.16/esri/css/main.css");
// window.dojoConfig = {
// // tell Dojo where to load other packages
// async: true,
// tlmSiblingOfDojo: false,
// packages: [
// {
// location: "/sjgl/ui/static/js/fcl",
// name: 'fcl'
// }
// ],
// has: {
// "esri-promise-compatibility": 1 // enable native promises and remove the warning about using when() instead of then(). https://developers.arcgis.com/javascript/latest/guide/release-notes/index.html#improved-compatibility-with-javascript-promises
// }
// };
export default esriLoader;
\ No newline at end of file
// 取得cookie
function getCookie(name) {
var nameEQ = name + '='
var ca = document.cookie.split(';') // 把cookie分割成组
for (var i = 0; i < ca.length; i++) {
var c = ca[i] // 取得字符串
while (c.charAt(0) == ' ') { // 判断一下字符串有没有前导空格
c = c.substring(1, c.length) // 有的话,从第二位开始取
}
if (c.indexOf(nameEQ) == 0) { // 如果含有我们要的name
return unescape(c.substring(nameEQ.length, c.length)) // 解码并截取我们要值
}
}
return false
}
// 清除cookie
function clearCookie(name) {
setCookie(name, "", -1);
}
// 设置cookie
function setCookie(name, value, seconds) {
seconds = seconds || 0; //seconds有值就直接赋值,没有为0,这个根php不一样。
var expires = "";
if (seconds != 0 ) { //设置cookie生存时间
var date = new Date();
date.setTime(date.getTime()+(seconds*1000));
expires = "; expires="+date.toGMTString();
}
document.cookie = name+"="+escape(value)+expires+"; path=/"; //转码并赋值
}
export {
getCookie,
clearCookie,
setCookie,
}
/**
* @fileOverview 天地图WMTS服务API
* @version 1.0
*/
import { getWidth, getTopLeft } from 'ol/extent';
import WMTS from 'ol/tilegrid/WMTS';
import { WMTS as WMTSSource } from 'ol/source';
import TileLayer from 'ol/layer/Tile';
import { get as getProjection, getTransform } from 'ol/proj';
import { applyTransform } from 'ol/extent';
/**
* @description 获得一个OpenLayers框架下的ol/layer/Tile类型天地图图层
* @param {options} Object 初始化参数
* @param {options.type} String 与官方名称相同的图层类型
* @param {options.proj} String 与官方名称相同的投影类型
* @param {options.key} String 开发者秘钥
*/
export function getTianditu(options) {
let layers = {
'全球境界': 'ibo',
'地形注记': 'cta',
'地形晕渲': 'ter',
'影像注记': 'cia',
'影像底图': 'img',
'矢量注记': 'cva',
'矢量底图': 'vec'
}
let projs = {
'经纬度投影': 'EPSG:4490',
'球面墨卡托投影': 'EPSG:900913'
}
let matrixSets = {
'经纬度投影': 'c',
'球面墨卡托投影': 'w'
}
let projection = getProjection(projs[options.proj]);
let projectionExtent = projection.getExtent();
let origin = projectionExtent ? getTopLeft(projectionExtent) : [-180, 90];
let fromLonLat = getTransform('EPSG:4326', projection);
let width = projectionExtent ? getWidth(projectionExtent) : getWidth(applyTransform([-180.0, -90.0, 180.0, 90.0], fromLonLat));
let resolutions = [];
let matrixIds = [];
for (let z = 1; z < 19; z++) {
resolutions[z] = width / (256 * Math.pow(2, z));
matrixIds[z] = z;
};
let wmtsTileGrid = new WMTS({
origin: origin,
resolutions: resolutions,
matrixIds: matrixIds
});
let wmtsSource = new WMTSSource({
url: "http://t0.tianditu.gov.cn/" + layers[options.type] + "_" + matrixSets[options.proj] + "/wmts?tk=" + options.key,
layer: layers[options.type],
version: '1.0.0',
matrixSet: matrixSets[options.proj],
format: 'tiles',
projection: projection,
requestEncoding: 'KVP',
style: 'default',
tileGrid: wmtsTileGrid
});
let wmtsLayer = new TileLayer({
source: wmtsSource
});
return wmtsLayer
}
\ No newline at end of file
import Vuex from "vuex";
import Vue from "vue";
Vue.use(Vuex);
const store = new Vuex.Store({
state: {
name: "",
userInfo: {},
mapPoint: {},
direct_path:'',
userType:"",
},
mutations: {
change(state, name) {
state.name = name;
},
changeUserInfo(state, value) {
state.userInfo = value;
state.userType = value.user_type;
},
getMapPoint(state, value) {
state.mapPoint = value;
},
change_direct_path(state,path){
state.direct_path = path;
}
}
});
export default store;
module.exports = {
devServer: {
open: true,
proxy:{
'/shzl/api': {
target: 'https://sjgl.wodcloud.com/shzl/api', // 接口域名
changeOrigin: true, // 是否跨域
rewrite: (path) => path.replace('/shzl/api', ''),
},
}
},
transpileDependencies: ['vue-echarts','resize-detector', 'crypto-js'],
publicPath: "./",
outputDir: "dist/zjhl",
assetsDir:"static"
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment