mirror of
https://github.com/kuaifan/dootask.git
synced 2026-08-01 02:45:58 +00:00
新移动端从 EEUI(weex) 切到 Expo(react-native),UA 标识从 'eeui' 改为 'DooTaskApp', 桥接底层从全局 requireModuleJs 切到 window.__nativeBridge.call(method,args) Promise RPC。 约 52 个文件批量改名(256 处引用): - 平台识别:$A.isEEUIApp/Vue.prototype.$isEEUIApp → isMobileApp / $isMobileApp app.js 顶部 UA 正则 /eeui/i → /DooTaskApp/i app.js requireModuleJs 等待逻辑替换为 window.__nativeBridge 就绪判定 - 桥接 API:$A.eeuiAppXXX → $A.nativeAppXXX - functions/eeui.js 删除,重写为 functions/native-app.js 底层走 window.__nativeBridge.call;nativeAppSendMessage 把旧 sendMessage 的 各 action 拆解为独立 method 调用(updateTheme/windowSize/setBadge/vibrate/ callTel/picturePreview/videoPreview/startMeeting/updateMeetingInfo 等) - types/dootask-globals.d.ts:方法签名同步改名 - store/actions.js:清理 saveUserInfoBase 内旧的 userChatList/userUploadUrl sendMessage(二期由 /share 接收页直接调接口替代) 二期 /share 接收页(跨 App 分享): - pages/share.vue(新增):原生 Share Extension / Android Intent 通过 dootask://share?token=... 拉起 App 后跳本页; 调 nativeAppGetSharedPayload 取分享元数据; 复用 api/users/share/list 渲染会话列表; 用户选会话 → POST api/dialog/msg/sendfiles 上传 + sendtext 发文本/URL; 完成后 nativeAppClearSharedPayload 清理 + 跳目标会话 - routes.js 注册 /share 路由 - language/original-web.txt 加 share.vue 用到的文案 构建链路(electron/build.js): - appbuild app 子命令:前端产物从复制到 resources/mobile/src/public + EEUI docker 构建 改为同步到 resources/mobile/assets/web(由 plugins/withWebAssets 注入原生 bundle) - android-upload apk 路径:从 platforms/android/eeuiApp/... 改为 android/app/build/outputs/apk/release(Expo prebuild 标准布局) 子模块 resources/mobile 指针更新到新 Expo 工程提交(feat/mobile-expo-rewrite 分支)。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
189 lines
5.9 KiB
Vue
189 lines
5.9 KiB
Vue
<template>
|
|
<div class="td-action" :style="tdStyle" :data-width="width" :data-height="height">
|
|
<div
|
|
ref="action"
|
|
class="td-action-container"
|
|
:class="{'td-action-menu':menu.length > 0}"
|
|
@mouseenter="handleIn"
|
|
v-resize="onResize">
|
|
<slot></slot>
|
|
<ETooltip
|
|
v-for="(item, key) in menu"
|
|
v-if="item.hidden !== true"
|
|
placement="top"
|
|
:key="key"
|
|
:disabled="$isMobileApp || windowTouch || !item.title"
|
|
:content="item.title"
|
|
:enterable="false"
|
|
:open-delay="600">
|
|
<EDropdown
|
|
v-if="item.children && item.children.length > 0"
|
|
size="medium"
|
|
trigger="click"
|
|
class="menu-dropdown"
|
|
@command="onClick">
|
|
<a
|
|
v-if="item.label"
|
|
:href="item.href || 'javascript:void(0)'"
|
|
:target="item.target || '_self'"
|
|
:style="item.style || {}">{{item.label}}</a>
|
|
<i
|
|
v-else-if="isAliIcon(item.icon)"
|
|
class="taskfont menu-icon"
|
|
v-html="item.icon"
|
|
:style="item.style || {}"/>
|
|
<Icon
|
|
v-else
|
|
class="menu-icon"
|
|
:type="item.icon"
|
|
:style="item.style || {}"/>
|
|
<EDropdownMenu slot="dropdown">
|
|
<EDropdownItem
|
|
v-for="(d, k) in item.children"
|
|
v-if="d.hidden !== true"
|
|
:key="k"
|
|
:command="d.action"
|
|
:disabled="!!d.disabled"
|
|
:divided="!!d.divided"
|
|
:style="d.style || {}">
|
|
<div>{{d.title}}</div>
|
|
</EDropdownItem>
|
|
</EDropdownMenu>
|
|
</EDropdown>
|
|
<a
|
|
v-else-if="item.label"
|
|
:href="item.href || 'javascript:void(0)'"
|
|
:target="item.target || '_self'"
|
|
:style="item.style || {}"
|
|
@click="onClick(item.action)">{{item.label}}</a>
|
|
<i
|
|
v-else-if="isAliIcon(item.icon)"
|
|
class="taskfont menu-icon"
|
|
v-html="item.icon"
|
|
:style="item.style || {}"
|
|
@click="onClick(item.action)"/>
|
|
<Icon
|
|
v-else
|
|
class="menu-icon"
|
|
:type="item.icon"
|
|
:style="item.style || {}"
|
|
@click="onClick(item.action)"/>
|
|
</ETooltip>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import VueResizeObserver from "vue-resize-observer";
|
|
import Vue from 'vue'
|
|
Vue.use(VueResizeObserver);
|
|
|
|
export default {
|
|
name: 'TableAction',
|
|
props: {
|
|
column: {
|
|
type: Object,
|
|
default: () => {
|
|
return {};
|
|
}
|
|
},
|
|
autoWidth: {
|
|
type: Boolean,
|
|
default: true
|
|
},
|
|
minWidth: {
|
|
type: Number,
|
|
default: 80
|
|
},
|
|
align: {
|
|
type: String,
|
|
default: ''
|
|
},
|
|
menu: {
|
|
type: Array,
|
|
default: () => {
|
|
return [];
|
|
}
|
|
},
|
|
},
|
|
data() {
|
|
return {
|
|
width: 0,
|
|
height: 0,
|
|
}
|
|
},
|
|
mounted() {
|
|
this.onUpdate();
|
|
},
|
|
activated() {
|
|
this.onUpdate();
|
|
},
|
|
beforeUpdate() {
|
|
this.onUpdate();
|
|
},
|
|
computed: {
|
|
tdStyle() {
|
|
const style = {};
|
|
const {align} = this;
|
|
switch (align.toLowerCase()) {
|
|
case 'left':
|
|
style.justifyContent = 'flex-start';
|
|
break;
|
|
case 'center':
|
|
style.justifyContent = 'center';
|
|
break;
|
|
case 'right':
|
|
style.justifyContent = 'flex-end';
|
|
break;
|
|
}
|
|
return style;
|
|
}
|
|
},
|
|
methods: {
|
|
isAliIcon(icon) {
|
|
return $A.leftExists(icon, '&#')
|
|
},
|
|
handleIn() {
|
|
if (this.$refs.action?.offsetWidth != this.width) {
|
|
this.onUpdate();
|
|
}
|
|
},
|
|
onUpdate() {
|
|
this.onResize({
|
|
width: this.$refs.action.offsetWidth,
|
|
height: this.$refs.action.offsetHeight,
|
|
})
|
|
},
|
|
onResize({ width, height }) {
|
|
if (!this.autoWidth) {
|
|
return;
|
|
}
|
|
$A(".ivu-table-column-" + this.column.__id).each((index, el) => {
|
|
let action = $A(el).find(".td-action-container")
|
|
if (action.length > 0) {
|
|
width = Math.max(width, action[0].offsetWidth)
|
|
height = Math.max(height, action[0].offsetHeight)
|
|
}
|
|
});
|
|
this.width = width;
|
|
this.height = height;
|
|
let newWidth = Math.max(this.minWidth, this.width + 26);
|
|
if (this.column.minWidth) {
|
|
newWidth = Math.max(this.column.minWidth, newWidth);
|
|
}
|
|
if (this.column.maxWidth) {
|
|
newWidth = Math.min(this.column.maxWidth, newWidth);
|
|
}
|
|
if (newWidth != this.column.width) {
|
|
this.$nextTick(() => {
|
|
this.$set(this.column, 'width', newWidth);
|
|
})
|
|
}
|
|
},
|
|
onClick(action) {
|
|
this.$emit("action", action)
|
|
}
|
|
}
|
|
}
|
|
</script>
|