commit
This commit is contained in:
@@ -17,7 +17,7 @@ const commonUtil = {
|
||||
if (response.config.responseType === "blob") {
|
||||
return response
|
||||
}
|
||||
if (response.data && response.data.code !== 0 && response.data.code !== 99) {
|
||||
if (response.data && response.data.code !== "200" && response.data.code !== 0 && response.data.code !== 99) {
|
||||
if (isMobile) {
|
||||
vant.Toast.fail(response.data.msg)
|
||||
} else {
|
||||
@@ -318,7 +318,7 @@ function base64ToFile(base64Data, filename) {
|
||||
return new File([blob], filename, {type: contentType})
|
||||
}
|
||||
|
||||
function createLoading(text= '加载中...'){
|
||||
function createLoading(text = '加载中...') {
|
||||
return ELEMENT.Loading.service({
|
||||
lock: true,
|
||||
text: text,
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<link rel="stylesheet" href="${base!}/assets/platform/css/root.css" />
|
||||
<link rel="stylesheet" href="${base!}/assets/platform/fonts/themify-icons.css" />
|
||||
<link rel="stylesheet" href="${base!}/assets/platform/fonts/font-awesome.min.css" />
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/qweather-icons@1.3.0/font/qweather-icons.css">
|
||||
|
||||
<!-- import Vue before Element -->
|
||||
<script src="${base!}/assets/platform/plugins/vue/vue.js"></script>
|
||||
@@ -97,7 +98,7 @@ l
|
||||
src="https://webapi.amap.com/maps?v=2.0&key=b4fa2e2bc10a725ab007b98a3aa447cc&plugin=AMap.PolyEditor,AMap.Geolocation"
|
||||
></script>-->
|
||||
|
||||
<script src="https://map.qq.com/api/gljs?v=2.exp&key=MLLBZ-GQECI-ASXG7-5GNOZ-XW2OF-H5BVH"></script>
|
||||
<!-- <script src="https://map.qq.com/api/gljs?v=2.exp&key=MLLBZ-GQECI-ASXG7-5GNOZ-XW2OF-H5BVH"></script>-->
|
||||
|
||||
<script type="text/javascript">
|
||||
window._AMapSecurityConfig = {
|
||||
|
||||
@@ -5,12 +5,21 @@ const user = {
|
||||
<div class="user-container">
|
||||
<!-- 左侧:用户信息卡片 -->
|
||||
<div class="user-info-card">
|
||||
<div class="user-avatar">
|
||||
<span class="initial">
|
||||
${@auth.getPrincipalProperty('username')}
|
||||
</span>
|
||||
<div v-if="weatherData">
|
||||
|
||||
<div class="weather-tq"><span>{{weatherData.name}}</span></div>
|
||||
<div class="weather-tq">
|
||||
<span>
|
||||
{{ getWeatherEmoji(weatherData.icon) }} {{ weatherData.temp }}°C {{ weatherData.text }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="meta-item" v-else-if="weatherError">
|
||||
<span class="meta-value" style="color:#999">天气加载失败</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="user-details">
|
||||
|
||||
<div class="user-name">${@auth.getPrincipalProperty('username')}</div>
|
||||
<div class="user-meta">
|
||||
<div class="meta-item">
|
||||
@@ -33,7 +42,14 @@ const user = {
|
||||
<!--#}#-->
|
||||
</span>
|
||||
</div>
|
||||
<div class="meta-item">
|
||||
<span class="meta-label">角色:</span>
|
||||
<span class="meta-value">
|
||||
{{roleNames}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -43,39 +59,46 @@ const user = {
|
||||
<div class="header">
|
||||
<h3>待办中心</h3>
|
||||
<el-tabs v-model="activeTab" type="card" @tab-click="handleTabClick">
|
||||
<el-tab-pane label="待办事宜" name="pending"></el-tab-pane>
|
||||
<el-tab-pane label="待办事宜" name="todo"></el-tab-pane>
|
||||
<el-tab-pane label="已办事宜" name="done"></el-tab-pane>
|
||||
<el-tab-pane label="我的发起" name="initiation"></el-tab-pane>
|
||||
<el-tab-pane label="我的发起" name="started"></el-tab-pane>
|
||||
<el-tab-pane label="办结事务" name="completed"></el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
|
||||
<!-- 表格 -->
|
||||
<el-table
|
||||
:data="todoList"
|
||||
style="width: 100%"
|
||||
border
|
||||
stripe
|
||||
:cell-style="{ padding: '8px' }"
|
||||
:header-cell-style="{ background: '#f8f9fa', color: '#444', fontWeight: '500' }"
|
||||
:data="todoList"
|
||||
style="width: 100%"
|
||||
border
|
||||
stripe
|
||||
v-loading="loading"
|
||||
:cell-style="{ padding: '8px' }"
|
||||
:header-cell-style="{ background: '#f8f9fa', color: '#444', fontWeight: '500' }"
|
||||
>
|
||||
<el-table-column prop="index" label="序号" width="60" align="center">
|
||||
<el-table-column label="序号" type="index" :index="indexMethod" width="100px"></el-table-column>
|
||||
<el-table-column prop="categoryName" label="流程分类" width="100"></el-table-column>
|
||||
<el-table-column prop="title" label="流程名称" min-width="300">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.$index + 1 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="platform" label="所属平台" width="100" align="center"></el-table-column>
|
||||
<el-table-column prop="title" label="标题" min-width="300">
|
||||
<template slot-scope="scope">
|
||||
<el-tooltip effect="dark" :content="scope.row.title" placement="top">
|
||||
<span class="table-title">{{ scope.row.title }}</span>
|
||||
<el-tooltip effect="dark" :content="scope.row.instanceName" placement="top">
|
||||
<span class="table-title">{{ scope.row.instanceName }}</span>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sender" label="发送人" width="120" align="center"></el-table-column>
|
||||
<el-table-column prop="date" label="发起日期" width="120" align="center"></el-table-column>
|
||||
<el-table-column prop="sender" label="申请人" width="120">
|
||||
<template slot-scope="{row}">{{row.variable.initiatorName}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="date" label="发起日期" width="120">
|
||||
<template slot-scope="{row}">
|
||||
{{$moment(row.createdAt).format('YYYY-MM-DD')}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100px" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="openView(scope.row)">查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -83,20 +106,173 @@ const user = {
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
activeTab: 'pending',
|
||||
todoList: [
|
||||
{ platform: '教务系统', title: '关于2025年秋季学期课程安排的通知', sender: '教务处', date: '2025-10-31' },
|
||||
{ platform: '科研管理系统', title: '项目经费报销申请审批', sender: '财务处', date: '2025-10-30' },
|
||||
{ platform: '人事系统', title: '职称评定材料提交提醒', sender: '人事处', date: '2025-10-29' },
|
||||
{ platform: '后勤服务', title: '宿舍维修申请处理中', sender: '后勤处', date: '2025-10-28' },
|
||||
{ platform: '工会系统', title: '年度体检报名通知', sender: '工会', date: '2025-10-27' }
|
||||
]
|
||||
activeTab: 'todo',
|
||||
todoList: [],
|
||||
loading: false,
|
||||
pageForm: {
|
||||
pageNum: 1,
|
||||
pageSize: 5,
|
||||
totalCount: 0
|
||||
},
|
||||
// 🔆 天气相关数据
|
||||
weatherData: null,
|
||||
weatherError: false,
|
||||
// 🔑 和风天气 API Key(请替换为你自己的)
|
||||
QWEATHER_KEY: 'f916578cbb0e4b55b778b0de5847ecf5', // ←← 务必替换!
|
||||
roleNames: ""
|
||||
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
getWeatherEmoji(iconCode) {
|
||||
// 在 data 或 methods 外部定义(或作为 computed)
|
||||
const WEATHER_ICON_EMOJI = {
|
||||
'100': '☀️', // 晴
|
||||
'101': '⛅', // 多云
|
||||
'102': '🌤️', // 少云
|
||||
'103': '🌥️', // 晴间多云
|
||||
'104': '☁️', // 阴
|
||||
'300': '🌦️', // 阵雨
|
||||
'301': '🌧️', // 强阵雨
|
||||
'302': '⛈️', // 雷阵雨
|
||||
'303': '⛈️', // 强雷阵雨
|
||||
'304': '⛈️', // 雷阵雨伴有冰雹
|
||||
'305': '🌧️', // 小雨
|
||||
'306': '🌧️', // 中雨
|
||||
'307': '暴雨', // 暴雨及以上可用文字
|
||||
'308': '🌧️',
|
||||
'309': '🌧️',
|
||||
'310': '🌧️',
|
||||
'311': '🌨️', // 雨夹雪
|
||||
'312': '🌨️',
|
||||
'313': '🌨️',
|
||||
'314': '🌨️',
|
||||
'315': '🌨️',
|
||||
'316': '🌨️',
|
||||
'317': '🌨️',
|
||||
'318': '🌨️',
|
||||
'399': '🌧️', // 阵雨(其他)
|
||||
'400': '🌨️', // 小雪
|
||||
'401': '🌨️', // 中雪
|
||||
'402': '❄️', // 大雪
|
||||
'403': '❄️', // 暴雪
|
||||
'404': '🌫️', // 雾
|
||||
'405': '🌫️', // 冻雾
|
||||
'406': '🌫️', // 强浓雾
|
||||
'407': '🌫️', // 霾
|
||||
'408': '🌫️', // 浮尘
|
||||
'409': '🌫️', // 扬沙
|
||||
'410': '🌫️', // 沙尘暴
|
||||
'499': '🌫️',
|
||||
'500': '🌪️', // 龙卷风
|
||||
'501': '🌀', // 飓风
|
||||
'502': '🌫️', // 热带风暴
|
||||
'503': '🌫️', // 热带低压
|
||||
'504': '🌫️', // 台风
|
||||
'507': '🌫️', // 雾凇
|
||||
'508': '🌫️', // 冰粒
|
||||
'509': '🌫️', // 米雪
|
||||
'510': '🌫️', // 雨凇
|
||||
'511': '🌫️', // 冰雹
|
||||
'512': '🌫️', // 尘卷风
|
||||
'513': '🌫️', // 沙尘
|
||||
'514': '🌫️', // 浓积云
|
||||
'515': '🌫️', // 积雨云
|
||||
'900': '❓', // 未知
|
||||
'901': '🌫️', // 热
|
||||
'902': '❄️', // 冷
|
||||
'999': '❓'
|
||||
};
|
||||
return WEATHER_ICON_EMOJI[iconCode] || '🌤️';
|
||||
},
|
||||
async getConfigKey(key) {
|
||||
const resp = await this.$axios.post("/open/common/getConfigKey", { key })
|
||||
return resp.data
|
||||
},
|
||||
// 🔆 获取天气
|
||||
async fetchWeather() {
|
||||
try {
|
||||
const AppMapCenterPointX = await this.getConfigKey("AppMapCenterPointX")
|
||||
const AppMapCenterPointY = await this.getConfigKey("AppMapCenterPointY")
|
||||
// 1. 先通过城市名获取 locationId
|
||||
this.$axios.get("https://mx5rk62kvj.re.qweatherapi.com/geo/v2/city/lookup?location=" + AppMapCenterPointX + "," + AppMapCenterPointY + "&key=" + this.QWEATHER_KEY).then((geoRes) => {
|
||||
if (geoRes.code !== '200' || !geoRes.location?.[0]) {
|
||||
console.log('城市未找到')
|
||||
}
|
||||
const locationId = geoRes.location[0].id;
|
||||
|
||||
// 2. 获取当前天气
|
||||
this.$axios.get("https://mx5rk62kvj.re.qweatherapi.com/v7/weather/now?location=" + locationId + "&key=" + this.QWEATHER_KEY).then((weatherRes) => {
|
||||
if (weatherRes.code !== '200') {
|
||||
console.warn('天气数据异常:', weatherRes);
|
||||
}
|
||||
this.weatherData = {
|
||||
temp: weatherRes.now.temp,
|
||||
text: weatherRes.now.text,
|
||||
icon: weatherRes.now.icon,
|
||||
name: geoRes.location[0].name
|
||||
};
|
||||
this.weatherError = false;
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
|
||||
} catch (err) {
|
||||
console.warn('天气加载失败:', err);
|
||||
this.weatherError = true;
|
||||
this.weatherData = null;
|
||||
}
|
||||
},
|
||||
// 获取任务列表
|
||||
async getTasks() {
|
||||
this.loading = true
|
||||
try {
|
||||
const res = await $.post("/flow/todoCenter/" + this.activeTab, this.pageForm)
|
||||
if (res.code === 0) {
|
||||
this.todoList = res.data.list
|
||||
this.pageForm.totalCount = res.data.totalCount
|
||||
}
|
||||
} catch (error) {
|
||||
this.$message.error("获取任务列表失败")
|
||||
console.error("获取任务列表失败:", error)
|
||||
} finally {
|
||||
this.loading = false
|
||||
}
|
||||
},
|
||||
pageData() {
|
||||
this.getTasks()
|
||||
},
|
||||
handleTabClick(tab) {
|
||||
this.pageData()
|
||||
console.log('切换到:', tab.name);
|
||||
},
|
||||
// 处理任务
|
||||
async openView(task) {
|
||||
console.log(task)
|
||||
const {taskId, taskKey, taskState, instanceId, businessNo, formKey} = task
|
||||
if (!formKey) {
|
||||
this.$message.warning("当前流程没有配置地址")
|
||||
return
|
||||
}
|
||||
window.open(formKey + "?taskId=" + taskId + "bizId=" + businessNo + "taskKey=" + taskKey)
|
||||
},
|
||||
getRoleNames() {
|
||||
$.post("/platform/sys/role/getRoleNames").then(res => {
|
||||
if (res.code === 0) {
|
||||
this.roleNames = res.data.roleNames
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.pageData()
|
||||
this.getRoleNames()
|
||||
},
|
||||
mounted() {
|
||||
// 🔆 组件挂载后加载天气
|
||||
this.fetchWeather();
|
||||
},
|
||||
style: /*language=CSS*/ `
|
||||
.user-wrapper {
|
||||
@@ -116,7 +292,7 @@ const user = {
|
||||
|
||||
/* 左侧用户卡片 */
|
||||
.user-info-card {
|
||||
display: flex;
|
||||
/*display: flex;*/
|
||||
align-items: center;
|
||||
min-width: 320px;
|
||||
background: white;
|
||||
@@ -128,7 +304,17 @@ const user = {
|
||||
|
||||
.user-info-card:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 6px 16px rgba(0,0,0,0.12);
|
||||
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
|
||||
}
|
||||
|
||||
/* 天气值放大样式 */
|
||||
.weather-tq {
|
||||
font-size: 30px;
|
||||
font-weight: 600;
|
||||
color: #2c3e50;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.user-avatar {
|
||||
@@ -166,7 +352,8 @@ const user = {
|
||||
|
||||
.meta-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
/*align-items: center;*/
|
||||
line-height: 25px;
|
||||
}
|
||||
|
||||
.meta-label {
|
||||
@@ -231,6 +418,7 @@ const user = {
|
||||
flex-direction: column;
|
||||
width: 95%;
|
||||
}
|
||||
|
||||
.user-info-card, .todo-center {
|
||||
min-width: 100%;
|
||||
width: 100%;
|
||||
|
||||
Reference in New Issue
Block a user