@steedos-widgets/amis-object 6.10.17 → 6.10.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/amis-object.umd.css +12 -0
- package/dist/amis-object.umd.js +5 -5
- package/dist/amis-object.umd.js.map +1 -1
- package/dist/assets-dev.json +0 -56
- package/dist/assets.json +5 -61
- package/package.json +3 -3
package/dist/amis-object.umd.css
CHANGED
|
@@ -3274,6 +3274,18 @@ steedosfieldset.antd-Collapse .antd-Collapse-header.is-mobile:hover {
|
|
|
3274
3274
|
max-width: 90px;
|
|
3275
3275
|
max-height: 60px;
|
|
3276
3276
|
}
|
|
3277
|
+
.instance-applicant-view .antd-Picker .antd-Picker-valueIcon {
|
|
3278
|
+
display: none;
|
|
3279
|
+
border: none;
|
|
3280
|
+
}
|
|
3281
|
+
.instance-applicant-view .antd-Picker .antd-Picker-value {
|
|
3282
|
+
color: inherit;
|
|
3283
|
+
background: transparent;
|
|
3284
|
+
border: none;
|
|
3285
|
+
}
|
|
3286
|
+
.instance-applicant-view .antd-Picker .antd-Picker-btn {
|
|
3287
|
+
display: none;
|
|
3288
|
+
}
|
|
3277
3289
|
|
|
3278
3290
|
.steedos-input-table .steedos-delete-button:hover {
|
|
3279
3291
|
color: rgb(239 68 68) !important;
|
package/dist/amis-object.umd.js
CHANGED
|
@@ -352,7 +352,7 @@ findOneOptions={filters:[],queryOptions:"top: 1"};}_t161=getApi$2()+'&objectName
|
|
|
352
352
|
*/function getScriptForRewriteValueForFileFields(fields){var fileFieldsKeys=[];var fileFields={};fields.forEach(function(item){if(item.type==='file'){fileFieldsKeys.push(item.name);fileFields[item.name]={name:item.name,multiple:item.multiple};}});if(!fileFieldsKeys.length){return'';}return"\n // file\u5B57\u6BB5\u503C\u91CD\u5199\u4EE5\u4FBF\u7F16\u8F91\u65F6\u6B63\u5E38\u663E\u793A\u9644\u4EF6\u540D\u3001\u70B9\u51FB\u9644\u4EF6\u540D\u6B63\u5E38\u4E0B\u8F7D\u9644\u4EF6\n let fileFieldsKeys = ".concat(JSON.stringify(fileFieldsKeys),";\n let fileFields = ").concat(JSON.stringify(fileFields),";\n fileFieldsKeys.forEach((item)=>{\n let fileFieldValue = data[item];\n let fileFieldDisplayValue = data._display && data._display[item];\n if(fileFieldValue && fileFieldValue.length){\n if(fileFields[item].multiple){\n if(fileFieldDisplayValue instanceof Array){\n data[item] = fileFieldDisplayValue.map((item, index)=>{ \n item.value = fileFieldValue[index];\n return {\n value: fileFieldValue[index],\n name: item.name,\n url: item.url,\n state: \"uploaded\"\n }\n });\n }\n }else{\n fileFieldDisplayValue.value = fileFieldValue;\n data[item] = [{\n value: fileFieldValue,\n name: fileFieldDisplayValue.name,\n url: fileFieldDisplayValue.url,\n state: \"uploaded\"\n }];\n }\n }\n })\n ");}function getEditFormInitApi(_x51,_x52,_x53,_x54){return _getEditFormInitApi.apply(this,arguments);}function _getEditFormInitApi(){_getEditFormInitApi=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee77(object,recordId,fields,options){var data;return _regenerator().w(function(_context77){while(1)switch(_context77.n){case 0:_context77.n=1;return getFindOneQuery$1(object,recordId,fields);case 1:data=_context77.v;data.recordId="${recordId}";data.objectName="${objectName}";data.uiSchema="${uiSchema}";data.global="${global}";data.context="${context}";data.defaultData="${defaultData}";data._master="${_master}";return _context77.a(2,{method:"post",url:getApi$2(),// sendOn: "!!this.recordId",
|
|
353
353
|
cache:API_CACHE,requestAdaptor:"\n // \u6240\u6709\u4E0D\u60F3\u5728network\u8BF7\u6C42\u4E2D\u53D1\u9001\u7684\u6570\u636E\u90FD\u5E94\u8BE5\u4ECEdata\u4E2D\u5206\u79BB\u51FA\u6765\uFF0Cdata\u53D8\u91CF\u53EA\u9700\u8981\u7559\u4E0Bquery\u624D\u9700\u8981\u53D1\u9001\u51FA\u53BB\n var { recordId, objectName, uiSchema, global, context, _master, ...data} = api.data;\n if(!recordId){\n // \u65B0\u5EFA\u5219\u4E0D\u8BF7\u6C42\u4EFB\u4F55\u6570\u636E\n data.query = \"{data:\" + objectName + \"(filters: \" + JSON.stringify([\"_id\", \"=\", null]) + \", top: 1){_id}}\";\n }\n api.data = data;\n ".concat(options.initApiRequestAdaptor||'',"\n return api;\n "),adaptor:"\n const recordId = api.body.recordId;\n let initialValues={};\n if(recordId && payload.data.data){\n var data = payload.data.data[0];\n const dataKeys = _.keys(data);\n const uiSchema = api.body.uiSchema;\n const fieldKeys = uiSchema && _.keys(uiSchema.fields);\n\n if(data){\n ".concat(getScriptForAddUrlPrefixForImgFields(fields,false),"\n ").concat(getScriptForRewriteValueForFileFields(fields),"\n\n _.each(dataKeys, function(key){\n if(fieldKeys.indexOf(key)<0 && key !== \"_display\"){\n delete data[key];\n }\n })\n \n //\u521D\u59CB\u5316\u63A5\u53E3\u8FD4\u56DE\u7684\u5B57\u6BB5\u79FB\u9664\u5B57\u6BB5\u503C\u4E3Anull\u7684\u5B57\u6BB5\n for (key in data){\n if(data[key] === null){\n delete data[key];\n }\n }\n };\n initialValues = data;\n }\n else{\n var uiSchema = api.body.uiSchema;\n var defaultData = api.body.defaultData;\n var defaultValues = {};\n _.each(uiSchema && uiSchema.fields, function(field){\n var value = SteedosUI.getFieldDefaultValue(field, api.body.global);\n if(!_.isNil(value)){\n defaultValues[field.name] = value;\n }\n });\n if(defaultData && _.isObject(defaultData) && !_.isArray(defaultData)){\n defaultValues = Object.assign({}, defaultValues, defaultData)\n }\n if(uiSchema.form){\n try{\n var objectFormConfig = JSON.parse(uiSchema.form);\n var formInitialValuesFun = objectFormConfig.initialValues;\n if(formInitialValuesFun){\n formInitialValuesFun = new Function(\"return \" + formInitialValuesFun)();\n }\n if(typeof formInitialValuesFun === \"function\"){\n initialValues = formInitialValuesFun.apply({doc: defaultValues || {} , global: api.body.global, master: api.body._master })\n }\n }\n catch(ex){\n console.warn(ex);\n }\n }\n if(_.isObject(initialValues)){\n // uiSchema.form.initialValues\u4E3A\u51FD\u6570\u4E14\u6267\u884C\u540E\u4E3Ajson\uFF0C\u5219\u4F18\u5148\u53D6initialValues\u4E2D\u7684\u9ED8\u8BA4\u503C\n initialValues = Object.assign({}, defaultValues, initialValues);\n }\n else{\n initialValues = defaultValues;\n }\n }\n // data\u4E0B\u7684\u53D8\u91CF\u9700\u8981\u5728\u4FDD\u5B58\u63A5\u53E3\uFF08getSaveApi\uFF09\u4E2D\u88AB\u5220\u9664\u3002\n payload.data = {\n ...initialValues\n }\n ").concat(options.initApiAdaptor||'',"\n // console.log('getEditFormInitApi======>', payload);\n return payload;\n "),responseData:{"&":"$$",editFormInited:true},data:data,headers:{Authorization:"Bearer ${context.tenantId},${context.authToken}"}});}},_callee77);}));return _getEditFormInitApi.apply(this,arguments);}function getSaveApi(object,recordId,fields,options){return{method:'post',url:getApi$2(),data:getSaveQuery(object,recordId),requestAdaptor:getSaveRequestAdaptor(fields,options),responseData:{"recordId":"${record._id}"},adaptor:"\n if(payload.errors){\n delete payload.data;\n payload.status = 2;\n payload.msg = window.t ? window.t(payload.errors[0].message) : payload.errors[0].message;\n }\n ".concat(options.apiAdaptor||'',"\n return payload;\n "),headers:{Authorization:"Bearer ${context.tenantId},${context.authToken}"}};}function getBatchDelete(objectName){return{method:'post',url:getApi$2(),adaptor:"\n if(payload.errors){\n payload.data.deleteErrorMessage = [];\n payload.errors.forEach(function(error){\n try {\n let errorRecord = error.path.map(function (item) {\n return item.split('delete__')[1].to_float() + 1;\n }).toString();\n payload.data.deleteErrorMessage.push(\"\u7B2C\" + errorRecord + \"\u6761\u8BB0\u5F55\u5220\u9664\u51FA\u73B0\u5F02\u5E38\uFF0C\u62A5\u9519\u4FE1\u606F\u4E3A(\" + (window.t ? window.t(error.message) : error.message) + \")\");\n } catch (error) {\n console.llg(error)\n }\n })\n }\n return payload;\n ",requestAdaptor:"\n var ids = api.data.ids.split(\",\");\n var deleteArray = [];\n ids.forEach((id,index)=>{\n deleteArray.push(`delete__${index}:".concat(objectName,"__delete(id: \"${id}\")`);\n })\n api.data = {query: `mutation{${deleteArray.join(',')}}`};\n return api;\n "),data:{ids:"${ids}"},headers:{Authorization:"Bearer ${context.tenantId},${context.authToken}"}};}var DEFAULT_CALENDAR_OPTIONS={startDateExpr:"start",endDateExpr:"end",allDayExpr:"is_all_day",textExpr:"name"};function getCalendarApi(_x55,_x56,_x57){return _getCalendarApi.apply(this,arguments);}function _getCalendarApi(){_getCalendarApi=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee78(mainObject,fields,options){var calendarOptions,searchableFields,_options3,filter,sort,top,_options3$setDataToCo,setDataToComponentId,idFieldName,valueField,api;return _regenerator().w(function(_context78){while(1)switch(_context78.n){case 0:if(!options){options={};}calendarOptions=options.calendarOptions;searchableFields=[];_options3=options,filter=_options3.filter,sort=_options3.sort,top=_options3.top,_options3$setDataToCo=_options3.setDataToComponentId,setDataToComponentId=_options3$setDataToCo===void 0?'':_options3$setDataToCo;if(!top){// 日历请求不翻页
|
|
354
354
|
top=200;}if(_$1__default["default"].isArray(filter)){filter=_$1__default["default"].map(filter,function(item){if(item.operation){return[item.field,item.operation,item.value];}else{return item;}});}if(!filter){filter=[];}_$1__default["default"].each(fields,function(field){if(field.searchable){searchableFields.push(field.name);}});idFieldName=mainObject.idFieldName||"_id";valueField=mainObject.key_field||'_id';_context78.n=1;return getApi$1(mainObject,null,fields,{alias:'rows',limit:top,queryOptions:"filters: {__filters}, top: {__top}, skip: {__skip}, sort: \"{__sort}\""});case 1:api=_context78.v;api.data.$term="$term";api.data.$self="$$";api.data.filter="$filter";api.data.pageSize=top||10;api.requestAdaptor="\n let selfData = JSON.parse(JSON.stringify(api.data.$self));\n var filters = api.data.filter || ".concat(JSON.stringify(filter)," || [];\n const eventFetchInfo = selfData.fetchInfo;\n const startDateExpr = \"").concat(calendarOptions.startDateExpr,"\";\n const endDateExpr = \"").concat(calendarOptions.endDateExpr,"\";\n const eventDurationFilters = [[endDateExpr, \">=\", eventFetchInfo.start], [startDateExpr, \"<=\", eventFetchInfo.end]];\n if(_.isEmpty(filters)){\n filters = eventDurationFilters;\n }else{\n filters = [filters, 'and', eventDurationFilters]\n }\n\n if(api.data.$self.additionalFilters){\n filters.push(api.data.$self.additionalFilters)\n }else if(api.data.$self.event.data.additionalFilters){\n filters.push(api.data.$self.event.data.additionalFilters)\n }\n\n var pageSize = api.data.pageSize || 10;\n var pageNo = api.data.pageNo || 1;\n var skip = (pageNo - 1) * pageSize;\n var orderBy = api.data.orderBy || '';\n var orderDir = api.data.orderDir || '';\n var sort = orderBy + ' ' + orderDir;\n sort = orderBy ? sort : \"").concat(sort,"\";\n var allowSearchFields = ").concat(JSON.stringify(searchableFields),";\n if(api.data.$term){\n filters = [[\"name\", \"contains\", \"'+ api.data.$term +'\"]];\n }else if(selfData.op === 'loadOptions' && selfData.value){\n filters = [[\"").concat(valueField.name,"\", \"=\", selfData.value]];\n }\n var searchableFilter = SteedosUI.getSearchFilter(selfData) || [];\n\n if(searchableFilter.length > 0){\n if(filters.length > 0 ){\n filters = [filters, 'and', searchableFilter];\n }else{\n filters = searchableFilter;\n }\n }\n\n if(allowSearchFields){\n allowSearchFields.forEach(function(key){\n const keyValue = selfData[key];\n if(_.isString(keyValue)){\n filters.push([key, \"contains\", keyValue]);\n }else if(_.isArray(keyValue) || _.isBoolean(keyValue) || keyValue){\n filters.push([key, \"=\", keyValue]);\n }\n })\n }\n\n if(selfData.__keywords && allowSearchFields){\n const keywordsFilters = [];\n allowSearchFields.forEach(function(key, index){\n const keyValue = selfData.__keywords;\n if(keyValue){\n keywordsFilters.push([key, \"contains\", keyValue]);\n if(index < allowSearchFields.length - 1){\n keywordsFilters.push('or');\n }\n }\n })\n filters.push(keywordsFilters);\n }\n api.data.query = api.data.query.replace(/{__filters}/g, JSON.stringify(filters)).replace('{__top}', pageSize).replace('{__skip}', skip).replace('{__sort}', sort.trim());\n delete api.data.$term;\n delete api.data.filter;\n delete api.data.pageSize;\n delete api.data.pageNo;\n delete api.data.orderBy;\n delete api.data.orderDir;\n return api;\n ");api.adaptor="\n window.postMessage(Object.assign({type: \"listview.loaded\"}), \"*\");\n const setDataToComponentId = \"".concat(setDataToComponentId,"\";\n if(setDataToComponentId){\n var scope = SteedosUI.getRef(api.body.$self.scopeId);\n var setDataToComponent = scope && scope.getComponentById(setDataToComponentId);\n if(setDataToComponent){\n setDataToComponent.setData({$count: payload.data.count});\n }\n // SteedosUI.getRef(api.body.$self.scopeId)?.getComponentById(setDataToComponentId)?.setData({$count: payload.data.count})\n }\n const rows = payload.data.rows || [];\n const selfData = api.data.$self;\n const events = rows.map(function(n){\n return {\n id: n[\"").concat(idFieldName,"\"],\n title: n[\"").concat(calendarOptions.textExpr,"\"],\n start: n[\"").concat(calendarOptions.startDateExpr,"\"],\n end: n[\"").concat(calendarOptions.endDateExpr,"\"],\n allDay: n[\"").concat(calendarOptions.allDayExpr,"\"],\n extendedProps: n\n }\n });\n const successCallback = selfData.successCallback;\n const failureCallback = selfData.failureCallback;\n successCallback(events);\n return payload;\n ");return _context78.a(2,api);}},_callee78);}));return _getCalendarApi.apply(this,arguments);}function getCalendarRecordPermissionsApi(mainObject,recordId){var api=getRecordPermissionsApi(mainObject,recordId,{alias:'rows',limit:1,fields:["allowEdit"]});api.data.$self="$$";api.adaptor="\n const rows = payload.data.rows || [];\n const selfData = api.data.$self;\n const revert = selfData.revert;\n const recordPermissions = rows[0] && rows[0].recordPermissions;\n const editable = !!(recordPermissions && recordPermissions.allowEdit);\n if(!editable){\n // \u6CA1\u6709\u6743\u9650\u65F6\u8FD8\u539F\n revert && revert();\n }\n payload.data.editable = editable;\n return payload;\n ";return api;}function getCalendarRecordSaveApi(object,calendarOptions){var formData={};var idFieldName=object.idFieldName||"_id";formData[idFieldName]="${event.data.event.id}";var nameFieldKey=object.NAME_FIELD_KEY||"name";formData[nameFieldKey]="${event.data.event.title}";formData[calendarOptions.startDateExpr]="${event.data.event.start}";formData[calendarOptions.endDateExpr]="${event.data.event.end}";formData[calendarOptions.allDayExpr]="${event.data.event.allDay}";// formData[calendarOptions.textExpr] = "${event.data.event.title}";
|
|
355
|
-
var apiData={objectName:
|
|
355
|
+
var apiData={objectName:object.name,$:formData,$self:"$$"};var saveDataTpl="\n const formData = api.data.$;\n const objectName = ".concat(object.name,"};\n let query = `mutation{record: ${objectName}__update(id: \"${formData.").concat(idFieldName,"}\", doc: {__saveData}){").concat(idFieldName,"}}`;\n delete formData.").concat(idFieldName,";\n let __saveData = JSON.stringify(JSON.stringify(formData));\n ");var requestAdaptor="\n ".concat(saveDataTpl,"\n api.data.query = query.replace('{__saveData}', __saveData);\n return api;\n ");return{method:'post',url:getApi$2(),data:apiData,requestAdaptor:requestAdaptor,adaptor:"\n if(payload.errors){\n payload.status = 2;\n payload.msg = payload.errors[0].message;\n const revert = api.data.$self.event.data.revert;\n revert && revert();\n }\n return payload;\n ",headers:{Authorization:"Bearer ${context.tenantId},${context.authToken}"}};}/**
|
|
356
356
|
* 列表视图Calendar amisSchema
|
|
357
357
|
* @param {*} objectSchema 对象UISchema
|
|
358
358
|
* @returns amisSchema
|
|
@@ -369,7 +369,7 @@ var apiData={objectName:"${objectName}",$:formData,$self:"$$"};var saveDataTpl="
|
|
|
369
369
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
370
370
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
371
371
|
PERFORMANCE OF THIS SOFTWARE.
|
|
372
|
-
***************************************************************************** */function _getObjectCalendar(){_getObjectCalendar=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee79(objectSchema,calendarOptions,options){var permissions,titleFields,fields,sort,sortField,sortOrder,sortStr,initialView,api,onGetEventsScript,onSelectScript,onEventClickScript,recordId,recordPermissionsApi,recordSaveApi,businessHours,onEvent,config,hasReturn,fn,_hasReturn,_fn,amisSchema,_t167;return _regenerator().w(function(_context79){while(1)switch(_context79.n){case 0:permissions=objectSchema.permissions;if(!options){options={};}calendarOptions=Object.assign({},DEFAULT_CALENDAR_OPTIONS,_$1.omitBy(calendarOptions,_$1.isNil));titleFields=calendarOptions.title||[calendarOptions.startDateExpr,calendarOptions.endDateExpr,calendarOptions.allDayExpr,calendarOptions.textExpr];fields=[];_$1.each(titleFields,function(n){if(objectSchema.fields[n]){fields.push(objectSchema.fields[n]);}});if(objectSchema.fields[calendarOptions.allDayExpr]){fields.push(objectSchema.fields[calendarOptions.allDayExpr]);}sort=options.sort;if(!sort){sortField=options.sortField;sortOrder=options.sortOrder;if(sortField){sortStr=sortField+' '+sortOrder||'asc';sort=sortStr;}}initialView=calendarOptions.currentView;if(!initialView){_context79.n=6;break;}_t167=initialView;_context79.n=_t167==="day"?1:_t167==="week"?2:_t167==="month"?3:_t167==="agenda"?4:5;break;case 1:initialView="timeGridDay";return _context79.a(3,5);case 2:initialView="timeGridWeek";return _context79.a(3,5);case 3:initialView="dayGridMonth";return _context79.a(3,5);case 4:initialView="listWeek";return _context79.a(3,5);case 5:_context79.n=7;break;case 6:initialView="timeGridWeek";case 7:options.calendarOptions=calendarOptions;_context79.n=8;return getCalendarApi(objectSchema,fields,options);case 8:api=_context79.v;onGetEventsScript="\n const api = ".concat(JSON.stringify(api),";\n event.data.calendarOptions = ").concat(JSON.stringify(calendarOptions),";\n doAction({\n \"actionType\": 'ajax',\n \"args\": {\n \"api\": api\n },\n });\n ");onSelectScript="\n const data = event.data;\n const doc = {};\n doc[\"".concat(calendarOptions.startDateExpr,"\"] = data.start;\n doc[\"").concat(calendarOptions.endDateExpr,"\"] = data.end;\n doc[\"").concat(calendarOptions.allDayExpr,"\"] = data.allDay;\n doc[\"").concat(calendarOptions.textExpr,"\"] = data.title;\n // ObjectForm\u4F1A\u8BA4\u4F5C\u7528\u57DF\u4E0B\u7684\u53D8\u91CF\u503C\n // TODO: \u5F85\u7EC4\u4EF6\u652F\u6301initValues\u5C5E\u6027\u540E\u5E94\u8BE5\u6539\u6389\uFF0C\u4E0D\u5E94\u8BE5\u901A\u8FC7data\u76F4\u63A5\u4F20\u503C\n // TODO: \u5168\u5929\u4E8B\u4EF6\u5C5E\u6027\u4F20\u5165doc\u4E86\u4F46\u662F\u6CA1\u6709\u751F\u6548\uFF0C\u9700\u8981\u624B\u52A8\u5728ObjectForm\u4E2D\u52FE\u9009\u5168\u5929\u4E8B\u4EF6\n const title = \"").concat(instance.t('frontend_form_new')," ").concat(objectSchema.label,"\";\n doAction(\n {\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": title,\n data,\n \"body\": [\n {\n \"type\": \"steedos-object-form\",\n \"objectApiName\": \"
|
|
372
|
+
***************************************************************************** */function _getObjectCalendar(){_getObjectCalendar=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee79(objectSchema,calendarOptions,options){var permissions,titleFields,fields,sort,sortField,sortOrder,sortStr,initialView,api,onGetEventsScript,onSelectScript,onEventClickScript,recordId,recordPermissionsApi,recordSaveApi,businessHours,onEvent,config,hasReturn,fn,_hasReturn,_fn,amisSchema,_t167;return _regenerator().w(function(_context79){while(1)switch(_context79.n){case 0:permissions=objectSchema.permissions;if(!options){options={};}calendarOptions=Object.assign({},DEFAULT_CALENDAR_OPTIONS,_$1.omitBy(calendarOptions,_$1.isNil));titleFields=calendarOptions.title||[calendarOptions.startDateExpr,calendarOptions.endDateExpr,calendarOptions.allDayExpr,calendarOptions.textExpr];fields=[];_$1.each(titleFields,function(n){if(objectSchema.fields[n]){fields.push(objectSchema.fields[n]);}});if(objectSchema.fields[calendarOptions.allDayExpr]){fields.push(objectSchema.fields[calendarOptions.allDayExpr]);}sort=options.sort;if(!sort){sortField=options.sortField;sortOrder=options.sortOrder;if(sortField){sortStr=sortField+' '+sortOrder||'asc';sort=sortStr;}}initialView=calendarOptions.currentView;if(!initialView){_context79.n=6;break;}_t167=initialView;_context79.n=_t167==="day"?1:_t167==="week"?2:_t167==="month"?3:_t167==="agenda"?4:5;break;case 1:initialView="timeGridDay";return _context79.a(3,5);case 2:initialView="timeGridWeek";return _context79.a(3,5);case 3:initialView="dayGridMonth";return _context79.a(3,5);case 4:initialView="listWeek";return _context79.a(3,5);case 5:_context79.n=7;break;case 6:initialView="timeGridWeek";case 7:options.calendarOptions=calendarOptions;_context79.n=8;return getCalendarApi(objectSchema,fields,options);case 8:api=_context79.v;onGetEventsScript="\n const api = ".concat(JSON.stringify(api),";\n event.data.calendarOptions = ").concat(JSON.stringify(calendarOptions),";\n doAction({\n \"actionType\": 'ajax',\n \"args\": {\n \"api\": api\n },\n });\n ");onSelectScript="\n const data = event.data;\n const doc = {};\n doc[\"".concat(calendarOptions.startDateExpr,"\"] = data.start;\n doc[\"").concat(calendarOptions.endDateExpr,"\"] = data.end;\n doc[\"").concat(calendarOptions.allDayExpr,"\"] = data.allDay;\n doc[\"").concat(calendarOptions.textExpr,"\"] = data.title;\n // ObjectForm\u4F1A\u8BA4\u4F5C\u7528\u57DF\u4E0B\u7684\u53D8\u91CF\u503C\n // TODO: \u5F85\u7EC4\u4EF6\u652F\u6301initValues\u5C5E\u6027\u540E\u5E94\u8BE5\u6539\u6389\uFF0C\u4E0D\u5E94\u8BE5\u901A\u8FC7data\u76F4\u63A5\u4F20\u503C\n // TODO: \u5168\u5929\u4E8B\u4EF6\u5C5E\u6027\u4F20\u5165doc\u4E86\u4F46\u662F\u6CA1\u6709\u751F\u6548\uFF0C\u9700\u8981\u624B\u52A8\u5728ObjectForm\u4E2D\u52FE\u9009\u5168\u5929\u4E8B\u4EF6\n const title = \"").concat(instance.t('frontend_form_new')," ").concat(objectSchema.label,"\";\n doAction(\n {\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": title,\n data,\n \"body\": [\n {\n \"type\": \"steedos-object-form\",\n \"objectApiName\": \"").concat(objectSchema.name,"\",\n \"mode\": \"edit\",\n \"defaultData\": doc,\n //\u6539\u56DE\u4E3A\u901A\u7528\u7684\u63D0\u4EA4\u4E8B\u4EF6\n // \"onEvent\": {\n // \"submitSucc\": {\n // \"weight\": 0,\n // \"actions\": [\n // {\n // \"actionType\": \"custom\",\n // \"script\": \"event.data.view?.calendar.refetchEvents();\"\n // }\n // ]\n // }\n // }\n }\n ],\n \"closeOnEsc\": false,\n \"closeOnOutside\": false,\n \"showCloseButton\": true,\n \"size\": \"lg\"\n }\n });\n ");onEventClickScript="\n const data = event.data;\n const eventData = data.event;\n const appId = data.appId;\n const objectName = data.objectName;\n const eventId = data.event && data.event.id;\n doAction({\n \"actionType\": \"link\",\n \"args\": {\n \"link\": \"/app/\" + appId + \"/\" + objectName + \"/view/\" + eventId\n }\n });\n // doAction({\n // \"actionType\": \"dialog\",\n // \"dialog\": {\n // \"type\": \"dialog\",\n // \"title\": \"\",\n // \"body\": [\n // {\n // \"type\": \"steedos-record-detail\",\n // \"objectApiName\": \"${objectName}\",\n // \"recordId\": data.event && data.event.id\n // }\n // ],\n // \"closeOnEsc\": false,\n // \"closeOnOutside\": false,\n // \"showCloseButton\": true,\n // \"size\": \"lg\",\n // \"actions\": []\n // }\n // });\n ";recordId="${event.id}";recordPermissionsApi=getCalendarRecordPermissionsApi(objectSchema,recordId);recordSaveApi=getCalendarRecordSaveApi(objectSchema,calendarOptions);businessHours={daysOfWeek:[1,2,3,4,5],startTime:'08:00',endTime:'18:00'};if(!_$1.isEmpty(calendarOptions.startDayHour)){businessHours.startTime="".concat(calendarOptions.startDayHour,":00");}if(!_$1.isEmpty(calendarOptions.endDayHour)){businessHours.endTime="".concat(calendarOptions.endDayHour,":00");}// api.trackExpression="\\\${additionalFilters}";
|
|
373
373
|
onEvent={"getEvents":{"weight":0,"actions":[{"componentId":"","args":{},"actionType":"custom","script":onGetEventsScript}// {
|
|
374
374
|
// "actionType": "ajax",
|
|
375
375
|
// "outputVar": "responseResult",
|
|
@@ -393,7 +393,7 @@ onEvent={"getEvents":{"weight":0,"actions":[{"componentId":"","args":{},"actionT
|
|
|
393
393
|
// "link": "/app/${appId}/${objectName}/view/${event.id}"
|
|
394
394
|
// }
|
|
395
395
|
// }
|
|
396
|
-
]},"eventAdd":{"weight":0,"actions":[{"componentId":"","args":{},"actionType":"custom","script":"console.log('eventAdd'); console.log(event);"}]},"eventChange":{"weight":0,"actions":[{"actionType":'ajax',"args":{"api":recordPermissionsApi}},{"actionType":"toast","expression":"!event.data.editable","args":{"msgType":"error","msg":instance.t('frontend_message_no_permission_to_edit'),"position":"top-center"}},{"actionType":'ajax',"expression":"event.data.editable","args":{"api":recordSaveApi,"messages":{"success":objectSchema.label+instance.t('frontend_message_modification_successful'),"failed":objectSchema.label+instance.t('frontend_message_modification_successful')}}}]},"eventRemove":{"weight":0,"actions":[{"componentId":"","args":{},"actionType":"custom","script":"console.log('eventRemove'); console.log(event);"}]},"eventsSet":{"weight":0,"actions":[{"componentId":"","args":{},"actionType":"custom","script":"console.log('eventsSet'); console.log(event);"}]},"
|
|
396
|
+
]},"eventAdd":{"weight":0,"actions":[{"componentId":"","args":{},"actionType":"custom","script":"console.log('eventAdd'); console.log(event);"}]},"eventChange":{"weight":0,"actions":[{"actionType":'ajax',"args":{"api":recordPermissionsApi}},{"actionType":"toast","expression":"!event.data.editable","args":{"msgType":"error","msg":instance.t('frontend_message_no_permission_to_edit'),"position":"top-center"}},{"actionType":'ajax',"expression":"event.data.editable","args":{"api":recordSaveApi,"messages":{"success":objectSchema.label+instance.t('frontend_message_modification_successful'),"failed":objectSchema.label+instance.t('frontend_message_modification_successful')}}}]},"eventRemove":{"weight":0,"actions":[{"componentId":"","args":{},"actionType":"custom","script":"console.log('eventRemove'); console.log(event);"}]},"eventsSet":{"weight":0,"actions":[{"componentId":"","args":{},"actionType":"custom","script":"console.log('eventsSet'); console.log(event);"}]},"setCalendarApi":{"weight":0,"actions":[{"componentId":"service_".concat(options.id),"args":{"value":{"calendarApi":"${event.data.calendarApi}"}},"actionType":"setValue"}]}};Object.assign(onEvent,options.onEvent);config=options.config||{};if(config.eventContent&&typeof config.eventContent==="string"){hasReturn=/\breturn\b/.test(config.eventContent);if(hasReturn){try{// 如果是包括return语句的字符串,则按函数解析,见 https://fullcalendar.io/docs/content-injection
|
|
397
397
|
fn=new Function("arg",config.eventContent);config.eventContent=fn;}catch(e){console.warn(e);}}}if(config.noEventsContent&&typeof config.noEventsContent==="string"){_hasReturn=/\breturn\b/.test(config.noEventsContent);if(_hasReturn){try{// 如果是包括return语句的字符串,则按函数解析,见 https://fullcalendar.io/docs/content-injection
|
|
398
398
|
_fn=new Function("arg",config.noEventsContent);config.noEventsContent=_fn;}catch(e){console.warn(e);}}}amisSchema=_objectSpread2(_objectSpread2({"type":"steedos-fullcalendar","label":"","id":options.id,"name":"fullcalendar","placeholder":"${additionalFilters}",//用于触发reload
|
|
399
399
|
"editable":permissions.allowEdit,"selectable":permissions.allowCreate,"selectMirror":permissions.allowCreate,"initialView":initialView,"businessHours":businessHours,"views":{listWeek:{buttonText:instance.t('frontend_calendar_listWeek')}}},config),{},{"onEvent":onEvent});return _context79.a(2,amisSchema);}},_callee79);}));return _getObjectCalendar.apply(this,arguments);}var _assign$=function __assign$2(){_assign$=Object.assign||function __assign(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p];}return t;};return _assign$.apply(this,arguments);};typeof SuppressedError==="function"?SuppressedError:function(error,suppressed,message){var e=new Error(message);return e.name="SuppressedError",e.error=error,e.suppressed=suppressed,e;};/**
|
|
@@ -1775,7 +1775,7 @@ style:{borderLeftColor:"#000000",borderTopColor:"#000000",borderRightColor:"#000
|
|
|
1775
1775
|
stepsSchema=[];stepFields=[];fields=[];unGroupFields=[];_$1.each(instance.fields,function(field){if(field.type==="section"){fields.push(field);}else{unGroupFields.push(field);}});if(unGroupFields.length>0){fields=[{type:"section",name:"General",code:"General",fields:unGroupFields}].concat(fields);}_iterator5=_createForOfIteratorHelper(fields);_context44.p=1;_iterator5.s();case 2:if((_step5=_iterator5.n()).done){_context44.n=12;break;}field=_step5.value;if(!(field.type==="section"&&field.fields)){_context44.n=11;break;}stepFields=[];fieldSchema=void 0;_iterator6=_createForOfIteratorHelper(field.fields);_context44.p=3;_iterator6.s();case 4:if((_step6=_iterator6.n()).done){_context44.n=7;break;}childField=_step6.value;_context44.n=5;return getTdInputTpl(childField,true);case 5:fieldSchema=_context44.v;if(fieldSchema.type==="steedos-field"&&fieldSchema.config){if(fieldSchema.config.amis){fieldSchema.config.amis.mode=formMode;}else{fieldSchema.config.amis={mode:formMode};}}else{fieldSchema.mode=formMode;}stepFields.push(fieldSchema);case 6:_context44.n=4;break;case 7:_context44.n=9;break;case 8:_context44.p=8;_t78=_context44.v;_iterator6.e(_t78);case 9:_context44.p=9;_iterator6.f();return _context44.f(9);case 10:stepsSchema.push({"title":field.name,"body":stepFields});case 11:_context44.n=2;break;case 12:_context44.n=14;break;case 13:_context44.p=13;_t79=_context44.v;_iterator5.e(_t79);case 14:_context44.p=14;_iterator5.f();return _context44.f(14);case 15:isReadonlyBox=instance.box!=='inbox'&&instance.box!=='draft';if(isReadonlyBox){// 只读的审批箱中最后一步的保存按钮要隐藏
|
|
1776
1776
|
if(stepsSchema.length==1){stepsSchema[stepsSchema.length-1].actions=[];}else if(stepsSchema.length>1){stepsSchema[stepsSchema.length-1].actions=[{"label":"Prev","type":"button","actionType":"prev"}];}}return _context44.a(2,stepsSchema);}},_callee44,null,[[3,8,9,10],[1,13,14,15]]);}));return function getFormSteps(_x283){return _ref47.apply(this,arguments);};}();var getFormWizardView=/*#__PURE__*/function(){var _ref48=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee45(instance){var wizardMode,formSchema,_t80,_t81,_t82,_t83;return _regenerator().w(function(_context45){while(1)switch(_context45.n){case 0:wizardMode=instance.formVersion.wizard_mode||"vertical";//vertical,horizontal
|
|
1777
1777
|
_t80="instance-form-view-wizard ".concat(wizardMode==="horizontal"?"pt-4":"pt-1"," mt-3");_t81=wizardMode;_context45.n=1;return getFormSteps(instance);case 1:_t82=_context45.v;_t83={"change":{"actions":[{"actionType":"setValue","componentId":"instance_form","args":{"value":"${event.data}"}}]},"finished":{//点最后一步完成按钮触发暂存按钮事件保存数据
|
|
1778
|
-
"actions":[{"actionType":"click","componentId":"u:instance_save"}]}};formSchema={type:"wizard",className:_t80,mode:_t81,steps:_t82,actionFinishLabel:"${'CustomAction.instances.instance_save' | t}",id:"instance_wizard",target:"instance_form","onEvent":_t83};return _context45.a(2,formSchema);}},_callee45);}));return function getFormWizardView(_x284){return _ref48.apply(this,arguments);};}();var getApplicantTableView=/*#__PURE__*/function(){var _ref49=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee46(instance$1){var applicantInput,_t84,_t85;return _regenerator().w(function(_context46){while(1)switch(_context46.n){case 0:applicantInput=null;if(!(instance$1.state==='draft')){_context46.n=2;break;}_t84=Object;_t85={name:"applicant",value:getSteedosAuth().userId,disabled:instance$1.box!=='draft'};_context46.n=1;return lookupToAmis({name:"applicant",label:false,reference_to:"space_users",reference_to_field:'user',multiple:false},false,{});case 1:applicantInput=_t84.assign.call(_t84,_t85,_context46.v);_context46.n=3;break;case 2:applicantInput={label:false,mode:"horizontal",className:"m-none p-none",disabled:true,type:"tpl",tpl:'<div>${applicant_name}</div>',id:"u:2016b04355f4"};case 3:if(applicantInput){if(applicantInput.className){applicantInput.className="".concat(applicantInput.className," inline-left");}else{applicantInput.className="inline-left";}}return _context46.a(2,{type:"table-view",className:"instance-applicant-view",trs:[{background:"#FFFFFF",tds:[{className:"td-title",background:"#FFFFFF",align:"left",width:"50%",colspan:"",body:[{type:"tpl",tpl:"<div class='inline-left'>"+instance.t('frontend_workflow_instances_applicant_name_prefix')+"</div>",id:"u:ee62634201bf"},applicantInput],id:"u:6c24c1bb99c9",style:{padding:"none"}},{className:"td-title",background:"#FFFFFF",align:"left",width:"50%",colspan:"",body:[{type:"tpl",tpl:"<div class='inline-left'>"+instance.t('frontend_workflow_instance_submit_date_prefix')+"</div>",id:"u:6d0a7763d527"},{label:false,mode:"horizontal",className:"m-none p-none inline-left",disabled:true,type:"tpl",inputFormat:"YYYY-MM-DD",valueFormat:"YYYY-MM-DDT00:00:00.000[Z]",tpl:'<div>${submit_date}</div>',id:"u:2016b04355f4"}],id:"u:c8b8214ac931",style:{padding:"none"}}]}],id:"u:047f3669468b",style:{borderLeftStyle:"none",borderTopStyle:"none",borderRightStyle:"none",borderBottomStyle:"none"}});}},_callee46);}));return function getApplicantTableView(_x285){return _ref49.apply(this,arguments);};}();var getApproveButton=/*#__PURE__*/function(){var _ref50=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee47(instance$1,submitEvents){var _t86,_t87,_t88,_t89,_t90,_t91,_t92,_t93;return _regenerator().w(function(_context47){while(1)switch(_context47.n){case 0:if(!(!instance$1.approve||instance$1.box!='inbox'&&instance$1.box!='draft')){_context47.n=1;break;}return _context47.a(2,null);case 1:_t86=instance.t('frontend_workflow_instance_button_sign');_t87={};_context47.n=2;return getApprovalDrawerSchema(instance$1,submitEvents);case 2:_t88=_context47.v;_t89={componentId:"",args:_t87,actionType:"drawer",drawer:_t88};_t90=[_t89];_t91={actions:_t90};_t92={click:_t91};_t93={"approve-button w-14 h-14 rounded-full fixed bottom-4 right-4 shadow-lg text-white text-base text-center font-semibold bg-blue-500 p-0":true,"hidden":instance$1.box==='draft'};return _context47.a(2,{type:"button",label:_t86,onEvent:_t92,id:"steedos-approve-button",level:"primary",className:_t93});}},_callee47);}));return function getApproveButton(_x286,_x287){return _ref50.apply(this,arguments);};}();var getScrollToBottomAutoOpenApproveDrawerScript=function getScrollToBottomAutoOpenApproveDrawerScript(){return"\n (function () {\n setTimeout(function () {\n var bodyEl = document.querySelector('.steedos-instance-detail-wrapper .steedos-amis-instance-view .steedos-amis-instance-view-body');\n if (!bodyEl) return;\n var btn = document.querySelector('.steedos-instance-detail-wrapper .steedos-amis-instance-view .approve-button');\n if (!btn) return;\n\n function isDrawerOpen() {\n var dr = document.querySelector('.amis-dialog-widget.approval-drawer');\n return dr && dr.offsetParent !== null;\n }\n\n var lastAtBottom = false; // \u4E0A\u4E00\u4E2Ascroll\u4E8B\u4EF6\u662F\u5426\u5230\u5E95\n\n function isAtBottom() {\n var scrollTop = bodyEl.scrollTop,\n scrollHeight = bodyEl.scrollHeight,\n clientHeight = bodyEl.clientHeight;\n return (scrollHeight <= clientHeight) || (scrollTop + clientHeight >= scrollHeight - 2);\n }\n\n // wheel: \u53EA\u8981\u73B0\u5728\u5230\u5E95\u3001\u4E14\u662F\u5411\u4E0B\u6EDA\uFF0C\u5373\u53EF\u5F39\u51FA\n bodyEl.addEventListener('wheel', function (e) {\n var atBottom = isAtBottom();\n if (atBottom && e.deltaY > 0 && !isDrawerOpen()) {\n // [wheel] \u62D6\u52A8\u6761\u5728\u5E95\u90E8\u4E14\u5411\u4E0B\u6EDA\uFF0C\u5F39drawer\n btn.click();\n }\n });\n\n // scroll: \u62D6\u52A8\u65F6\u4EC5\u201C\u4ECE\u975E\u5E95\u90E8->\u5E95\u90E8\u201D\u77AC\u95F4\u5F39\n bodyEl.addEventListener('scroll', function () {\n var atBottom = isAtBottom();\n if (!lastAtBottom && atBottom && !isDrawerOpen()) {\n // [scroll] \u62D6\u52A8\u6761\u5230\u5E95\uFF0C\u5F39drawer\n btn.click();\n }\n lastAtBottom = atBottom;\n });\n }, 1000);\n })();\n ";};var getFlowFormSchema=/*#__PURE__*/function(){var _ref51=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee48(instance,box){var _instance$formVersion;var formStyle,formContentSchema,amisSchemaStr,initedEvents,changeEvents,submitEvents,onEvent,_t94,_t95,_t96,_t97,_t98,_t99,_t100,_t101,_t102,_t103,_t104,_t105,_t106,_t107,_t108,_t109,_t110,_t111,_t112,_t113;return _regenerator().w(function(_context48){while(1)switch(_context48.n){case 0:formStyle=instance.formVersion.style||"table";if(!(formStyle==="wizard")){_context48.n=2;break;}_context48.n=1;return getFormWizardView(instance);case 1:formContentSchema=_context48.v;_context48.n=4;break;case 2:_context48.n=3;return getFormTableView(instance);case 3:formContentSchema=_context48.v;case 4:amisSchemaStr=(_instance$formVersion=instance.formVersion)===null||_instance$formVersion===void 0?void 0:_instance$formVersion.amis_schema;initedEvents=[];changeEvents=[];submitEvents=[];if(amisSchemaStr){onEvent=JSON.parse(instance.formVersion.amis_schema).onEvent;initedEvents=(onEvent===null||onEvent===void 0?void 0:onEvent.inited.actions)||[];changeEvents=(onEvent===null||onEvent===void 0?void 0:onEvent.change.actions)||[];submitEvents=(onEvent===null||onEvent===void 0?void 0:onEvent.submit.actions)||[];}// if (box == 'inbox' || box == 'draft') {
|
|
1778
|
+
"actions":[{"actionType":"click","componentId":"u:instance_save"}]}};formSchema={type:"wizard",className:_t80,mode:_t81,steps:_t82,actionFinishLabel:"${'CustomAction.instances.instance_save' | t}",id:"instance_wizard",target:"instance_form","onEvent":_t83};return _context45.a(2,formSchema);}},_callee45);}));return function getFormWizardView(_x284){return _ref48.apply(this,arguments);};}();var getApplicantTableView=/*#__PURE__*/function(){var _ref49=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee46(instance$1){var applicantInput,_t84,_t85;return _regenerator().w(function(_context46){while(1)switch(_context46.n){case 0:applicantInput=null;if(!(instance$1.state==='draft')){_context46.n=2;break;}_t84=Object;_t85={name:"applicant",value:instance$1.applicant||getSteedosAuth().userId,disabled:instance$1.box!=='draft'};_context46.n=1;return lookupToAmis({name:"applicant",label:false,reference_to:"space_users",reference_to_field:'user',multiple:false},false,{});case 1:applicantInput=_t84.assign.call(_t84,_t85,_context46.v);_context46.n=3;break;case 2:applicantInput={label:false,mode:"horizontal",className:"m-none p-none",disabled:true,type:"tpl",tpl:'<div>${applicant_name}</div>',id:"u:2016b04355f4"};case 3:if(applicantInput){if(applicantInput.className){applicantInput.className="".concat(applicantInput.className," inline-left");}else{applicantInput.className="inline-left";}}return _context46.a(2,{type:"table-view",className:"instance-applicant-view",trs:[{background:"#FFFFFF",tds:[{className:"td-title",background:"#FFFFFF",align:"left",width:"50%",colspan:"",body:[{type:"tpl",tpl:"<div class='inline-left'>"+instance.t('frontend_workflow_instances_applicant_name_prefix')+"</div>",id:"u:ee62634201bf"},applicantInput],id:"u:6c24c1bb99c9",style:{padding:"none"}},{className:"td-title",background:"#FFFFFF",align:"left",width:"50%",colspan:"",body:[{type:"tpl",tpl:"<div class='inline-left'>"+instance.t('frontend_workflow_instance_submit_date_prefix')+"</div>",id:"u:6d0a7763d527"},{label:false,mode:"horizontal",className:"m-none p-none inline-left",disabled:true,type:"tpl",inputFormat:"YYYY-MM-DD",valueFormat:"YYYY-MM-DDT00:00:00.000[Z]",tpl:'<div>${submit_date}</div>',id:"u:2016b04355f4"}],id:"u:c8b8214ac931",style:{padding:"none"}}]}],id:"u:047f3669468b",style:{borderLeftStyle:"none",borderTopStyle:"none",borderRightStyle:"none",borderBottomStyle:"none"}});}},_callee46);}));return function getApplicantTableView(_x285){return _ref49.apply(this,arguments);};}();var getApproveButton=/*#__PURE__*/function(){var _ref50=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee47(instance$1,submitEvents){var _t86,_t87,_t88,_t89,_t90,_t91,_t92,_t93;return _regenerator().w(function(_context47){while(1)switch(_context47.n){case 0:if(!(!instance$1.approve||instance$1.box!='inbox'&&instance$1.box!='draft')){_context47.n=1;break;}return _context47.a(2,null);case 1:_t86=instance.t('frontend_workflow_instance_button_sign');_t87={};_context47.n=2;return getApprovalDrawerSchema(instance$1,submitEvents);case 2:_t88=_context47.v;_t89={componentId:"",args:_t87,actionType:"drawer",drawer:_t88};_t90=[_t89];_t91={actions:_t90};_t92={click:_t91};_t93={"approve-button w-14 h-14 rounded-full fixed bottom-4 right-4 shadow-lg text-white text-base text-center font-semibold bg-blue-500 p-0":true,"hidden":instance$1.box==='draft'};return _context47.a(2,{type:"button",label:_t86,onEvent:_t92,id:"steedos-approve-button",level:"primary",className:_t93});}},_callee47);}));return function getApproveButton(_x286,_x287){return _ref50.apply(this,arguments);};}();var getScrollToBottomAutoOpenApproveDrawerScript=function getScrollToBottomAutoOpenApproveDrawerScript(){return"\n (function () {\n setTimeout(function () {\n var bodyEl = document.querySelector('.steedos-instance-detail-wrapper .steedos-amis-instance-view .steedos-amis-instance-view-body');\n if (!bodyEl) return;\n var btn = document.querySelector('.steedos-instance-detail-wrapper .steedos-amis-instance-view .approve-button');\n if (!btn) return;\n\n function isDrawerOpen() {\n var dr = document.querySelector('.amis-dialog-widget.approval-drawer');\n return dr && dr.offsetParent !== null;\n }\n\n var lastAtBottom = false; // \u4E0A\u4E00\u4E2Ascroll\u4E8B\u4EF6\u662F\u5426\u5230\u5E95\n\n function isAtBottom() {\n var scrollTop = bodyEl.scrollTop,\n scrollHeight = bodyEl.scrollHeight,\n clientHeight = bodyEl.clientHeight;\n return (scrollHeight <= clientHeight) || (scrollTop + clientHeight >= scrollHeight - 2);\n }\n\n // wheel: \u53EA\u8981\u73B0\u5728\u5230\u5E95\u3001\u4E14\u662F\u5411\u4E0B\u6EDA\uFF0C\u5373\u53EF\u5F39\u51FA\n bodyEl.addEventListener('wheel', function (e) {\n var atBottom = isAtBottom();\n if (atBottom && e.deltaY > 0 && !isDrawerOpen()) {\n // [wheel] \u62D6\u52A8\u6761\u5728\u5E95\u90E8\u4E14\u5411\u4E0B\u6EDA\uFF0C\u5F39drawer\n btn.click();\n }\n });\n\n // scroll: \u62D6\u52A8\u65F6\u4EC5\u201C\u4ECE\u975E\u5E95\u90E8->\u5E95\u90E8\u201D\u77AC\u95F4\u5F39\n bodyEl.addEventListener('scroll', function () {\n var atBottom = isAtBottom();\n if (!lastAtBottom && atBottom && !isDrawerOpen()) {\n // [scroll] \u62D6\u52A8\u6761\u5230\u5E95\uFF0C\u5F39drawer\n btn.click();\n }\n lastAtBottom = atBottom;\n });\n }, 1000);\n })();\n ";};var getFlowFormSchema=/*#__PURE__*/function(){var _ref51=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee48(instance,box){var _instance$formVersion;var formStyle,formContentSchema,amisSchemaStr,initedEvents,changeEvents,submitEvents,onEvent,_t94,_t95,_t96,_t97,_t98,_t99,_t100,_t101,_t102,_t103,_t104,_t105,_t106,_t107,_t108,_t109,_t110,_t111,_t112,_t113;return _regenerator().w(function(_context48){while(1)switch(_context48.n){case 0:formStyle=instance.formVersion.style||"table";if(!(formStyle==="wizard")){_context48.n=2;break;}_context48.n=1;return getFormWizardView(instance);case 1:formContentSchema=_context48.v;_context48.n=4;break;case 2:_context48.n=3;return getFormTableView(instance);case 3:formContentSchema=_context48.v;case 4:amisSchemaStr=(_instance$formVersion=instance.formVersion)===null||_instance$formVersion===void 0?void 0:_instance$formVersion.amis_schema;initedEvents=[];changeEvents=[];submitEvents=[];if(amisSchemaStr){onEvent=JSON.parse(instance.formVersion.amis_schema).onEvent;initedEvents=(onEvent===null||onEvent===void 0?void 0:onEvent.inited.actions)||[];changeEvents=(onEvent===null||onEvent===void 0?void 0:onEvent.change.actions)||[];submitEvents=(onEvent===null||onEvent===void 0?void 0:onEvent.submit.actions)||[];}// if (box == 'inbox' || box == 'draft') {
|
|
1779
1779
|
// TODO: 临时去掉 AutoOpenApproveDrawer 功能因为测试到性能问题
|
|
1780
1780
|
if((box=='inbox'||box=='draft')&&window.enableAutoOpenApproveDrawer){// 滚动条滚动到底部弹出底部签批drawer窗口
|
|
1781
1781
|
initedEvents.push({"actionType":"custom","script":getScrollToBottomAutoOpenApproveDrawerScript(),"args":{}});}_t94="steedos-amis-instance-view sm:rounded "+"steedos-instance-style-"+formStyle;_t95={"type":"steedos-record-detail-header","label":"标题面板","objectApiName":"instances","recordId":instance._id,"id":"u:e6b2adbe0e21","showRecordTitle":false,"className":"p-0 m-0 p0 m0 bg-gray-50 sm:rounded-tl sm:rounded-tr"};_t96={".steedos-amis-instance-view-body":{"height":"calc(100% - 65px)"},".instance-approve-history .antd-Table-table thead":{"display":"none"},".instance-approve-history .antd-Table-heading":{"font-size":"14px","font-weight":"500","padding-left":"0px"},".antd-List-heading":{"font-size":"14px","font-weight":"500"},".steedos-object-record-detail-header .antd-Grid-col--mdAuto":{"padding":"0px !important"},".antd-List-placeholder":{"display":"none"},".steedos-amis-instance-view .antd-Table-fixedTop":{"top":"-13px"},".steedos-amis-instance-view .antd-Table-fixedTop:after":{"box-shadow":"none"},".antd-List-items":{"border":'0px'},".antd-ListItem":{"border-top":"0px !important","background":"transparent !important"}};_context48.n=5;return getAttachments(instance);case 5:_t97=_context48.v;_context48.n=6;return getRelatedInstances();case 6:_t98=_context48.v;_context48.n=7;return getRelatedRecords(instance);case 7:_t99=_context48.v;_t100={type:"tpl",id:"u:f5bb0ad602a6",tpl:"<div class=\"instance-name\">".concat(instance.title,"</div>"),inline:true,wrapperComponent:"",style:{fontFamily:"",fontSize:12,textAlign:"center"}};_t101=formContentSchema;_context48.n=8;return getApplicantTableView(instance);case 8:_t102=_context48.v;_t103=[_t100,_t101,_t102];_t104={// validateError: {
|
|
@@ -2795,7 +2795,7 @@ ctx=_$1.pickBy(ctx,function(value){return value!==undefined;});return[4/*yield*/
|
|
|
2795
2795
|
amisSchema.className="steedos-object-table ".concat(uiSchema.enable_tree?"is-steedos-tree-table":""," ").concat(amisSchema.className," h-full flex flex-col ").concat(className);// amisSchema.objectApiName = objectApiName;//设计器中切换对象时画布中显示的列未同步变更
|
|
2796
2796
|
// console.timeEnd('AmisObjectTable')
|
|
2797
2797
|
// console.log(`AmisObjectTable=====>`, props, amisSchema)
|
|
2798
|
-
return[2/*return*/,amisSchema];}});});};var AmisObjectCalendar=function AmisObjectCalendar(props){return __awaiter(void 0,void 0,void 0,function(){var top,sort,filters,filtersFunction,title,currentView,startDateExpr,endDateExpr,allDayExpr,textExpr,data,defaultData,_a,className,onEvent,config,objectApiName,amisSchemaData,id,schema,uiSchema,amisSchema,serviceData;var _b;return __generator(this,function(_c){switch(_c.label){case 0:console.log("AmisObjectCalendar props",props);props.$schema,top=props.top,sort=props.sort,filters=props.filters,filtersFunction=props.filtersFunction,title=props.title,currentView=props.currentView,startDateExpr=props.startDateExpr,endDateExpr=props.endDateExpr,allDayExpr=props.allDayExpr,textExpr=props.textExpr,data=props.data,defaultData=props.defaultData,_a=props.className,className=_a===void 0?"":_a,onEvent=props.onEvent,config=props.config;objectApiName=props.objectApiName||"events";amisSchemaData=Object.assign({},data,defaultData);id=props.id||"steedos_object_calendar_".concat(objectApiName);return[4/*yield*/,getCalendarSchema(amisSchemaData.appId,objectApiName,{title:title,currentView:currentView,startDateExpr:startDateExpr,endDateExpr:endDateExpr,allDayExpr:allDayExpr,textExpr:textExpr},{top:top,sort:sort,filter:filters,filtersFunction:filtersFunction,onEvent:onEvent,config:config,id:id})];case 1:schema=_c.sent();uiSchema=schema.uiSchema;amisSchema=schema.amisSchema;serviceData=Object.assign({},{objectName:objectApiName,uiSchema:uiSchema});return[2/*return*/,{"type":"service","body":amisSchema,"id":"service_".concat(id),"className":"".concat(className),"data":serviceData,"onEvent":(_b={},_b["@data.changed.".concat(objectApiName)]={"actions":[{"actionType":"custom","script":"context.props.data.
|
|
2798
|
+
return[2/*return*/,amisSchema];}});});};var AmisObjectCalendar=function AmisObjectCalendar(props){return __awaiter(void 0,void 0,void 0,function(){var top,sort,filters,filtersFunction,title,currentView,startDateExpr,endDateExpr,allDayExpr,textExpr,data,defaultData,_a,className,onEvent,config,objectApiName,amisSchemaData,id,schema,uiSchema,amisSchema,serviceData;var _b;return __generator(this,function(_c){switch(_c.label){case 0:console.log("AmisObjectCalendar props",props);props.$schema,top=props.top,sort=props.sort,filters=props.filters,filtersFunction=props.filtersFunction,title=props.title,currentView=props.currentView,startDateExpr=props.startDateExpr,endDateExpr=props.endDateExpr,allDayExpr=props.allDayExpr,textExpr=props.textExpr,data=props.data,defaultData=props.defaultData,_a=props.className,className=_a===void 0?"":_a,onEvent=props.onEvent,config=props.config;objectApiName=props.objectApiName||"events";amisSchemaData=Object.assign({},data,defaultData);id=props.id||"steedos_object_calendar_".concat(objectApiName);return[4/*yield*/,getCalendarSchema(amisSchemaData.appId,objectApiName,{title:title,currentView:currentView,startDateExpr:startDateExpr,endDateExpr:endDateExpr,allDayExpr:allDayExpr,textExpr:textExpr},{top:top,sort:sort,filter:filters,filtersFunction:filtersFunction,onEvent:onEvent,config:config,id:id})];case 1:schema=_c.sent();uiSchema=schema.uiSchema;amisSchema=schema.amisSchema;serviceData=Object.assign({},{objectName:objectApiName,uiSchema:uiSchema});return[2/*return*/,{"type":"service","body":amisSchema,"id":"service_".concat(id),"className":"".concat(className),"data":serviceData,"onEvent":(_b={},_b["@data.changed.".concat(objectApiName)]={"actions":[{"actionType":"custom","script":"context.props.data.calendarApi.refetchEvents()"}]},_b)}];}});});};var AmisRecordDetailHeader=function AmisRecordDetailHeader(props){return __awaiter(void 0,void 0,void 0,function(){var _a,className,schemaFilter,showButtons,showBackButton,defaultOnEvent,recordId,_b,onEvent,_c,showRecordTitle,objectApiName,schema,config,schemaFilterFun,_config,e_1;return __generator(this,function(_d){switch(_d.label){case 0:_a=props.className,className=_a===void 0?'sm:sticky top-0 sm:z-10 p-0 bg-white sm:m-4 sm:shadow sm:rounded':_a,schemaFilter=props.schemaFilter,showButtons=props.showButtons,showBackButton=props.showBackButton;return[4/*yield*/,_getUISchema2(props.objectApiName||"space_users",false)];case 1:_d.sent();defaultOnEvent={};props.$schema,recordId=props.recordId,_b=props.onEvent,onEvent=_b===void 0?defaultOnEvent:_b,_c=props.showRecordTitle,showRecordTitle=_c===void 0?true:_c;objectApiName=props.objectApiName||"space_users";return[4/*yield*/,getRecordDetailHeaderSchema(objectApiName,recordId,{showRecordTitle:showRecordTitle,formFactor:props.data.formFactor,showButtons:showButtons,showBackButton:showBackButton,display:props.data.display,_inDrawer:props.data._inDrawer})];case 2:schema=_d.sent().amisSchema;schema.className+=" "+className;config=Object.assign({},schema,{onEvent:onEvent});if(!(schemaFilter&&typeof schemaFilter==='string'))return[3/*break*/,6];schemaFilterFun=new Function('config','props',schemaFilter);_d.label=3;case 3:_d.trys.push([3,5,,6]);return[4/*yield*/,schemaFilterFun(config,props)];case 4:_config=_d.sent();config=_config||config;return[3/*break*/,6];case 5:e_1=_d.sent();console.warn(e_1);return[3/*break*/,6];case 6:// console.log(`AmisRecordDetailHeader==>`, config)
|
|
2799
2799
|
return[2/*return*/,config];}});});};var AmisRecordDetail=function AmisRecordDetail(props){return __awaiter(void 0,void 0,void 0,function(){var className,$schema,appId,_a,objectApiName,body,showButtons,showBackButton,_reloadKey,schema;return __generator(this,function(_b){switch(_b.label){case 0:className=props.className,$schema=props.$schema,appId=props.appId,_a=props.objectApiName,objectApiName=_a===void 0?"space_users":_a,props.recordId,props.onEvent,props.defaultData,body=props.body,showButtons=props.showButtons,showBackButton=props.showBackButton,_reloadKey=props._reloadKey;return[4/*yield*/,getRecordDetailSchema(objectApiName,appId,{showButtons:showButtons,showBackButton:showBackButton,_reloadKey:_reloadKey})];case 1:schema=_b.sent().amisSchema;// 在非记录页组件下全局作用域下无recordId,会导致表单接口sendOn始终为false,无法发起请求。
|
|
2800
2800
|
// let recordDetailData: any = {};
|
|
2801
2801
|
// if(recordId){
|