url
zxl
9 小时以前 4cb034bd628af1ec98b35b39cb25a49cd19fe048
url
3个文件已修改
35 ■■■■ 已修改文件
pages/index/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
subpackage/flowable/task-process.vue 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
utils/config.js 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/index/index.vue
@@ -35,7 +35,7 @@
      </view>
      <view class="stats-item">
        <text class="stats-num text-orange">{{ count.red }}</text>
        <text class="stats-label">已过期</text>
        <text class="stats-label">已逾期</text>
      </view>
    </view>
    <!-- 项目进度柱状图 -->
subpackage/flowable/task-process.vue
@@ -2,14 +2,14 @@
  <view class="content"> 
    <BottomTabBar active="progress" />
     <web-view :src="url"></web-view>
    <web-view v-if="url" :src="url"></web-view>
  </view>
</template>
<script>
import BottomTabBar from '@/components/BottomTabBar.vue'
import LogTimeLine from '@/components/log-time-line.vue'
import config from '@/utils/config.js'
export default {
  name: 'TaskProcess',
  components: { BottomTabBar, LogTimeLine },
@@ -33,24 +33,25 @@
    let token = uni.getStorageSync('token') || '';
    const isView = query.isView === 'true' || query.isView === true;
    const pageName = isView ? 'web-view-entry' : 'web-view-send';
    this.url = `http://192.168.0.2/${pageName}?token=${token}`;
    let deployId = 'deployId=' + decodeValue(query.deployId)
    let taskId = 'taskId=' + decodeValue(query.taskId)
    let procInsId = 'procInsId=' + decodeValue(query.procInsId)
    
    let deployId = 'deployId=' + decodeValue(query.deployId)
    let taskId = 'taskId=' + decodeValue(query.taskId)
    let procInsId = 'procInsId=' + decodeValue(query.procInsId)
    let projectName = 'projectName=' + decodeValue(query.projectName)
    let flowName = 'flowName=' + decodeValue(query.flowName)
    let processName = 'processName=' + decodeValue(query.processName)
    console.log(deployId, taskId, procInsId, projectName, flowName, processName)
    this.url += '&'+ deployId + '&' + taskId + '&' + procInsId + '&' + projectName + '&' + flowName + '&' + processName;
    console.log(this.url)
    // 一次性构建完整的 URL,避免多次触发 web-view 加载
    const fullUrl = `${config.webViewUrl}${pageName}?token=${token}&${deployId}&${taskId}&${procInsId}&${projectName}&${flowName}&${processName}`;
    console.log('Final WebView URL:', fullUrl)
    // 延迟一小段时间赋值,确保页面渲染完成后再加载 web-view,解决第一次加载不出来的问题
    setTimeout(() => {
      this.url = fullUrl;
    }, 100);
  },
  methods: {
utils/config.js
@@ -1,5 +1,7 @@
export default{
    env:'dev',
    appName: 'nongtou-uni',
    apiBaseUrl: 'http://127.0.0.1:10076'
    apiBaseUrl: 'http://127.0.0.1:10076',
    webViewUrl: 'http://192.168.0.2/',
}