Merge branch 'master' of http://139.196.74.78:10010/r/jagzwxm/ja_web
| | |
| | | <template> |
| | | <router-view /> |
| | | <router-view /> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { loginWithMiniProgramApi } from '@/api/zkxt' |
| | | import { useStore } from 'vuex' |
| | | |
| | | const store = useStore() |
| | | |
| | | function getToken() { |
| | | loginWithMiniProgramApi({username: 'admin'}).then(res => { |
| | | console.log(res) |
| | | function getXTToken() { |
| | | loginWithMiniProgramApi({ username: 'admin' }).then(res => { |
| | | store.commit('setXtToken', res.data.data.access_token) |
| | | }) |
| | | } |
| | | getToken() |
| | | setInterval(() => { |
| | | getToken() |
| | | }, 600000) |
| | | getXTToken() |
| | | setInterval(getXTToken, 600000) |
| | | </script> |
| | | |
| | | <style> |
| | | html, |
| | | body, |
| | | #app { |
| | | width: 100%; |
| | | height: 100%; |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | </style> |
| | |
| | | import request from '@/axiosXT' |
| | | |
| | | // 免密登陆 |
| | | export const loginWithMiniProgramApi = (data) => { |
| | | return request({ |
| | | url: `/auth/loginWithMiniProgram`, |
| | | method: 'post', |
| | | data, |
| | | authorization: false, |
| | | }) |
| | | } |
| | | |
| | | // 字典 |
| | | export const dictListApi = (data) => { |
| | | return request({ |
| | | url: `/system/dict/type/list`, |
| | | method: 'post', |
| | | data:{"size":100,"current":1}, |
| | | }) |
| | | } |
| | |
| | | import axios from 'axios' |
| | | import store from '@/store/' |
| | | import { serialize } from '@/utils/util' |
| | | import { getToken, removeToken, removeRefreshToken } from '@/utils/auth' |
| | | import { isURL, validatenull } from '@/utils/validate' |
| | | import { ElMessage } from 'element-plus' |
| | | import website from '@/config/website' |
| | | import { Base64 } from 'js-base64' |
| | | import { baseUrl } from '@/config/env' |
| | | import crypto from '@/utils/crypto' |
| | | // 全局未授权错误提示状态,只提示一次 |
| | | const { VITE_APP_API_XT } = import.meta.env |
| | | |
| | | // 创建作用域的 axios 实例 |
| | | const serviceXT = axios.create({ |
| | | // 超时时间设置为10分钟,部分接口上传比较慢,如固件上传 |
| | | timeout: 600000, |
| | | baseURL: VITE_APP_API_XT, |
| | | //返回其他状态码 |
| | | validateStatus: function (status) { |
| | | return status >= 200 && status <= 500 // 默认的 |
| | | }, |
| | | //跨域请求,允许保存cookie |
| | | withCredentials: true, |
| | | withCredentials: false, |
| | | }) |
| | | |
| | | //http request拦截 |
| | | serviceXT.interceptors.request.use( |
| | | config => { |
| | | //headers判断是否需要 |
| | | const authorization = config.authorization === false |
| | | if (!authorization) { |
| | | config.headers['Authorization'] = `Basic ${Base64.encode(`${website.clientId}:${website.clientSecret}`)}` |
| | | const xtToken = store.state.user.xtToken |
| | | if (xtToken && !authorization) { |
| | | config.headers['Authorization'] = xtToken |
| | | } |
| | | const meta = config.meta || {} |
| | | |
| | |
| | | //http response拦截 |
| | | serviceXT.interceptors.response.use( |
| | | res => { |
| | | const status = res.data.error_code || res.data.code || res.status |
| | | const statusWhiteList = website.statusWhiteList || [] |
| | | const status = res?.data?.code || res?.data?.error_code || res?.status |
| | | const message = res?.data?.msg || res?.data?.message || '系统错误' |
| | | //如果在白名单里则自行catch逻辑处理 |
| | | if (statusWhiteList.includes(status)) return Promise.reject(res) |
| | | // 如果请求为非200默认统一处理 |
| | | if (status !== 200 && status !== 0) { |
| | | ElMessage({ |
| | | message: message, |
| | | type: 'error', |
| | | }) |
| | | ElMessage({ message: message, type: 'error', }) |
| | | return Promise.reject(new Error(message)) |
| | | } |
| | | return res |
| | |
| | | menu: true, |
| | | }, |
| | | fistPage: { |
| | | name: '测试页', |
| | | path: '/test', |
| | | path: '/', |
| | | }, |
| | | //配置菜单的属性 |
| | | menu: { |
| | |
| | | |
| | | let toMenu = findRouteByPath(newMenu, to.path) |
| | | |
| | | store.commit('ADD_TAG', { |
| | | name: firstMenu.name, |
| | | path: firstMenu.path, |
| | | fullPath: firstMenu.path, |
| | | params: firstMenu.params || {}, |
| | | query: firstMenu.query || {}, |
| | | meta: firstMenu.meta || {}, |
| | | }) |
| | | // store.commit('ADD_TAG', { |
| | | // name: firstMenu.name, |
| | | // path: firstMenu.path, |
| | | // fullPath: firstMenu.path, |
| | | // params: firstMenu.params || {}, |
| | | // query: firstMenu.query || {}, |
| | | // meta: firstMenu.meta || {}, |
| | | // }) |
| | | store.commit('ADD_TAG', { |
| | | name: toMenu.name, |
| | | path: toMenu.path, |
| | |
| | | export default [ |
| | | { |
| | | path: '/', |
| | | redirect: '/test/index', |
| | | redirect: '/orderView/orderManage/orderManage/index', |
| | | }, |
| | | { |
| | | path: '/wel', |
| | |
| | | setStore({ name: 'tag', content: state.tag }) |
| | | if (state.bsTagList.some(ele => ele.fullPath == action.fullPath)) return |
| | | state.bsTagList.push(action) |
| | | console.log(state.bsTagList,'99') |
| | | setStore({ name: 'bsTagList', content: state.bsTagList }) |
| | | }, |
| | | DEL_TAG: (state, action) => { |
| | |
| | | token: getStore({ name: 'token' }) || '', |
| | | refreshToken: getStore({ name: 'refreshToken' }) || '', |
| | | parentDeptInfo: getStore({ name: 'parentDeptInfo' }) || '', |
| | | xtToken: getStore({ name: 'xtToken' }) || '', |
| | | }, |
| | | actions: { |
| | | //根据用户名登录 |
| | |
| | | }, |
| | | }, |
| | | mutations: { |
| | | setXtToken:(state,token) =>{ |
| | | state.xtToken = token |
| | | setStore({ name: 'xtToken', content: token }) |
| | | }, |
| | | SET_PARENT_DEPT_INFO(state, deptId) { |
| | | getParentDeptInfo({ deptId: deptId }).then(res => { |
| | | const data = res.data.data |
| | |
| | | background: #5B6BFF; |
| | | |
| | | .is-icon-close { |
| | | margin: 0 10px; |
| | | //margin: 0 10px; |
| | | } |
| | | } |
| | | |
| | |
| | | padding: 1px 0 0 15px; |
| | | box-sizing: border-box; |
| | | } |
| | | } |
| | | } |
| | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="executeTime" show-overflow-tooltip label="任务执行时间" /> |
| | | <el-table-column prop="feishou" show-overflow-tooltip label="选择飞手" /> |
| | | <el-table-column prop="deviceId" show-overflow-tooltip label="选择设备" /> |
| | | <el-table-column label="操作" class-name="operation-btns"> |
| | | <template v-slot="{ row }"> |
| | | <el-link type="primary" @click="">查看</el-link> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="recommendFlyerName" show-overflow-tooltip label="选择飞手" /> |
| | | <el-table-column prop="deviceName" show-overflow-tooltip label="选择设备" /> |
| | | </el-table> |
| | | </template> |
| | | </div> |
| | |
| | | <el-table-column prop="devicePayload" label="设备负载" /> |
| | | </el-table> |
| | | </template> |
| | | <div v-else>请先选择设备需求并绘制范围</div> |
| | | <div v-else>请先选择设备需求并在地图上绘制工单范围</div> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | </el-button> |
| | | <el-button v-if="gdStatus === '10'" @click="addDescription">拒绝接单</el-button> |
| | | <el-button v-if="gdStatus === '10'" @click="statusChange(1)">接单</el-button> |
| | | <el-button v-if="gdStatus === '22'" @click="statusChange(7)">同意修改</el-button> |
| | | <el-button v-if="gdStatus === '22'" @click="statusChange(8)">不同意修改</el-button> |
| | | <el-button v-if="gdStatus === '21'" @click="statusChange(5)">同意取消</el-button> |
| | | <el-button v-if="gdStatus === '22'" @click="statusChange(7)">同意修改</el-button> |
| | | <el-button v-if="gdStatus === '21'" @click="addDescription">不同意取消</el-button> |
| | | <el-button v-if="gdStatus === '21'" @click="statusChange(5)">同意取消</el-button> |
| | | <el-button v-if="gdStatus === '30'" @click="addDescription">协商修改</el-button> |
| | | <el-button v-if="gdStatus === '31'" @click="statusChange(10)">同意</el-button> |
| | | </template> |
| | |
| | | hasPatrolTaskList.value && gdPatrolTaskPage() |
| | | dialogMode.value === 'edit' ? editPolygon() : viewPolygon() |
| | | } |
| | | await getDeviceList() |
| | | // setMapDevice() |
| | | await nextTick() |
| | | syncSelection() |
| | |
| | | |
| | | .processBox { |
| | | width: 312px; |
| | | .el-timeline{ |
| | | .el-timeline { |
| | | padding-left: 100px; |
| | | } |
| | | .item-content{ |
| | | .item-content { |
| | | position: relative; |
| | | .flowName{ |
| | | .flowName { |
| | | position: absolute; |
| | | left: -100px; |
| | | top: 0; |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | <el-option |
| | | v-for="item in dictObj.workOrderStatus" |
| | | :key="item.dictKey" |
| | | :label="item.dictValue" |
| | | :label="item.dictValue.split('_')[1]" |
| | | :value="item.dictKey" |
| | | /> |
| | | </el-select> |
| | |
| | | logo: 'S', |
| | | key: 'saber', //配置主键,目前用于存储 |
| | | indexTitle: 'BladeX 微服务平台', |
| | | clientId: 'drone', // 客户端id |
| | | clientSecret: 'drone_secret', // 客户端密钥 |
| | | clientId: 'saber', // 客户端id |
| | | clientSecret: 'saber_secret', // 客户端密钥 |
| | | tenantMode: false, // 是否开启租户模式 |
| | | tenantId: '000000', // 管理组租户编号 |
| | | captchaMode: false, // 是否开启验证码模式 |
| | |
| | | </div> |
| | | |
| | | <button class="login-btn" :style="[inputStyle]" @tap="submit">登录</button> |
| | | <!-- <view class="agreement"> |
| | | <label> |
| | | <checkbox :checked="agreed" @click="agreed = !agreed" /> |
| | | 同意《用户协议》与《隐私政策》 |
| | | </label> |
| | | </view> --> |
| | | </view> |
| | | </template> |
| | | |
| | |
| | | }); |
| | | } |
| | | const loginFormGd = ref({ |
| | | username: "zhx", |
| | | password: "123456", |
| | | username: "admin", |
| | | password: "admin", |
| | | }); |
| | | async function submit() { |
| | | // 调用工单登录接口 |
| | | await gdLogin(); |
| | | |
| | | if (!loginForm.value.username.trim()) { |
| | | uni.showToast({ |
| | | title: "请输入用户名", |
| | |
| | | console.error('处理位置服务失败:', error); |
| | | } |
| | | |
| | | |
| | | // 调用工单登录接口 |
| | | await gdLogin() |
| | | |
| | | uni.reLaunch({ |
| | | url: "/pages/work/index", |
| | |
| | | // 从本地存储加载记住的密码 |
| | | onMounted(() => { |
| | | const savedUserInfo = uni.getStorageSync("rememberedUser"); |
| | | console.log("记住密码", savedUserInfo); |
| | | if (savedUserInfo) { |
| | | loginForm.value.username = savedUserInfo.username; |
| | | loginForm.value.password = savedUserInfo.password; |
| | |
| | | background: #1d6fe9; |
| | | color: white; |
| | | width: 670rpx; |
| | | height: 100rpx; |
| | | height: 76rpx; |
| | | border-radius: 8rpx 8rpx 8rpx 8rpx; |
| | | margin-top: 184rpx; |
| | | font-size: 36rpx; |
| | | font-size: 28rpx; |
| | | font-weight: 400; |
| | | font-family: Source Han Sans CN, Source Han Sans CN; |
| | | &::after { |
| | |
| | | .link { |
| | | color: $u-warning; |
| | | } |
| | | } |
| | | .agreement { |
| | | position: absolute; |
| | | bottom: 40rpx; |
| | | left: 0; |
| | | right: 0; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | text-align: center; |
| | | } |
| | | .forgotPassword { |
| | | font-family: PingFang SC, PingFang SC; |
| | |
| | | } |
| | | |
| | | .searchBar { |
| | | padding: 20rpx; |
| | | padding: 20rpx 20rpx 0 20rpx; |
| | | display: flex; |
| | | align-items: center; |
| | | height: 108rpx; |
| | |
| | | } |
| | | |
| | | .contactList { |
| | | margin: 0 24rpx; |
| | | margin: 0 20rpx 20rpx 20rpx; |
| | | background: #fff; |
| | | border-radius: 12rpx; |
| | | overflow-y: auto; |
| | |
| | | .contactItem { |
| | | display: flex; |
| | | align-items: center; |
| | | padding: 0 24rpx; |
| | | padding: 0 20rpx; |
| | | |
| | | } |
| | | |
| | |
| | | <!-- 自定义导航栏 --> |
| | | <u-navbar title="工单详情" :is-back="true" back-text="" :back-icon-size="40" @left-click="onBackClick"> |
| | | <template #right> |
| | | <div class="share-btn" @click="onShareClick"><img src="@/static/images/work/share.svg" alt=""></div> |
| | | <div class="share-btn" @click="onShareClick"></div> |
| | | </template> |
| | | </u-navbar> |
| | | <div class="detailTop"> |
| | |
| | | padding-top: 88rpx; |
| | | // 分享按钮样式 |
| | | .share-btn { |
| | | img { |
| | | width: 40rpx; |
| | | height: 40rpx; |
| | | } |
| | | width: 40rpx; |
| | | height: 40rpx; |
| | | background-image: url('/static/images/work/share.svg'); |
| | | background-size: contain; |
| | | background-repeat: no-repeat; |
| | | background-position: center; |
| | | } |
| | | .detailTop { |
| | | .image-container { |
| | |
| | | httpGd.interceptors.request.use((config) => { |
| | | const {detail} = useUserStore().$state?.userInfo || {} |
| | | // 假设有token值需要在头部需要携带 |
| | | // let accessToken = useUserStore()?.$state?.userInfo?.gd_access_token; |
| | | let accessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnRfaWQiOiIwMDAwMDAiLCJ1c2VyX25hbWUiOiJhZG1pbiIsInJlYWxfbmFtZSI6IueuoeeQhuWRmCIsImF2YXRhciI6Imh0dHBzOi8vZ3cuYWxpcGF5b2JqZWN0cy5jb20vem9zL3Jtc3BvcnRhbC9CaWF6ZmFueG1hbU5Sb3h4VnhrYS5wbmciLCJhdXRob3JpdGllcyI6WyJhZG1pbmlzdHJhdG9yIl0sImNsaWVudF9pZCI6InNhYmVyIiwicm9sZV9uYW1lIjoiYWRtaW5pc3RyYXRvciIsImxpY2Vuc2UiOiJwb3dlcmVkIGJ5IGJsYWRleCIsInBvc3RfaWQiOiIxMTIzNTk4ODE3NzM4Njc1MjAxIiwidXNlcl9pZCI6IjExMjM1OTg4MjE3Mzg2NzUyMDEiLCJyb2xlX2lkIjoiMTEyMzU5ODgxNjczODY3NTIwMSIsInNjb3BlIjpbImFsbCJdLCJuaWNrX25hbWUiOiLnrqHnkIblkZgiLCJvYXV0aF9pZCI6IiIsImRldGFpbCI6eyJhcmVhQ29kZSI6bnVsbCwiYXJlYU5hbWUiOiLmsZ_opb_nnIEiLCJhY3RpdmVMb2Fuc0FyZWFDb2RlIjpbXX0sImV4cCI6MTc2OTEzNjM3OSwiZGVwdF9pZCI6IjExMjM1OTg4MTM3Mzg2NzUyMDEiLCJqdGkiOiI4MmIxOTdlYi0zY2NhLTQ0YmEtYjQ1OS0zODE5ZWIzZjUxN2IiLCJhY2NvdW50IjoiYWRtaW4ifQ.Mf--eQ96cYH1GhsySwoceM1c3dF-F7qt5RmQZ3MzYWY' |
| | | let accessToken = useUserStore()?.$state?.userInfo?.gd_access_token; |
| | | if (accessToken) { |
| | | config.header['Blade-Auth'] = 'bearer ' + accessToken; |
| | | } |
| | |
| | | // 安全请求header |
| | | config.header['Blade-Requested-With'] = 'BladeHttpRequest'; |
| | | // 客户端认证参数 |
| | | // config.header['Authorization'] = 'Basic ' + Base64.encode(website.clientId + ':' + website.clientSecret); |
| | | config.header['Authorization'] = 'Basic ' + 'c2FiZXI6c2FiZXJfc2VjcmV0'; |
| | | config.header['Authorization'] = 'Basic ' + Base64.encode(website.clientId + ':' + website.clientSecret); |
| | | return config |
| | | }, config => { // 可使用async await 做异步操作 |
| | | return Promise.reject(config) |