Merge branch 'dev' of codeup.aliyun.com:61c14a7efa282c88e103c23f/oak-general-business into dev
This commit is contained in:
commit
dcf44f1725
|
|
@ -1 +1,3 @@
|
||||||
export {};
|
/// <reference types="react" />
|
||||||
|
declare const _default: import("react").ComponentType<any>;
|
||||||
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
var tslib_1 = require("tslib");
|
exports.default = OakComponent({
|
||||||
var mockId_1 = require("oak-frontend-base/lib/utils/mockId");
|
|
||||||
var extraFile_1 = require("../../../utils/extraFile");
|
|
||||||
OakComponent({
|
|
||||||
entity: 'extraFile',
|
entity: 'extraFile',
|
||||||
isList: false,
|
isList: false,
|
||||||
projection: {
|
projection: {
|
||||||
|
|
@ -17,25 +14,16 @@ OakComponent({
|
||||||
extension: 1,
|
extension: 1,
|
||||||
type: 1,
|
type: 1,
|
||||||
entity: 1,
|
entity: 1,
|
||||||
|
entityId: 1,
|
||||||
},
|
},
|
||||||
formData: function (_a) {
|
formData: function (_a) {
|
||||||
var extraFile = _a.data, features = _a.features;
|
var extraFile = _a.data, features = _a.features;
|
||||||
return tslib_1.__awaiter(void 0, void 0, void 0, function () {
|
return {
|
||||||
var application, isTmp;
|
url: features.extraFile.getUrl(extraFile),
|
||||||
var _b;
|
};
|
||||||
return tslib_1.__generator(this, function (_c) {
|
},
|
||||||
switch (_c.label) {
|
wechatMp: {
|
||||||
case 0: return [4 /*yield*/, features.application.getApplication()];
|
externalClasses: ['oak-class'],
|
||||||
case 1:
|
|
||||||
application = _c.sent();
|
|
||||||
isTmp = (extraFile === null || extraFile === void 0 ? void 0 : extraFile.id) && (0, mockId_1.isMockId)(extraFile.id);
|
|
||||||
return [2 /*return*/, {
|
|
||||||
src: extraFile && (0, extraFile_1.composeFileUrl)(extraFile, (_b = application === null || application === void 0 ? void 0 : application.system) === null || _b === void 0 ? void 0 : _b.config),
|
|
||||||
isTmp: isTmp,
|
|
||||||
}];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
properties: {
|
properties: {
|
||||||
// 图片显示模式
|
// 图片显示模式
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
<!-- index.wxml -->
|
<!-- index.wxml -->
|
||||||
<image src="{{src}}" mode="{{mode}}" class="image l-class"/>
|
<image src="{{url}}" mode="{{mode}}" class="image oak-class"/>
|
||||||
|
|
@ -2,6 +2,6 @@
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
var jsx_runtime_1 = require("react/jsx-runtime");
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
||||||
function render() {
|
function render() {
|
||||||
return ((0, jsx_runtime_1.jsx)("div", { children: "react" }));
|
return ((0, jsx_runtime_1.jsx)("div", { children: "\u672A\u5B9E\u73B0" }));
|
||||||
}
|
}
|
||||||
exports.default = render;
|
exports.default = render;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
|
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
height: 100vh;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: 'center';
|
justify-content: center;
|
||||||
align-items: 'center';
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ var tslib_1 = require("tslib");
|
||||||
var uuid_1 = require("oak-domain/lib/utils/uuid");
|
var uuid_1 = require("oak-domain/lib/utils/uuid");
|
||||||
var assert_1 = tslib_1.__importDefault(require("assert"));
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
||||||
var index_1 = tslib_1.__importDefault(require("../../../utils/dialog/index"));
|
var index_1 = tslib_1.__importDefault(require("../../../utils/dialog/index"));
|
||||||
var extraFile_1 = require("../../../utils/extraFile");
|
|
||||||
exports.default = OakComponent({
|
exports.default = OakComponent({
|
||||||
entity: 'extraFile',
|
entity: 'extraFile',
|
||||||
isList: true,
|
isList: true,
|
||||||
|
|
@ -20,6 +19,7 @@ exports.default = OakComponent({
|
||||||
extension: 1,
|
extension: 1,
|
||||||
type: 1,
|
type: 1,
|
||||||
entity: 1,
|
entity: 1,
|
||||||
|
entityId: 1
|
||||||
},
|
},
|
||||||
formData: function (_a) {
|
formData: function (_a) {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
|
|
@ -46,7 +46,7 @@ exports.default = OakComponent({
|
||||||
itemSizePercentage: '',
|
itemSizePercentage: '',
|
||||||
},
|
},
|
||||||
wechatMp: {
|
wechatMp: {
|
||||||
externalClasses: ['l-class', 'l-item-class'],
|
externalClasses: ['oak-class', 'oak-item-class'],
|
||||||
},
|
},
|
||||||
properties: {
|
properties: {
|
||||||
removeLater: Boolean,
|
removeLater: Boolean,
|
||||||
|
|
@ -321,14 +321,15 @@ exports.default = OakComponent({
|
||||||
onItemTapped: function (event) {
|
onItemTapped: function (event) {
|
||||||
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
||||||
var _a, files, systemConfig, index, imageUrl, urls, detail, result;
|
var _a, files, systemConfig, index, imageUrl, urls, detail, result;
|
||||||
|
var _this = this;
|
||||||
return tslib_1.__generator(this, function (_b) {
|
return tslib_1.__generator(this, function (_b) {
|
||||||
switch (_b.label) {
|
switch (_b.label) {
|
||||||
case 0:
|
case 0:
|
||||||
_a = this.state, files = _a.files, systemConfig = _a.systemConfig;
|
_a = this.state, files = _a.files, systemConfig = _a.systemConfig;
|
||||||
index = event.currentTarget.dataset.index;
|
index = event.currentTarget.dataset.index;
|
||||||
imageUrl = (0, extraFile_1.composeFileUrl)(files[index], systemConfig);
|
imageUrl = this.features.extraFile.getUrl(files[index]);
|
||||||
urls = files === null || files === void 0 ? void 0 : files.filter(function (ele) { return !!ele; }).map(function (ele) {
|
urls = files === null || files === void 0 ? void 0 : files.filter(function (ele) { return !!ele; }).map(function (ele) {
|
||||||
return (0, extraFile_1.composeFileUrl)(ele, systemConfig);
|
return _this.features.extraFile.getUrl(ele);
|
||||||
});
|
});
|
||||||
detail = {
|
detail = {
|
||||||
all: files,
|
all: files,
|
||||||
|
|
@ -353,41 +354,39 @@ exports.default = OakComponent({
|
||||||
},
|
},
|
||||||
onDeleteByMp: function (event) {
|
onDeleteByMp: function (event) {
|
||||||
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
||||||
var value, id, bucket, result, confirm_1;
|
var value, id, bucket, origin, result, confirm_1;
|
||||||
return tslib_1.__generator(this, function (_a) {
|
return tslib_1.__generator(this, function (_a) {
|
||||||
switch (_a.label) {
|
switch (_a.label) {
|
||||||
case 0:
|
case 0:
|
||||||
value = event.currentTarget.dataset.value;
|
value = event.currentTarget.dataset.value;
|
||||||
id = value.id, bucket = value.bucket;
|
id = value.id, bucket = value.bucket, origin = value.origin;
|
||||||
if (!(this.props.removeLater || (origin !== 'unknown' && !bucket))) return [3 /*break*/, 2];
|
if (!(this.props.removeLater || (origin !== 'unknown' && !bucket))) return [3 /*break*/, 1];
|
||||||
return [4 /*yield*/, this.removeItem(id)];
|
this.removeItem(id);
|
||||||
case 1:
|
return [3 /*break*/, 4];
|
||||||
_a.sent();
|
case 1: return [4 /*yield*/, wx.showModal({
|
||||||
return [3 /*break*/, 5];
|
|
||||||
case 2: return [4 /*yield*/, wx.showModal({
|
|
||||||
title: '确认删除吗',
|
title: '确认删除吗',
|
||||||
content: '删除现有文件',
|
content: '删除现有文件',
|
||||||
})];
|
})];
|
||||||
case 3:
|
case 2:
|
||||||
result = _a.sent();
|
result = _a.sent();
|
||||||
confirm_1 = result.confirm;
|
confirm_1 = result.confirm;
|
||||||
if (!confirm_1) return [3 /*break*/, 5];
|
if (!confirm_1) return [3 /*break*/, 4];
|
||||||
this.removeItem(id);
|
this.removeItem(id);
|
||||||
return [4 /*yield*/, this.execute()];
|
return [4 /*yield*/, this.execute()];
|
||||||
case 4:
|
case 3:
|
||||||
_a.sent();
|
_a.sent();
|
||||||
_a.label = 5;
|
_a.label = 4;
|
||||||
case 5: return [2 /*return*/];
|
case 4: return [2 /*return*/];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onDeleteByWeb: function (value) {
|
onDeleteByWeb: function (value) {
|
||||||
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
||||||
var id, bucket, confirm_2;
|
var id, bucket, origin, confirm_2;
|
||||||
var _this = this;
|
var _this = this;
|
||||||
return tslib_1.__generator(this, function (_a) {
|
return tslib_1.__generator(this, function (_a) {
|
||||||
id = value.id, bucket = value.bucket;
|
id = value.id, bucket = value.bucket, origin = value.origin;
|
||||||
// 如果 removeLater为true 或 origin === 'qiniu' 且 bucket不存在
|
// 如果 removeLater为true 或 origin === 'qiniu' 且 bucket不存在
|
||||||
if (this.props.removeLater || (origin !== 'unknown' && !bucket)) {
|
if (this.props.removeLater || (origin !== 'unknown' && !bucket)) {
|
||||||
this.removeItem(id);
|
this.removeItem(id);
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
{
|
{
|
||||||
"component": true,
|
"component": true,
|
||||||
"usingComponents": {
|
"usingComponents": {
|
||||||
"l-icon": "../../../miniprogram_npm/lin-ui/icon/index"
|
"l-icon": "../../../miniprogram_npm/lin-ui/icon/index",
|
||||||
},
|
"OakDisplay": "../display/index"
|
||||||
"componentGenerics": {
|
|
||||||
"item": true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,15 @@
|
||||||
<view class="file-list__container l-class">
|
<view class="file-list__container aok-class">
|
||||||
<block wx:for="{{files}}" wx:key="index">
|
<block wx:for="{{files}}" wx:key="index">
|
||||||
<block wx:if="{{item}}">
|
<block wx:if="{{item}}">
|
||||||
<view class="file-list__item file-list__item--{{size}} l-item-class" style="{{itemSizePercentage?'width:'+itemSizePercentage+'padding-bottom:'+itemSizePercentage:'xxx'}}">
|
<view class="file-list__item file-list__item--{{size}} oak-item-class" style="{{itemSizePercentage?'width:'+itemSizePercentage+'padding-bottom:'+itemSizePercentage:'xxx'}}">
|
||||||
<item data-index="{{index}}" bind:tap="onItemTapped" mode="{{mode}}" oakPath="{{oakFullpath}}.{{index}}" />
|
<OakDisplay data-index="{{index}}" bind:tap="onItemTapped" mode="{{mode}}" oakPath="{{oakFullpath}}.{{item.id}}" />
|
||||||
<view wx:if="{{!disableDelete}}" mut-bind:tap="onDeleteByMp" class="file-list__remove" data-value="{{item}}">
|
<view wx:if="{{!disableDelete}}" mut-bind:tap="onDeleteByMp" class="file-list__remove" data-value="{{item}}">
|
||||||
<t-icon name="close" color="#ffffff" size="18" />
|
<l-icon name="close" color="#ffffff" size="18" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
</block>
|
</block>
|
||||||
<view class="file-list__item file-list__item--add file-list__item--{{size}} l-item-class" style="{{itemSizePercentage?'width:'+itemSizePercentage+'padding-bottom:'+itemSizePercentage:''}}" wx:if="{{!disableInsert}}" bind:tap="onPickByMp">
|
<view class="file-list__item file-list__item--add file-list__item--{{size}} oak-item-class" style="{{itemSizePercentage?'width:'+itemSizePercentage+'padding-bottom:'+itemSizePercentage:''}}" wx:if="{{!disableInsert}}" bind:tap="onPickByMp">
|
||||||
<view class="file-list__item-slot-wrapper">
|
<view class="file-list__item-slot-wrapper">
|
||||||
<slot />
|
<slot />
|
||||||
</view>
|
</view>
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,8 @@ function extraFileToUploadFile(extraFile, systemConfig) {
|
||||||
id: extraFile.id,
|
id: extraFile.id,
|
||||||
url: (0, extraFile_1.composeFileUrl)(extraFile, systemConfig),
|
url: (0, extraFile_1.composeFileUrl)(extraFile, systemConfig),
|
||||||
thumbUrl: (0, extraFile_1.composeFileUrl)(extraFile, systemConfig),
|
thumbUrl: (0, extraFile_1.composeFileUrl)(extraFile, systemConfig),
|
||||||
name: extraFile.filename,
|
name: extraFile.filename + (extraFile.extension || ''),
|
||||||
fileName: extraFile.filename,
|
fileName: extraFile.filename + (extraFile.extension || ''),
|
||||||
size: extraFile.size,
|
size: extraFile.size,
|
||||||
type: extraFile.fileType,
|
type: extraFile.fileType,
|
||||||
uid: extraFile.id, //upload 组件需要uid来维护fileList
|
uid: extraFile.id, //upload 组件需要uid来维护fileList
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,8 @@ function render(props) {
|
||||||
modal.destroy();
|
modal.destroy();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
} }, { children: "Reset" })) }))] }))] }))] }));
|
} }, { children: "Reset" })) })), (0, jsx_runtime_1.jsx)(antd_1.Tooltip, tslib_1.__assign({ title: "\u67E5\u770BOakIcon" }, { children: (0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ size: "large", type: "primary", shape: "circle", onClick: function () {
|
||||||
|
window.open('/icon');
|
||||||
|
} }, { children: "Icon" })) }))] }))] }))] }));
|
||||||
}
|
}
|
||||||
exports.default = render;
|
exports.default = render;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
/// <reference types="react" />
|
||||||
|
declare const _default: import("react").ComponentType<any>;
|
||||||
|
export default _default;
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.default = OakComponent({
|
||||||
|
isList: true,
|
||||||
|
methods: {},
|
||||||
|
});
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"navigationBarTitleText": "OakIcon示例",
|
||||||
|
"usingComponents": {}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
|
||||||
|
|
||||||
|
.page-body {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
<!-- index.wxml -->
|
||||||
|
<view class="page-body">
|
||||||
|
未实现
|
||||||
|
</view>
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
import { EntityDict } from '../../general-app-domain';
|
||||||
|
import { WebComponentProps } from 'oak-frontend-base';
|
||||||
|
export default function Render(props: WebComponentProps<EntityDict, 'token', true, {}, {}>): JSX.Element;
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
var tslib_1 = require("tslib");
|
||||||
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
||||||
|
var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less"));
|
||||||
|
function Render(props) {
|
||||||
|
return (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.container }, { children: "1122" }));
|
||||||
|
}
|
||||||
|
exports.default = Render;
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
.container {
|
||||||
|
height: 100vh;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
background-color: var(--oak-bg-color-page);
|
||||||
|
}
|
||||||
|
|
@ -1,37 +1,36 @@
|
||||||
import { isMockId } from 'oak-frontend-base/lib/utils/mockId';
|
|
||||||
import { EntityDict } from '../../../general-app-domain';
|
import { EntityDict } from '../../../general-app-domain';
|
||||||
import { composeFileUrl } from '../../../utils/extraFile';
|
|
||||||
OakComponent(
|
|
||||||
{
|
|
||||||
entity: 'extraFile',
|
|
||||||
isList: false,
|
|
||||||
projection: {
|
|
||||||
id: 1,
|
|
||||||
tag1: 1,
|
|
||||||
origin: 1,
|
|
||||||
bucket: 1,
|
|
||||||
objectId: 1,
|
|
||||||
filename: 1,
|
|
||||||
extra1: 1,
|
|
||||||
extension: 1,
|
|
||||||
type: 1,
|
|
||||||
entity: 1,
|
|
||||||
},
|
|
||||||
formData: async ({ data: extraFile, features }) => {
|
|
||||||
const application = await features.application.getApplication();
|
|
||||||
|
|
||||||
const isTmp = extraFile?.id && isMockId(extraFile.id);
|
export default OakComponent({
|
||||||
return {
|
entity: 'extraFile',
|
||||||
src: extraFile && composeFileUrl(extraFile as EntityDict['extraFile']['OpSchema'], application?.system?.config),
|
isList: false,
|
||||||
isTmp,
|
projection: {
|
||||||
};
|
id: 1,
|
||||||
|
tag1: 1,
|
||||||
|
origin: 1,
|
||||||
|
bucket: 1,
|
||||||
|
objectId: 1,
|
||||||
|
filename: 1,
|
||||||
|
extra1: 1,
|
||||||
|
extension: 1,
|
||||||
|
type: 1,
|
||||||
|
entity: 1,
|
||||||
|
entityId: 1,
|
||||||
|
},
|
||||||
|
formData: ({ data: extraFile, features }) => {
|
||||||
|
return {
|
||||||
|
url: features.extraFile.getUrl(
|
||||||
|
extraFile as EntityDict['extraFile']['Schema']
|
||||||
|
),
|
||||||
|
};
|
||||||
|
},
|
||||||
|
wechatMp: {
|
||||||
|
externalClasses: ['oak-class'],
|
||||||
|
},
|
||||||
|
properties: {
|
||||||
|
// 图片显示模式
|
||||||
|
mode: {
|
||||||
|
type: String,
|
||||||
|
value: 'aspectFit',
|
||||||
},
|
},
|
||||||
properties: {
|
},
|
||||||
// 图片显示模式
|
});
|
||||||
mode: {
|
|
||||||
type: String,
|
|
||||||
value: 'aspectFit',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
<!-- index.wxml -->
|
<!-- index.wxml -->
|
||||||
<image src="{{src}}" mode="{{mode}}" class="image l-class"/>
|
<image src="{{url}}" mode="{{mode}}" class="image oak-class"/>
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
|
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
height: 100vh;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: 'center';
|
justify-content: center;
|
||||||
align-items: 'center';
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import React, { Component } from 'react';
|
||||||
export default function render() {
|
export default function render() {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
react
|
未实现
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
{
|
{
|
||||||
"component": true,
|
"component": true,
|
||||||
"usingComponents": {
|
"usingComponents": {
|
||||||
"l-icon": "../../../miniprogram_npm/lin-ui/icon/index"
|
"l-icon": "../../../miniprogram_npm/lin-ui/icon/index",
|
||||||
},
|
"OakDisplay": "../display/index"
|
||||||
"componentGenerics": {
|
|
||||||
"item": true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ import { generateNewId } from 'oak-domain/lib/utils/uuid';
|
||||||
import assert from 'assert';
|
import assert from 'assert';
|
||||||
import Dialog from '../../../utils/dialog/index';
|
import Dialog from '../../../utils/dialog/index';
|
||||||
import { EntityDict } from '../../../general-app-domain';
|
import { EntityDict } from '../../../general-app-domain';
|
||||||
import { composeFileUrl } from '../../../utils/extraFile';
|
|
||||||
|
|
||||||
export default OakComponent({
|
export default OakComponent({
|
||||||
entity: 'extraFile',
|
entity: 'extraFile',
|
||||||
|
|
@ -19,6 +18,7 @@ export default OakComponent({
|
||||||
extension: 1,
|
extension: 1,
|
||||||
type: 1,
|
type: 1,
|
||||||
entity: 1,
|
entity: 1,
|
||||||
|
entityId: 1
|
||||||
},
|
},
|
||||||
formData({ data: originalFiles, features }) {
|
formData({ data: originalFiles, features }) {
|
||||||
const application = features.application.getApplication();
|
const application = features.application.getApplication();
|
||||||
|
|
@ -45,7 +45,7 @@ export default OakComponent({
|
||||||
itemSizePercentage: '',
|
itemSizePercentage: '',
|
||||||
},
|
},
|
||||||
wechatMp: {
|
wechatMp: {
|
||||||
externalClasses: ['l-class', 'l-item-class'],
|
externalClasses: ['oak-class', 'oak-item-class'],
|
||||||
},
|
},
|
||||||
properties: {
|
properties: {
|
||||||
removeLater: Boolean,
|
removeLater: Boolean,
|
||||||
|
|
@ -283,11 +283,11 @@ export default OakComponent({
|
||||||
async onItemTapped(event: WechatMiniprogram.Touch) {
|
async onItemTapped(event: WechatMiniprogram.Touch) {
|
||||||
const { files, systemConfig } = this.state;
|
const { files, systemConfig } = this.state;
|
||||||
const { index } = event.currentTarget.dataset;
|
const { index } = event.currentTarget.dataset;
|
||||||
const imageUrl = composeFileUrl(files[index]!, systemConfig);
|
const imageUrl = this.features.extraFile.getUrl(files[index]!);
|
||||||
const urls = files
|
const urls = files
|
||||||
?.filter((ele: EntityDict['extraFile']['Schema']) => !!ele)
|
?.filter((ele: EntityDict['extraFile']['Schema']) => !!ele)
|
||||||
.map((ele: EntityDict['extraFile']['Schema']) =>
|
.map((ele: EntityDict['extraFile']['Schema']) =>
|
||||||
composeFileUrl(ele!, systemConfig)
|
this.features.extraFile.getUrl(ele!)
|
||||||
);
|
);
|
||||||
|
|
||||||
const detail = {
|
const detail = {
|
||||||
|
|
@ -308,10 +308,10 @@ export default OakComponent({
|
||||||
},
|
},
|
||||||
async onDeleteByMp(event: WechatMiniprogram.Touch) {
|
async onDeleteByMp(event: WechatMiniprogram.Touch) {
|
||||||
const { value } = event.currentTarget.dataset;
|
const { value } = event.currentTarget.dataset;
|
||||||
const { id, bucket } = value;
|
const { id, bucket, origin } = value;
|
||||||
|
|
||||||
if (this.props.removeLater || (origin !== 'unknown' && !bucket)) {
|
if (this.props.removeLater || (origin !== 'unknown' && !bucket)) {
|
||||||
await this.removeItem(id);
|
this.removeItem(id);
|
||||||
} else {
|
} else {
|
||||||
const result = await wx.showModal({
|
const result = await wx.showModal({
|
||||||
title: '确认删除吗',
|
title: '确认删除吗',
|
||||||
|
|
@ -325,7 +325,7 @@ export default OakComponent({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async onDeleteByWeb(value: any) {
|
async onDeleteByWeb(value: any) {
|
||||||
const { id, bucket } = value;
|
const { id, bucket, origin } = value;
|
||||||
// 如果 removeLater为true 或 origin === 'qiniu' 且 bucket不存在
|
// 如果 removeLater为true 或 origin === 'qiniu' 且 bucket不存在
|
||||||
if (this.props.removeLater || (origin !== 'unknown' && !bucket)) {
|
if (this.props.removeLater || (origin !== 'unknown' && !bucket)) {
|
||||||
this.removeItem(id);
|
this.removeItem(id);
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,15 @@
|
||||||
<view class="file-list__container l-class">
|
<view class="file-list__container aok-class">
|
||||||
<block wx:for="{{files}}" wx:key="index">
|
<block wx:for="{{files}}" wx:key="index">
|
||||||
<block wx:if="{{item}}">
|
<block wx:if="{{item}}">
|
||||||
<view class="file-list__item file-list__item--{{size}} l-item-class" style="{{itemSizePercentage?'width:'+itemSizePercentage+'padding-bottom:'+itemSizePercentage:'xxx'}}">
|
<view class="file-list__item file-list__item--{{size}} oak-item-class" style="{{itemSizePercentage?'width:'+itemSizePercentage+'padding-bottom:'+itemSizePercentage:'xxx'}}">
|
||||||
<item data-index="{{index}}" bind:tap="onItemTapped" mode="{{mode}}" oakPath="{{oakFullpath}}.{{index}}" />
|
<OakDisplay data-index="{{index}}" bind:tap="onItemTapped" mode="{{mode}}" oakPath="{{oakFullpath}}.{{item.id}}" />
|
||||||
<view wx:if="{{!disableDelete}}" mut-bind:tap="onDeleteByMp" class="file-list__remove" data-value="{{item}}">
|
<view wx:if="{{!disableDelete}}" mut-bind:tap="onDeleteByMp" class="file-list__remove" data-value="{{item}}">
|
||||||
<t-icon name="close" color="#ffffff" size="18" />
|
<l-icon name="close" color="#ffffff" size="18" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
</block>
|
</block>
|
||||||
<view class="file-list__item file-list__item--add file-list__item--{{size}} l-item-class" style="{{itemSizePercentage?'width:'+itemSizePercentage+'padding-bottom:'+itemSizePercentage:''}}" wx:if="{{!disableInsert}}" bind:tap="onPickByMp">
|
<view class="file-list__item file-list__item--add file-list__item--{{size}} oak-item-class" style="{{itemSizePercentage?'width:'+itemSizePercentage+'padding-bottom:'+itemSizePercentage:''}}" wx:if="{{!disableInsert}}" bind:tap="onPickByMp">
|
||||||
<view class="file-list__item-slot-wrapper">
|
<view class="file-list__item-slot-wrapper">
|
||||||
<slot />
|
<slot />
|
||||||
</view>
|
</view>
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ import {
|
||||||
Tag,
|
Tag,
|
||||||
Button,
|
Button,
|
||||||
Table,
|
Table,
|
||||||
UploadProps,
|
|
||||||
} from 'antd';
|
} from 'antd';
|
||||||
import { PlusOutlined } from '@ant-design/icons';
|
import { PlusOutlined } from '@ant-design/icons';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
@ -30,8 +29,8 @@ function extraFileToUploadFile(
|
||||||
id: extraFile.id,
|
id: extraFile.id,
|
||||||
url: composeFileUrl(extraFile, systemConfig),
|
url: composeFileUrl(extraFile, systemConfig),
|
||||||
thumbUrl: composeFileUrl(extraFile, systemConfig),
|
thumbUrl: composeFileUrl(extraFile, systemConfig),
|
||||||
name: extraFile.filename,
|
name: extraFile.filename + (extraFile.extension || ''),
|
||||||
fileName: extraFile.filename,
|
fileName: extraFile.filename + (extraFile.extension || ''),
|
||||||
size: extraFile.size!,
|
size: extraFile.size!,
|
||||||
type: extraFile.fileType,
|
type: extraFile.fileType,
|
||||||
uid: extraFile.id, //upload 组件需要uid来维护fileList
|
uid: extraFile.id, //upload 组件需要uid来维护fileList
|
||||||
|
|
|
||||||
|
|
@ -175,6 +175,19 @@ export default function render(props: WebComponentProps<EntityDict, 'address', t
|
||||||
Reset
|
Reset
|
||||||
</Button>
|
</Button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
|
||||||
|
<Tooltip title="查看OakIcon">
|
||||||
|
<Button
|
||||||
|
size="large"
|
||||||
|
type="primary"
|
||||||
|
shape="circle"
|
||||||
|
onClick={() => {
|
||||||
|
window.open('/icon')
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Icon
|
||||||
|
</Button>
|
||||||
|
</Tooltip>
|
||||||
</Space>
|
</Space>
|
||||||
</Drawer>
|
</Drawer>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"navigationBarTitleText": "OakIcon示例",
|
||||||
|
"usingComponents": {}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
|
||||||
|
|
||||||
|
.page-body {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
|
||||||
|
export default OakComponent({
|
||||||
|
isList: true,
|
||||||
|
methods: {
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
<!-- index.wxml -->
|
||||||
|
<view class="page-body">
|
||||||
|
未实现
|
||||||
|
</view>
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
.container {
|
||||||
|
height: 100vh;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
background-color: var(--oak-bg-color-page);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
import React, { useState } from 'react';
|
||||||
|
import { List, Button, Avatar, Input, Drawer } from 'antd';
|
||||||
|
import { EntityDict } from '../../general-app-domain';
|
||||||
|
import { WebComponentProps } from 'oak-frontend-base';
|
||||||
|
|
||||||
|
import Style from './web.module.less';
|
||||||
|
|
||||||
|
|
||||||
|
export default function Render(
|
||||||
|
props: WebComponentProps<EntityDict, 'token', true, {}, {}>
|
||||||
|
) {
|
||||||
|
return <div className={Style.container}>
|
||||||
|
1122
|
||||||
|
</div>;
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue