This commit is contained in:
wenjiarui 2023-08-14 14:57:15 +08:00
parent 9aad79a224
commit 6729e4c78c
4 changed files with 51 additions and 38 deletions

View File

@ -567,7 +567,7 @@ exports.default = OakComponent({
return [2 /*return*/]; return [2 /*return*/];
} }
wx.showLoading({ wx.showLoading({
title: '下载请求中,请耐心等待..', title: '下载请求中...',
}); });
wx.downloadFile({ wx.downloadFile({
url: fileUrl, url: fileUrl,
@ -580,23 +580,29 @@ exports.default = OakComponent({
fileType: extension, fileType: extension,
showMenu: true, showMenu: true,
success: function () { success: function () {
console.log("\u6253\u5F00\u6587\u4EF6\u6210\u529F"); //console.log(`打开文件成功`);
}, },
fail: function (err) { fail: function (res) {
console.log(err); var errMsg = res.errMsg;
if (errMsg.includes('fail filetype not supported')) {
that.setMessage({ that.setMessage({
type: 'error', type: 'error',
content: '打开文件失败', content: '该文件类型不支持打开下载',
});
return;
}
that.setMessage({
type: 'error',
content: '该文件类型打开失败',
}); });
}, },
}); });
}, },
fail: function (res) { fail: function (res) {
console.log(res);
wx.hideLoading(); wx.hideLoading();
that.setMessage({ that.setMessage({
type: 'error', type: 'error',
content: '下载失败', content: '下载文件失败',
}); });
}, },
complete: function (res) { }, complete: function (res) { },

View File

@ -40,6 +40,7 @@ function subscribeMpMessage(messageTypes, haveToAccept, tip) {
case 1: case 1:
result_1 = _a.sent(); result_1 = _a.sent();
rejected = Object.keys(result_1).filter(function (ele) { rejected = Object.keys(result_1).filter(function (ele) {
// 排除errMsg
if (ele === 'errMsg') { if (ele === 'errMsg') {
return false; return false;
} }

View File

@ -6,6 +6,7 @@ var antd_1 = require("antd");
var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less")); var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less"));
var userRelation_1 = tslib_1.__importDefault(require("./userRelation")); var userRelation_1 = tslib_1.__importDefault(require("./userRelation"));
var string_1 = require("oak-domain/lib/utils/string"); var string_1 = require("oak-domain/lib/utils/string");
var icons_1 = require("@ant-design/icons");
function Render(props) { function Render(props) {
var _a = props.data, name = _a.name, isNew = _a.isNew, nickname = _a.nickname, password = _a.password, relations = _a.relations, oakFullpath = _a.oakFullpath, entity = _a.entity, entityId = _a.entityId; var _a = props.data, name = _a.name, isNew = _a.isNew, nickname = _a.nickname, password = _a.password, relations = _a.relations, oakFullpath = _a.oakFullpath, entity = _a.entity, entityId = _a.entityId;
var _b = props.methods, t = _b.t, update = _b.update; var _b = props.methods, t = _b.t, update = _b.update;
@ -22,16 +23,17 @@ function Render(props) {
{ {
required: true, required: true,
}, },
] }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { disabled: true, value: nickname }) }) })) : (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: t('user:attr.password'), name: "password", rules: [ ] }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { disabled: true, value: nickname }) }) })) :
(0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: t('user:attr.password'), name: "password", rules: [
{ {
required: true, required: true,
}, },
] }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { value: password, onChange: function (e) { ] }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input.Password, { value: password, onChange: function (e) {
var strValue = e.target.value; var strValue = e.target.value;
update({ update({
password: strValue, password: strValue,
}); });
}, placeholder: t('placeholder.password') }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: t('auth'), rules: [ }, iconRender: function (visible) { return (visible ? (0, jsx_runtime_1.jsx)(icons_1.EyeTwoTone, {}) : (0, jsx_runtime_1.jsx)(icons_1.EyeInvisibleOutlined, {})); }, placeholder: t('placeholder.password') }) }) })) }), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: t('auth'), rules: [
{ {
required: true, required: true,
}, },

View File

@ -68,7 +68,9 @@ export default function Render(props: WebComponentProps<EntityDict, 'user', fals
value={nickname} value={nickname}
/> />
</> </>
</Form.Item> : <Form.Item </Form.Item> :
<>
<Form.Item
label={t('user:attr.password')} label={t('user:attr.password')}
name="password" name="password"
rules={[ rules={[
@ -91,6 +93,8 @@ export default function Render(props: WebComponentProps<EntityDict, 'user', fals
/> />
</> </>
</Form.Item> </Form.Item>
</>
} }
<Form.Item <Form.Item
label={t('auth')} label={t('auth')}