From 540acddabc14a8fef98cd91035ae6653afb9b765 Mon Sep 17 00:00:00 2001 From: wangting <675591594@qq.com> Date: 星期三, 15 五月 2024 16:37:52 +0800 Subject: [PATCH] 升版action,配置文档 --- Source/ProjectWeb/src/components/actions/RevisionDialog.vue | 285 +++++++++++++++++++++++++++++++ Source/ProjectWeb/src/components/actions/handlers.js | 7 Source/ProjectWeb/src/configDoc/Action/img_del.png | 0 Source/ProjectWeb/src/api/base/actions.js | 8 Source/ProjectWeb/src/configDoc/Action/img_rev.png | 0 Source/ProjectWeb/src/components/actions/base/RevisionAction.js | 102 +++++++++++ Source/ProjectWeb/src/configDoc/Action/img_view.png | 0 Source/ProjectWeb/src/components/actions/AddEditDialog.vue | 20 ++ Source/ProjectWeb/src/configDoc/UI.md | 4 Source/ProjectWeb/src/configDoc/Action.md | 113 +++++++++++- 10 files changed, 526 insertions(+), 13 deletions(-) diff --git a/Source/ProjectWeb/src/api/base/actions.js b/Source/ProjectWeb/src/api/base/actions.js index 68efaba..9f4c25c 100644 --- a/Source/ProjectWeb/src/api/base/actions.js +++ b/Source/ProjectWeb/src/api/base/actions.js @@ -24,3 +24,11 @@ data }) } +// 鍗囩増 +export const upRevision = (data,url,method) => { + return request({ + url: url || '/api/uiDataController/upRevision', + method: method || 'put', + data + }) +} diff --git a/Source/ProjectWeb/src/components/actions/AddEditDialog.vue b/Source/ProjectWeb/src/components/actions/AddEditDialog.vue index 233e001..0ddfd45 100644 --- a/Source/ProjectWeb/src/components/actions/AddEditDialog.vue +++ b/Source/ProjectWeb/src/components/actions/AddEditDialog.vue @@ -241,6 +241,16 @@ if(that.saveCallback){ that.saveCallback(that.type,that.form); } + if (this.paramVOS.saveafterevent) { + let urlobj = parseEventByUrl(this.paramVOS.saveafterevent,null,null,'doAction'); + import(`./${urlobj.jsPath}.js`).then(module => { + module[urlobj.methodName]({ + paramVOS: this.paramVOS, + dataStore: this.dataStore, + sourceData:this.sourceData + }); + }) + } that.dialogClose(); }); }else{ @@ -252,6 +262,16 @@ if(that.saveCallback){ that.saveCallback(that.type,that.form); } + if (this.paramVOS.saveafterevent) { + let urlobj = parseEventByUrl(this.paramVOS.saveafterevent,null,null,'doAction'); + import(`./${urlobj.jsPath}.js`).then(module => { + module[urlobj.methodName]({ + paramVOS: this.paramVOS, + dataStore: this.dataStore, + sourceData:this.sourceData + }); + }) + } that.dialogClose(); }); } diff --git a/Source/ProjectWeb/src/components/actions/RevisionDialog.vue b/Source/ProjectWeb/src/components/actions/RevisionDialog.vue new file mode 100644 index 0000000..f7cfefc --- /dev/null +++ b/Source/ProjectWeb/src/components/actions/RevisionDialog.vue @@ -0,0 +1,285 @@ +<template> + <el-dialog v-dialogDrag + :title="title" + :visible.sync="visible" + :width="width" + :fullscreen="fullscreen" + :append-to-body="true" + top="0" + class="avue-dialog" + :destroy-on-close="true" + @close="dialogClose"> + <basic-form ref="formRef" v-if="paramVOS.form" + :key="'dialog-'+paramVOS.form" + :span="span" + :style="fullscreen?'':'height:'+height" + :isEdit="true" + :formItems="formItems" + :formData="form" + :initValue="paramVOS.initvalue" + :uploadattachment="paramVOS.uploadattachment || false" + @getFormData="getFormData"> + </basic-form> + <ui-view ref="uiViewRef" v-else-if="paramVOS.context" + :key="'RevisionDialog-'+type" + :style="fullscreen?'':'height:'+height" + :btmType="paramVOS.type" + :context="paramVOS.context" + :inDialog="true" + :canEdit="true" + :actionType="type" + :sourceData="sourceData" + :dataStore="dataStore" + :paramVOS="paramVOS" + @getFormData="getFormData" + ></ui-view> + <div v-if="showSave" class="dialog-footer avue-dialog__footer"> + <el-button type="primary" plain size="small" @click="formSave" v-if="paramVOS.form">淇� 瀛�</el-button> + <el-button type="primary" plain size="small" @click="contextSave" v-else>淇� 瀛�</el-button> + <el-button size="small" @click="dialogClose">鍙� 娑�</el-button> + <el-button size="small" @click="resetValue" v-if="paramVOS.form">閲� 缃�</el-button> + </div> + </el-dialog> +</template> + +<script> +import uiView from "@/views/base/UIContentViewerInDialog" +import {parseEventByUrl} from "@/components/actions/base/BaseAction" +import {getFormDefineById,dataForm} from "@/api/base/ui"; +import {upRevision} from "@/api/base/actions" +import {validatenull} from "@/util/validate" + +export default { + name: "RevisionDialog", + components:{uiView}, + props: { + sourceData: { + //鎵�灞炲尯鍩熺殑涓婁竴鍖哄煙閫変腑鏁版嵁 + type: Object, + default: {} + }, + dataStore: { + //寮圭獥鏃舵寜閽墍灞炲尯鍩熼�変腑鏁版嵁 + type: Array, + default: [] + }, + paramVOS: { + type: Object, + default: {} + } + }, + data(){ + return { + type:"add", + visible:false, + showSave:this.paramVOS.customBtn || true, + span:12, + formItems:[], + form:{}, + btmDefaultKeys : ['oid', 'id', 'name', 'description', 'revisionoid', 'nameoid', 'btmname', 'lastr', 'firstr', 'lastv', 'firstv', 'creator', 'createtime', 'lastModifier', 'lastmodifytime', 'revisionrule', 'revisionseq', 'revisionvalue', 'versionrule', 'versionseq', 'versionvalue', 'lcstatus', 'ts', 'owner', 'checkinby', 'checkintime', 'checkoutby', 'checkouttime', 'copyfromversion', 'secretgrade'], + linkDefaultKeys :['oid','creator','createtime','lastmodifier','lastmodifytime','f_oid','foid','f_revisionoid','frevisionoid','f_nameoid','fnameoid','f_btmname','fbtmname','t_oid','toid','t_revisionoid','trevisionoid','t_nameoid','tnameoid','t_btmname','tbtmname','ts'] + + } + }, + computed:{ + title(){ + return this.paramVOS.title || "鍗囩増" + }, + width() { + if (!validatenull(this.paramVOS.width)) { + if (this.paramVOS.width.includes("px") || this.paramVOS.width.includes("%")) { + return this.paramVOS.width; + } else { + return this.paramVOS.width + "px"; + } + } else { + return "60%"; + } + }, + height(){ + if (!validatenull(this.paramVOS.height)) { + if (this.paramVOS.height.includes("px") || this.paramVOS.height.includes("%")) { + return this.paramVOS.height; + } else { + return this.paramVOS.height + "px"; + } + } else { + return "auto" + } + }, + fullscreen(){ + if(this.paramVOS.width || this.paramVOS.height){ + return false; + }else if(this.paramVOS.form){ + return false; + } + return true; + } + }, + created() { + }, + watch: { + paramVOS: { + handler(val) { + if (this.paramVOS.form) { + this.onLoad(); + } + }, + deep: true, + immediate: true + }, + }, + methods: { + dialogClose() { + this.visible = false; + }, + onLoad: function () { + if (Object.keys(this.sourceData).length > 0) { + this.loading = true; + getFormDefineById(this.paramVOS.type,this.paramVOS.form).then(result => { + this.formItems=result.data.obj.items; + this.span=result.data.obj.columnOneRow?(24/result.data.obj.columnOneRow) : 12; + if (this.paramVOS.initvalue) { + this.form=this.paramVOS.initvalue; + } + //鍔犺浇琛ㄥ崟鏁版嵁 + let sourceDataMap = {}; + for (let i in this.sourceData) { + const item = this.sourceData[i] + if (item.constructor === Object) return; + sourceDataMap['sourceData["' + i + '"]'] = item; + } + dataForm(Object.assign({ + btmname: this.paramVOS.type, + formDefineId: this.paramVOS.form, + oid: this.dataStore[0].oid + }, sourceDataMap), this.paramVOS.getdataurl, this.paramVOS.getdatamethod).then(res => { + this.form=res.data.obj; + this.loading = false; + }).catch(error => { + this.$message.error(error); + this.loading = false; + }) + }).catch(error => { + this.$message.error(error); + this.loading = false; + }); + + } + }, + contextSave(){ + const useDataType=this.paramVOS["useDataType"] || "form";//浣跨敤ui涓婁笅鏂囦腑鐨勫摢涓被鍨嬫暟鎹紝榛樿form銆傚�硷細form銆乼ree銆乼able銆乀reeTable + for(let key in this.$refs.uiViewRef.data){ + if(this.$refs.uiViewRef.data[key].type== useDataType){ + this.form=this.$refs.uiViewRef.data[key].data; + this.formDefineId=this.$refs.uiViewRef.data[key].DefineVO.id; + if (this.paramVOS.savebeforeevent) { + var urlobj = parseEventByUrl(this.paramVOS.savebeforeevent,null,null,'doAction'); + import(`./${urlobj.jsPath}.js`).then(module => { + module[urlobj.methodName]({ + paramVOS: this.paramVOS, + dataStore: this.dataStore, + sourceData:this.sourceData + },this.formSaveHandle); + }) + } else { + this.formSaveHandle(); + } + return; + } + } + }, + formSave() { + let that=this; + this.$refs.formRef.validate((valid, done) => { + if (valid) { + this.formDefineId=this.paramVOS.form; + if (this.paramVOS.savebeforeevent) { + var urlobj = parseEventByUrl(this.paramVOS.savebeforeevent,null,null,'doAction'); + import(`./${urlobj.jsPath}.js`).then(module => { + module[urlobj.methodName]({ + paramVOS: this.paramVOS, + dataStore: this.dataStore, + sourceData:this.sourceData + },that.formSaveHandle); + }) + } else { + that.formSaveHandle(); + } + } else { + return false; + } + }); + }, + formSaveHandle(){ + let that=this; + let formValues = this.getValues(); + if(formValues.otherValue.releaseFileOids){ + formValues.otherValue.releaseFileOids=formValues.otherValue.releaseFileOids.split(','); + } + if (!formValues.defaultValues.btmname) { + formValues.defaultValues.btmname = this.paramVOS.type; + } + let datas = { + formDefineId: this.formDefineId, + upVersion:paramVOS.upversion, + preEvent: this.paramVOS.preevent, + afterEvent: this.paramVOS.afterevent, + beforeServerEvent: this.paramVOS.beforeserverevent, + afterServerEvent: this.paramVOS.afterserverevent, + releaseFileOids: formValues.otherValue.releaseFileOids||[], + data: formValues.otherValue + } + Object.assign(datas, formValues.defaultValues); + datas['copyfromversion']=formValues.defaultValues.oid; + datas.oid=undefined; + upRevision(datas,that.paramVOS.url,that.paramVOS.method).then(() => { + that.$message({ + type: "success", + message: that.paramVOS.successmsg||"鍗囩増鎴愬姛!" + }); + if(that.saveCallback){ + that.saveCallback(that.form); + } + if (this.paramVOS.saveafterevent) { + let urlobj = parseEventByUrl(this.paramVOS.saveafterevent,null,null,'doAction'); + import(`./${urlobj.jsPath}.js`).then(module => { + module[urlobj.methodName]({ + paramVOS: this.paramVOS, + dataStore: this.dataStore, + sourceData:this.sourceData + }); + }) + } + that.dialogClose(); + }); + }, + getValues(){ + let defaultValues = {}, otherValue = {}; + for (var key in this.form) { + if (this.btmDefaultKeys.indexOf(key.toLowerCase()) > -1) { + defaultValues[key] = this.form[key]; + } else { + otherValue[key] = this.form[key]; + } + } + return { + defaultValues:defaultValues, + otherValue:otherValue + } + }, + resetValue() { + if (this.paramVOS.form) { + this.$refs.formRef.resetFields(); + } + }, + getFormData(form) { + this.form = form; + } + } +} +</script> + +<style scoped> + +</style> diff --git a/Source/ProjectWeb/src/components/actions/base/RevisionAction.js b/Source/ProjectWeb/src/components/actions/base/RevisionAction.js new file mode 100644 index 0000000..9017221 --- /dev/null +++ b/Source/ProjectWeb/src/components/actions/base/RevisionAction.js @@ -0,0 +1,102 @@ +/** + * 鎸夐挳澶勭悊 涓氬姟绫诲瀷鍗囩骇鐗堟湰 + */ +import {paramLow,callPreEvent,callPostEvent} from './BaseAction'; +import {validatenull} from "@/util/validate"; +import Vue from "vue"; +import RevisionDialog from "@/components/actions/RevisionDialog"; + +export const doAction = (options,callback) => { + const paramVOS = Object.assign({ + getdataurl: '/api/uiDataController/dataFormQuery', + getdatamethod: 'post', + url: '/api/uiDataController/upRevision', + method: 'put', + uploadfileurl: 'vciFileUploadController/uploadFile' + }, options.paramVOS) + options.paramVOS = paramVOS; + + options.sourceData = options.sourceData || {}; + options.dataStore = options.dataStore || []; + if (!options.dataStore || options.dataStore.length < 1) { + Vue.prototype.$message.error("璇烽�夋嫨闇�瑕佸崌鐗堢殑鏁版嵁"); + return false; + } + if (!paramVOS.multi && options.dataStore.length > 1) { + Vue.prototype.$message.error("浠呰兘閫夋嫨涓�鏉℃暟鎹潵鎿嶄綔"); + return false; + } + + if(!validatenull(paramVOS.checknotedit)) { + let notedit = paramVOS.checknotedit.split('&'); + let checknotedit=false; + notedit.forEach((item,i)=>{ + if (options.dataStore[0][item.split('=')[0]] == item.split('=')[1]) { + checknotedit=true; + return false; + } + }) + if (checknotedit) { + Vue.prototype.$message.error(replaceFreeMarker(paramVOS.checknoteditmsg,options.dataStore,{}) || "褰撳墠鏁版嵁涓嶅厑璁稿崌鐗�"); + return false; + } + } + callPreEvent(options, doBefore, function (options) { + doRev(options, function (formData) { + callPostEvent(options, doAfter,'rev', callback); + }); + }); +}; + +/** + * 鎵ц + * @param options 鎸夐挳鐨勯厤缃俊鎭� + * @param callback 鍥炶皟 + */ +export const doRev = (options,callback)=> { + const paramVOS = options.paramVOS; + if (!paramVOS['form'] && !paramVOS['context']) { + Vue.prototype.$message.error("鎸夐挳閰嶇疆涓嶆纭�"); + return false; + } + const dialogConstructor = Vue.extend(RevisionDialog); + let instance = new dialogConstructor(); + instance.sourceData = options.sourceData; + instance.dataStore = options.dataStore; + instance.paramVOS = paramVOS; + + instance.dialogClose = function () { + vm.visible = false; + document.body.removeChild(vm.$el); + instance.$destroy(); + instance = null; + }; + if (callback) { + instance.saveCallback = callback; + } + let vm = instance.$mount(); + document.body.appendChild(vm.$el); + instance.visible = true; +} +/** + * 鍓嶇疆浜嬩欢 + * @param options 鎸夐挳鐨勯厤缃俊鎭� + * @param callback 鍥炶皟 + */ +export const doBefore = (options,callback)=> { + console.log('鎵ц鍗囩増鍓嶇疆浜嬩欢'); + if(callback){ + callback(options); + } +} +/** + * 鍚庣疆浜嬩欢 + * @param options 鎸夐挳鐨勯厤缃俊鎭� + * @param callback 鍥炶皟 + */ +export const doAfter = (options,callback,actionType)=> { + console.log('鎵ц鍗囩増鍚庣疆浜嬩欢'); + if(callback){ + callback(actionType); + } +} diff --git a/Source/ProjectWeb/src/components/actions/handlers.js b/Source/ProjectWeb/src/components/actions/handlers.js index 6380539..9838f82 100644 --- a/Source/ProjectWeb/src/components/actions/handlers.js +++ b/Source/ProjectWeb/src/components/actions/handlers.js @@ -18,10 +18,15 @@ //鍒犻櫎 delete: () => {import("@/components/actions/base/DeleteAction").then(module => { module.doAction(options,callback); - })}, //鍒犻櫎 + })}, + //鍒犻櫎 del: () => {import("@/components/actions/base/DeleteAction").then(module => { module.doAction(options,callback); })}, + //鍗囩増 + rev: () => {import("@/components/actions/base/RevisionAction").then(module => { + module.doAction(options,callback); + })}, }; if (handlers[type]) { handlers[type]() diff --git a/Source/ProjectWeb/src/configDoc/Action.md b/Source/ProjectWeb/src/configDoc/Action.md index 47a5102..78cd428 100644 --- a/Source/ProjectWeb/src/configDoc/Action.md +++ b/Source/ProjectWeb/src/configDoc/Action.md @@ -5,34 +5,123 @@ 鍒涘缓涓氬姟瀵硅薄銆傜紪鍙凤細add锛岀被鍨嬶細涓氬姟绫诲瀷 鍙傛暟鍙湪鍙傛暟鍒楄〃閰嶇疆锛屼篃鍙湪鎸夐挳浣跨敤鏃堕厤缃�傚弬鏁颁俊鎭細 ->* type锛氬垱寤虹晫闈㈢殑涓氬姟绫诲瀷锛屽繀濉� +>* type锛氬繀濉紝鍒涘缓鐣岄潰鐨勪笟鍔$被鍨� >* form锛氭坊鍔犵殑琛ㄥ崟瀵硅薄锛屽繀椤昏閰嶇疆form鎴栬�卌ontext锛屼紭鍏堜娇鐢╢orm >* context锛氬垱寤虹晫闈㈢殑UI涓婁笅鏂囷紝鏈塮orm鍙傛暟鏃惰鍊兼棤鏁堛�傝嫢UI涓婁笅鏂囦粎閰嶆湁琛ㄥ崟灞曠ず锛屽垯娣诲姞寮圭獥浼氶粯璁ゆ湁淇濆瓨鎸夐挳 >* useDataType锛氫娇鐢║I涓婁笅鏂囦腑鐨勫摢涓被鍨嬫暟鎹�,鍊兼湁form銆乼ree銆乼able銆乀reeTable锛屼笉濉椂榛樿涓篺orm ->* initvalue锛氳〃鍗曢璁緑alue锛岄潪蹇呭~銆傛牸寮忕ず渚嬶細rootoid=root.${oid}&rootname=root.${name}&name=${name}銆乻ourceoid=sourceData.${oid}&sourcename=sourceData.${name}&oid=${oid}&name=${name} ->* needselect锛氭槸鍚﹀繀椤婚�夋嫨鏁版嵁锛屼笌initvalue閰嶅悎浣跨敤銆� +>* initValue锛氳〃鍗曢璁緑alue锛岄潪蹇呭~銆傛牸寮忕ず渚嬶細rootoid=root.${oid}&rootname=root.${name}&name=${name}銆乻ourceoid=sourceData.${oid}&sourcename=sourceData.${name}&oid=${oid}&name=${name} +>* needSelect锛氭槸鍚﹀繀椤婚�夋嫨鏁版嵁锛屼笌initvalue閰嶅悎浣跨敤銆� 鍊间负false鏃跺厑璁竔nitvalue瀵瑰簲鐨勫睘鎬у�间负绌恒�� 鍊间负true鎴栬�呮湭閰嶇疆鍙傛暟鍒欏繀椤绘湁涓婁笅鏂囩殑sourceData鎴杁ataStore锛岀敤浠ヤ笌initvalue寤虹珛鏄犲皠鍏崇郴 +>* successMsg锛氭坊鍔犳垚鍔熷悗鎻愮ず锛岄粯璁も�滀繚瀛樻垚鍔熲�� >* url: 鍒涘缓鐣岄潰鐨勪繚瀛樻寜閽姹傝矾寰勶紝榛樿'uiDataController/addSave' ->* method: 鍒涘缓鐣岄潰鐨勪繚瀛樻寜閽姹傝矾寰勭被鍨嬶紝榛樿'post' ->* uploadfileurl: 鏈夋枃浠朵笂浼犳椂鍙厤缃紝榛樿'vciFileUploadController/uploadFile' +>* method: 鍒涘缓鐣岄潰鐨勪繚瀛樻寜閽姹俶ethod锛岄粯璁�'post' +>* uploadFileUrl: 鏈夋枃浠朵笂浼犳椂鍙厤缃紝榛樿'vciFileUploadController/uploadFile' >* accept锛氭湁鏂囦欢涓婁紶鏃跺彲閰嶇疆 >* exts锛氭湁鏂囦欢涓婁紶鏃跺彲閰嶇疆 >* uploadattachment锛氭湁闄勪欢涓婁紶鏃堕』閰嶇疆锛屾槸鍚︽樉绀轰笂浼犻檮浠讹紝榛樿false ->* preevent锛氬脊绐楀墠缃簨浠讹紝閰嶇疆鍓嶇疆浜嬩欢鐨刯s鍦板潃锛屽"preevent.js"銆佲�渪xx/preevent.js鈥濓紝鏂囦欢鏀惧湪src/components/actions涓�>* preevent锛氬脊绐楀墠缃簨浠讹紝閰嶇疆鍓嶇疆浜嬩欢鐨刯s鍦板潃锛屽"preevent.js"銆佲�渪xx/preevent.js鈥濓紝鏂囦欢鏀惧湪src/components/actions涓� ->* afterevent锛氬脊绐楀悗缃簨浠讹紝閰嶇疆鍚庣疆浜嬩欢鐨刯s鍦板潃锛屽"afterevent.js"銆佲�渪xx/afterevent.js鈥濓紝鏂囦欢鏀惧湪src/components/actions涓� ->* +>* preEvent锛氬脊绐楀墠缃簨浠讹紝閰嶇疆鍓嶇疆浜嬩欢鐨刯s鍦板潃锛屽"preevent.js"銆佲�渪xx/preevent.js鈥濓紝鏂囦欢鏀惧湪src/components/actions涓� +>* afterEvent锛氬脊绐楀悗缃簨浠讹紝閰嶇疆鍚庣疆浜嬩欢鐨刯s鍦板潃锛屽"afterevent.js"銆佲�渪xx/afterevent.js鈥濓紝鏂囦欢鏀惧湪src/components/actions涓� +>* beforeServerEvent锛氭湇鍔$鍓嶇疆浜嬩欢 +>* afterServerEvent锛氭湇鍔$鍚庣疆浜嬩欢 +>* saveBeforeEvent锛氭墽琛屼繚瀛樺墠鐨勫墠缃簨浠讹紝閰嶇疆js鍦板潃锛屽"savebeforeevent.js"銆佲�渪xx/savebeforeevent.js鈥濓紝鏂囦欢鏀惧湪src/components/actions涓� +>* saveAfterEvent锛氫繚瀛樻垚鍔熷悗鐨勫墠缃簨浠讹紝閰嶇疆js鍦板潃锛屽"saveAfterEvent.js"銆佲�渪xx/saveAfterEvent.js鈥濓紝鏂囦欢鏀惧湪src/components/actions涓� + ### edit锛屼慨鏀�  ->* type锛氫慨鏀圭晫闈㈢殑涓氬姟绫诲瀷锛屽繀濉� + +淇敼涓氬姟瀵硅薄銆傜紪鍙凤細edit锛岀被鍨嬶細涓氬姟绫诲瀷 + +>* type锛氬繀濉紝淇敼鐣岄潰鐨勪笟鍔$被鍨� >* form锛氫慨鏀圭殑琛ㄥ崟瀵硅薄锛屽繀椤昏閰嶇疆form鎴栬�卌ontext锛屼紭鍏堜娇鐢╢orm >* context锛氫慨鏀圭晫闈㈢殑UI涓婁笅鏂囷紝鏈塮orm鍙傛暟鏃惰鍊兼棤鏁堛�傝嫢UI涓婁笅鏂囦粎閰嶆湁琛ㄥ崟灞曠ず锛屽垯淇敼寮圭獥浼氶粯璁ゆ湁淇濆瓨鎸夐挳 ->* useDataType锛氫娇鐢║I涓婁笅鏂囦腑鐨勫摢涓被鍨嬫暟鎹�,鍊兼湁form銆乼ree銆乼able銆乀reeTable锛屼笉濉椂榛樿涓篺orm ->* initvalue锛氳〃鍗曢璁緑alue锛岄潪蹇呭~銆傛牸寮忕ず渚嬶細rootoid=root.${oid}&rootname=root.${name}&name=${name}銆乻ourceoid=sourceData.${oid}&sourcename=sourceData.${name}&oid=${oid}&name=${name} ->* needselect锛氭槸鍚﹀繀椤婚�夋嫨鏁版嵁锛屼笌initvalue閰嶅悎浣跨敤銆� +>* multi锛氬�间负true鏃跺彲閫夋嫨澶氭潯鏁版嵁淇敼 +>* initValue锛氳〃鍗曢璁緑alue锛岄潪蹇呭~銆傛牸寮忕ず渚嬶細rootoid=root.${oid}&rootname=root.${name}&name=${name}銆乻ourceoid=sourceData.${oid}&sourcename=sourceData.${name}&oid=${oid}&name=${name} +>* needSelect锛氭槸鍚﹀繀椤婚�夋嫨鏁版嵁锛屼笌initvalue閰嶅悎浣跨敤銆� 鍊间负false鏃跺厑璁竔nitvalue瀵瑰簲鐨勫睘鎬у�间负绌恒�� 鍊间负true鎴栬�呮湭閰嶇疆鍙傛暟鍒欏繀椤绘湁涓婁笅鏂囩殑sourceData鎴杁ataStore锛岀敤浠ヤ笌initvalue寤虹珛鏄犲皠鍏崇郴 +>* checkNotEdit锛氭鏌ヤ笉鍏佽淇敼鐨勬暟鎹紝闈炲繀濉�傛牸寮忕ず渚嬶細oid=xxx&name=yyy锛岃В鏋愬綋淇敼鏁版嵁oid涓簒xx鎴栬�卬ame涓簓yy鏃讹紝璇ユ潯鏁版嵁涓嶅厑璁镐慨鏀� +>* checkNotEditMsg锛氬嚭鐜颁笉鍏佽淇敼鏁版嵁鏃剁殑鎻愮ず锛岄粯璁も�滃綋鍓嶆暟鎹笉鍏佽淇敼鈥� +>* successMsg锛氫慨鏀规垚鍔熷悗鎻愮ず锛岄粯璁も�滀慨鏀规垚鍔熲�� +>* getDataUrl锛氳幏鍙栬〃鍗曟暟鎹紝榛樿鈥渦iDataController/dataFormQuery鈥� +>* getDataMethod锛氳幏鍙栬〃鍗曟暟鎹姹傜殑method锛岄粯璁も�減ost鈥� +>* url: 淇敼鐣岄潰鐨勪繚瀛樻寜閽姹傝矾寰勶紝榛樿'uiDataController/editSave' +>* method: 淇敼鐣岄潰鐨勪繚瀛樻寜閽姹俶ethod锛岄粯璁�'put' +>* uploadFileUrl: 鏂囦欢涓婁紶鍦板潃锛岄粯璁�'vciFileUploadController/uploadFile' +>* accept锛氭湁鏂囦欢涓婁紶鏃跺彲閰嶇疆 +>* exts锛氭湁鏂囦欢涓婁紶鏃跺彲閰嶇疆 +>* uploadattachment锛氭湁闄勪欢涓婁紶鏃堕』閰嶇疆锛屾槸鍚︽樉绀轰笂浼犻檮浠讹紝榛樿false +>* preEvent锛氬脊绐楀墠缃簨浠讹紝閰嶇疆鍓嶇疆浜嬩欢鐨刯s鍦板潃锛屽"preevent.js"銆佲�渪xx/preevent.js鈥濓紝鏂囦欢鏀惧湪src/components/actions涓� +>* afterEvent锛氬脊绐楀悗缃簨浠讹紝閰嶇疆鍚庣疆浜嬩欢鐨刯s鍦板潃锛屽"afterevent.js"銆佲�渪xx/afterevent.js鈥濓紝鏂囦欢鏀惧湪src/components/actions涓� +>* beforeServerEvent锛氭湇鍔$鍓嶇疆浜嬩欢 +>* afterServerEvent锛氭湇鍔$鍚庣疆浜嬩欢 +>* saveBeforeEvent锛氭墽琛屼繚瀛樺墠鐨勫墠缃簨浠讹紝閰嶇疆js鍦板潃锛屽"savebeforeevent.js"銆佲�渪xx/savebeforeevent.js鈥濓紝鏂囦欢鏀惧湪src/components/actions涓� +>* saveAfterEvent锛氫繚瀛樻垚鍔熷悗鐨勫墠缃簨浠讹紝閰嶇疆js鍦板潃锛屽"saveAfterEvent.js"銆佲�渪xx/saveAfterEvent.js鈥濓紝鏂囦欢鏀惧湪src/components/actions涓� ### del锛屽垹闄� + +鍒犻櫎涓氬姟瀵硅薄銆傜紪鍙凤細del鎴栬�卍elete锛岀被鍨嬶細涓氬姟绫诲瀷 + +>* multi锛氬�间负true鏃跺彲閫夋嫨澶氭潯鏁版嵁鍒犻櫎 +>* checkNotDelete锛氭鏌ヤ笉鍏佽鍒犻櫎鐨勬暟鎹紝闈炲繀濉�傛牸寮忕ず渚嬶細oid=xxx&name=yyy锛岃В鏋愬綋鍒犻櫎鏁版嵁oid涓簒xx鎴栬�卬ame涓簓yy鏃讹紝璇ユ潯鏁版嵁涓嶅厑璁稿垹闄� +>* checkNotDeleteMsg锛氬嚭鐜颁笉鍏佽鍒犻櫎鏁版嵁鏃剁殑鎻愮ず锛岄粯璁も�滃綋鍓嶆暟鎹笉鍏佽鍒犻櫎鈥� +>* cascade锛� 鍓嶇楠岃瘉绾ц仈鍒犻櫎涓嬬骇鏁版嵁 +>* adminCascade锛� 鏈嶅姟绔獙璇佺骇鑱斿垹闄や笅绾ф暟鎹� +>* checkLinkedFlag +>* successMsg锛氬垹闄ゆ垚鍔熷悗鎻愮ず锛岄粯璁も�滃垹闄ゆ垚鍔熲�� +>* url: 鍒犻櫎璇锋眰璺緞锛岄粯璁�'uiDataController/deleteData' +>* method: 鍒犻櫎璇锋眰method锛岄粯璁�'delete' +> ### view锛屾煡鐪� + + + +鏌ョ湅涓氬姟瀵硅薄銆傜紪鍙凤細view锛岀被鍨嬶細涓氬姟绫诲瀷 + +>* type锛氬繀濉紝鏌ョ湅鐣岄潰鐨勪笟鍔$被鍨� +>* form锛氭煡鐪嬬殑琛ㄥ崟瀵硅薄锛屽繀椤昏閰嶇疆form鎴栬�卌ontext锛屼紭鍏堜娇鐢╢orm +>* context锛氭煡鐪嬬晫闈㈢殑UI涓婁笅鏂囷紝鏈塮orm鍙傛暟鏃惰鍊兼棤鏁堛�� +>* multi锛氬�间负true鏃跺彲閫夋嫨澶氭潯鏁版嵁鏌ョ湅 +>* getDataUrl锛氳幏鍙栬〃鍗曟暟鎹紝榛樿鈥渦iDataController/dataFormQuery鈥� +>* getDataMethod锛氳幏鍙栬〃鍗曟暟鎹姹傜殑method锛岄粯璁も�減ost鈥� + +### rev锛屽崌鐗� + + + +鍗囩骇鐗堟湰銆傜紪鍙凤細rev锛岀被鍨嬶細涓氬姟绫诲瀷 + +>* type锛氬繀濉紝鍗囩増鐣岄潰鐨勪笟鍔$被鍨� +>* form锛氬崌鐗堢殑琛ㄥ崟瀵硅薄锛屽繀椤昏閰嶇疆form鎴栬�卌ontext锛屼紭鍏堜娇鐢╢orm +>* context锛氬崌鐗堢晫闈㈢殑UI涓婁笅鏂囷紝鏈塮orm鍙傛暟鏃惰鍊兼棤鏁堛�傝嫢UI涓婁笅鏂囦粎閰嶆湁琛ㄥ崟灞曠ず锛屽垯淇敼寮圭獥浼氶粯璁ゆ湁淇濆瓨鎸夐挳 +>* multi锛氬�间负true鏃跺彲閫夋嫨澶氭潯鏁版嵁鍗囩増 +>* initValue锛氳〃鍗曢璁緑alue锛岄潪蹇呭~銆傛牸寮忕ず渚嬶細rootoid=root.${oid}&rootname=root.${name}&name=${name}銆乻ourceoid=sourceData.${oid}&sourcename=sourceData.${name}&oid=${oid}&name=${name} +>* needSelect锛氭槸鍚﹀繀椤婚�夋嫨鏁版嵁锛屼笌initvalue閰嶅悎浣跨敤銆� + 鍊间负false鏃跺厑璁竔nitvalue瀵瑰簲鐨勫睘鎬у�间负绌恒�� + 鍊间负true鎴栬�呮湭閰嶇疆鍙傛暟鍒欏繀椤绘湁涓婁笅鏂囩殑sourceData鎴杁ataStore锛岀敤浠ヤ笌initvalue寤虹珛鏄犲皠鍏崇郴 +>* checkNotEdit锛氭鏌ヤ笉鍏佽鍗囩増鐨勬暟鎹紝闈炲繀濉�傛牸寮忕ず渚嬶細oid=xxx&name=yyy锛岃В鏋愬綋鍗囩増鏁版嵁oid涓簒xx鎴栬�卬ame涓簓yy鏃讹紝璇ユ潯鏁版嵁涓嶅厑璁稿崌鐗� +>* checkNotEditMsg锛氬嚭鐜颁笉鍏佽鍗囩増鏁版嵁鏃剁殑鎻愮ず锛岄粯璁も�滃綋鍓嶆暟鎹笉鍏佽鍗囩増鈥� +>* upVersion锛氳鍗囩骇鍒扮殑鐗堟湰銆傞粯璁ゆ寜鐓у崌鐗堣鍒欏崌鐗� +>* successMsg锛氬崌鐗堟垚鍔熷悗鎻愮ず锛岄粯璁も�滃崌鐗堟垚鍔熲�� +>* getDataUrl锛氳幏鍙栬〃鍗曟暟鎹紝榛樿鈥渦iDataController/dataFormQuery鈥� +>* getDataMethod锛氳幏鍙栬〃鍗曟暟鎹姹傜殑method锛岄粯璁も�減ost鈥� +>* url: 鍗囩増鐣岄潰鐨勪繚瀛樻寜閽姹傝矾寰勶紝榛樿'uiDataController/upRevision' +>* method: 鍗囩増鐣岄潰鐨勪繚瀛樻寜閽姹俶ethod锛岄粯璁�'put' +>* uploadFileUrl: 鏂囦欢涓婁紶鍦板潃锛岄粯璁�'vciFileUploadController/uploadFile' +>* accept锛氭湁鏂囦欢涓婁紶鏃跺彲閰嶇疆 +>* exts锛氭湁鏂囦欢涓婁紶鏃跺彲閰嶇疆 +>* uploadattachment锛氭湁闄勪欢涓婁紶鏃堕』閰嶇疆锛屾槸鍚︽樉绀轰笂浼犻檮浠讹紝榛樿false +>* preEvent锛氬脊绐楀墠缃簨浠讹紝閰嶇疆鍓嶇疆浜嬩欢鐨刯s鍦板潃锛屽"preevent.js"銆佲�渪xx/preevent.js鈥濓紝鏂囦欢鏀惧湪src/components/actions涓� +>* afterEvent锛氬脊绐楀悗缃簨浠讹紝閰嶇疆鍚庣疆浜嬩欢鐨刯s鍦板潃锛屽"afterevent.js"銆佲�渪xx/afterevent.js鈥濓紝鏂囦欢鏀惧湪src/components/actions涓� +>* beforeServerEvent锛氭湇鍔$鍓嶇疆浜嬩欢 +>* afterServerEvent锛氭湇鍔$鍚庣疆浜嬩欢 +>* saveBeforeEvent锛氭墽琛屼繚瀛樺墠鐨勫墠缃簨浠讹紝閰嶇疆js鍦板潃锛屽"savebeforeevent.js"銆佲�渪xx/savebeforeevent.js鈥濓紝鏂囦欢鏀惧湪src/components/actions涓� +>* saveAfterEvent锛氫繚瀛樻垚鍔熷悗鐨勫墠缃簨浠讹紝閰嶇疆js鍦板潃锛屽"saveAfterEvent.js"銆佲�渪xx/saveAfterEvent.js鈥濓紝鏂囦欢鏀惧湪src/components/actions涓� + +## 閾炬帴绫诲瀷Action +### linkadd +### linkedit +### linkdel + +## 鑷畾涔堿ction diff --git a/Source/ProjectWeb/src/configDoc/Action/img_del.png b/Source/ProjectWeb/src/configDoc/Action/img_del.png new file mode 100644 index 0000000..1615809 --- /dev/null +++ b/Source/ProjectWeb/src/configDoc/Action/img_del.png Binary files differ diff --git a/Source/ProjectWeb/src/configDoc/Action/img_rev.png b/Source/ProjectWeb/src/configDoc/Action/img_rev.png new file mode 100644 index 0000000..f914489 --- /dev/null +++ b/Source/ProjectWeb/src/configDoc/Action/img_rev.png Binary files differ diff --git a/Source/ProjectWeb/src/configDoc/Action/img_view.png b/Source/ProjectWeb/src/configDoc/Action/img_view.png new file mode 100644 index 0000000..b09d628 --- /dev/null +++ b/Source/ProjectWeb/src/configDoc/Action/img_view.png Binary files differ diff --git a/Source/ProjectWeb/src/configDoc/UI.md b/Source/ProjectWeb/src/configDoc/UI.md index 109a4ce..661bf9a 100644 --- a/Source/ProjectWeb/src/configDoc/UI.md +++ b/Source/ProjectWeb/src/configDoc/UI.md @@ -4,14 +4,18 @@  >1. 鏄剧ず琛ㄨ揪寮忛厤缃柟寮忓涓婂浘 >2. 椤电閰嶇疆澶氫釜鏃讹紝椤甸潰浠ab灞曠ず +> ### 椤电鐣岄潰閰嶇疆 閫変腑椤电锛岀偣鍑讳笅闈㈢殑鈥滄坊鍔犫�濇寜閽垱寤洪〉闈�  >1. 琛ㄦ牸銆佹爲琛ㄣ�佽〃鍗曘�佹爲閰嶇疆鏂瑰紡涓嶤/S绔竴鑷� >2. 鑷畾涔夋ā鏉垮繀椤婚厤缃帶鍒惰矾寰勶紝鍙厤缃负UI涓婁笅鏂囨垨鑷畾涔夌粍浠朵袱绉嶃�傞厤缃牸寮忊�滅粍浠秐ame?param=xxx鈥濓紙鑷畾涔夌粍浠讹級鎴栬�呪��?type=xxx&context=yyy&pparam=zzz鈥濓紙UI寮曟搸锛夛紝涓庤彍鍗曢厤缃柟寮忎竴鑷淬�� >3. 椤甸潰閰嶇疆澶氫釜鏃讹紝椤甸潰浠ollapse鎶樺彔闈㈡澘灞曠ず +> ### 鎸夐挳閰嶇疆 閫変腑椤甸潰锛岀偣鍑讳笅闈㈢殑"鎸夐挳璁捐"鎸夐挳鍒涘缓鎸夐挳  >1. 闇�鍏堝垱寤篈ction,Action鍒涘缓鏂瑰紡瑙丄ction閰嶇疆鏂囨。 >2. Action鏈夊弬鏁版椂鍙笉閰嶇疆鍙傛暟淇℃伅銆傚弬鏁颁俊鎭厤缃笌Action鍙傛暟閰嶇疆涓�鑷达紝璇﹁Action閰嶇疆鏂囨。銆� +>3. 姣忎釜椤甸潰榛樿鏈夆�滃埛鏂�"鎸夐挳锛屽彲涓嶉厤缃� +>4. 鍒楄〃椤甸潰榛樿鏈夆�濇煡鐪嬧�溿�佲�濆鍑衡�滄寜閽紝鍙笉閰嶇疆 -- Gitblit v1.9.3