From 51636e9cd814bddba7a9b4ff21b5bc94e95fb6cb Mon Sep 17 00:00:00 2001 From: wangting <675591594@qq.com> Date: 星期二, 14 五月 2024 09:21:36 +0800 Subject: [PATCH] 配置文档 --- Source/ProjectWeb/src/configDoc/UI/img_2.png | 0 Source/ProjectWeb/src/components/actions/ViewDialog.vue | 2 Source/ProjectWeb/src/components/actions/base/TabViewAction.js | 2 Source/ProjectWeb/src/configDoc/menu.md | 13 ++++ Source/ProjectWeb/src/configDoc/UI/img.png | 0 Source/ProjectWeb/src/views/preview/readMD.vue | 42 ++++++++++++++ Source/ProjectWeb/src/configDoc/menu/img.png | 0 Source/ProjectWeb/src/configDoc/menu/img_ui.png | 0 Source/ProjectWeb/src/components/dynamic-components/dynamic-button.vue | 82 +++++++++++++++------------ Source/ProjectWeb/src/configDoc/UI/img_1.png | 0 Source/ProjectWeb/src/configDoc/menu/img_custom.png | 0 Source/ProjectWeb/src/router/avue-router.js | 11 ++- Source/ProjectWeb/src/components/dynamic-components/dynamic-custom.vue | 11 ++- 13 files changed, 115 insertions(+), 48 deletions(-) diff --git a/Source/ProjectWeb/src/components/actions/base/ViewDialog.vue b/Source/ProjectWeb/src/components/actions/ViewDialog.vue similarity index 98% rename from Source/ProjectWeb/src/components/actions/base/ViewDialog.vue rename to Source/ProjectWeb/src/components/actions/ViewDialog.vue index 34c7163..29ddc1a 100644 --- a/Source/ProjectWeb/src/components/actions/base/ViewDialog.vue +++ b/Source/ProjectWeb/src/components/actions/ViewDialog.vue @@ -114,7 +114,7 @@ this.currentComponent = module.default; }).catch((error) => { // 澶勭悊瀵煎叆澶辫触鐨勬儏鍐� - console.error('缁勪欢鍔犺浇澶辫触:', error); + console.log('缁勪欢鍔犺浇澶辫触:', error); }); }, dialogClose() { diff --git a/Source/ProjectWeb/src/components/actions/base/TabViewAction.js b/Source/ProjectWeb/src/components/actions/base/TabViewAction.js index d8c914d..12d8d09 100644 --- a/Source/ProjectWeb/src/components/actions/base/TabViewAction.js +++ b/Source/ProjectWeb/src/components/actions/base/TabViewAction.js @@ -4,7 +4,7 @@ import {paramLow,callPreEvent,callPostEvent,replaceFreeMarker} from './BaseAction'; import {validatenull} from "@/util/validate"; import Vue from "vue"; -import ViewDialog from "@/components/actions/base/ViewDialog"; +import ViewDialog from "@/components/actions/ViewDialog"; export const doAction = (options,callback) => { const paramVOS = Object.assign({ diff --git a/Source/ProjectWeb/src/components/dynamic-components/dynamic-button.vue b/Source/ProjectWeb/src/components/dynamic-components/dynamic-button.vue index 18457b8..7d69abf 100644 --- a/Source/ProjectWeb/src/components/dynamic-components/dynamic-button.vue +++ b/Source/ProjectWeb/src/components/dynamic-components/dynamic-button.vue @@ -3,53 +3,55 @@ <!--琛ㄦ牸鍩虹鎸夐挳--> <div v-if="type === 'table' || type === 'TreeTable'"> <!--top灞曠ず琛ㄦ牸涓婃柟鍖哄煙 menu灞曠ず琛ㄦ牸鎿嶄綔鏍忓尯鍩� 鏃犲氨鏄粯璁� --> - <el-button v-for="item in basicButtonList.top" - v-if="LocationType === 'top'" - :key="item.oid" :icon="item.paramVOS.icon" - :type="item.paramVOS.btnType || 'primary'" plain - size="small" - @click="buttonClick(item)"> - {{ item.name }} - </el-button> + <el-tooltip v-if="LocationType === 'top'" v-for="item in basicButtonList.top" :content="item.description || item.name" placement="top"> + <el-button :key="item.oid" :icon="item.paramVOS.icon" + :type="item.paramVOS.btnType || 'primary'" plain + size="small" + @click="buttonClick(item)"> + {{ item.name }} + </el-button> + </el-tooltip> <el-button type="text" @click="handleDefaultAddChildren(scope.row)" v-if="(LocationType === 'menu' && type === 'TreeTable')">鏂板瀛愮骇</el-button> <el-button type="text" icon="el-icon-view" size="small" plain @click="$emit('rowView',scope.row,scope.index)" v-if="LocationType === 'menu'">鏌ョ湅</el-button> - <el-button v-for="item in basicButtonList.menu" - v-if="LocationType === 'menu'" - :key="item.oid" - :icon="item.paramVOS.icon ? item.paramVOS.icon : (item.id === 'edit' ? 'el-icon-edit' : (item.id === 'delete' ||item.id === 'del' ? 'el-icon-delete' : ''))" - :type="item.paramVOS.btnType || 'text'" plain - size="small" - @click="buttonClick(item,scope.row)"> - {{ item.name }} - </el-button> + <el-tooltip v-if="LocationType === 'menu'" v-for="item in basicButtonList.menu" :content="item.description || item.name" placement="top"> + <el-button :key="item.oid" + :icon="item.paramVOS.icon ? item.paramVOS.icon : (item.id === 'edit' ? 'el-icon-edit' : (item.id === 'delete' ||item.id === 'del' ? 'el-icon-delete' : ''))" + :type="item.paramVOS.btnType || 'text'" plain + size="small" + @click="buttonClick(item,scope.row)"> + {{ item.name }} + </el-button> + </el-tooltip> <!-- 琛ㄦ牸鍐呮寜閽搷浣滃璇濇琛ㄥ崟 --> <dynamic-table-form ref="dynamicForm" :formList="formList" :title="formName" :visible.sync="visible" style="display: none"></dynamic-table-form> </div> <div v-else-if="type === 'form'"> - <el-button v-for="item in basicButtonList" - :key="item.oid" - :icon="item.paramVOS.icon" - :type="item.paramVOS.btnType || 'primary'" - plain - size="small" - @click="buttonClick(item)"> - {{ item.name }} - </el-button> + <el-tooltip v-for="item in basicButtonList" :content="item.description || item.name" placement="top"> + <el-button :key="item.oid" + :icon="item.paramVOS.icon" + :type="item.paramVOS.btnType || 'primary'" + plain + size="small" + @click="buttonClick(item)"> + {{ item.name }} + </el-button> + </el-tooltip> </div> <div v-else-if="type === 'tree'" class="tree-buttons"> - <el-button v-for="item in basicButtonList" - :key="item.oid" - :icon="item.paramVOS.icon" - :type="item.paramVOS.btnType || 'primary'" - plain - size="small" - @click="buttonClick(item)"> - {{ item.name }} - </el-button> + <el-tooltip v-for="item in basicButtonList" :content="item.description || item.name" placement="top"> + <el-button :key="item.oid" + :icon="item.paramVOS.icon" + :type="item.paramVOS.btnType || 'primary'" + plain + size="small" + @click="buttonClick(item)"> + {{ item.name }} + </el-button> + </el-tooltip> <el-button type="primary" plain size="small" @@ -111,8 +113,16 @@ return []; // 濡傛灉 basicColumn 鏈畾涔夋垨鑰呬笉鏄暟缁勶紝杩斿洖绌烘暟缁� } - if (this.type === 'form' || this.type === 'tree') { + if (this.type === 'form') { return basicColumn; + }else if (this.type === 'tree') { + const treeBtn = basicColumn.filter(item => { + if (item.id != "refresh") { + return true; + } + return false + }); + return treeBtn; } else if (this.type === 'table' || this.type === 'TreeTable') { const top = basicColumn.filter(item => { if (item.paramVOS && item.paramVOS.showLocation && item.paramVOS.showLocation !== 'menu') { diff --git a/Source/ProjectWeb/src/components/dynamic-components/dynamic-custom.vue b/Source/ProjectWeb/src/components/dynamic-components/dynamic-custom.vue index 44dbf0e..360191b 100644 --- a/Source/ProjectWeb/src/components/dynamic-components/dynamic-custom.vue +++ b/Source/ProjectWeb/src/components/dynamic-components/dynamic-custom.vue @@ -112,11 +112,12 @@ } else { this.ComponentUrl = this.customClass; // 涓嶅瓨鍦� '?' 鏁存潯璺緞灏辨槸 parts } - if(validatenull(this.ComponentUrl) || ['UI', 'ui'].includes(this.ComponentUrl)){ - this.ComponentUrl='base/UIContentViewerInDialog'; - }else { - this.ComponentUrl='custom-ui/'+this.ComponentUrl; + if(validatenull(this.ComponentUrl) || ['ui', 'UI', 'base','bs'].includes(this.ComponentUrl)){ + this.ComponentUrl='views/base/UIContentViewerInDialog'; + }else if(this.ComponentUrl.indexOf('views/')===-1){ + this.ComponentUrl='views/custom-ui/'+this.ComponentUrl; } + if (this.ComponentUrl=='base/UIContentViewerInDialog' && (!urlParams.type || !urlParams.context)) { this.isError = true; return; @@ -133,7 +134,7 @@ methods: { loadCompoent(){ // 鍔ㄦ�佸鍏ョ粍浠� - import(`@/views/${this.ComponentUrl}.vue`).then((module) => { + import(`@/${this.ComponentUrl}.vue`).then((module) => { // 鎴愬姛瀵煎叆鍚庯紝灏嗙粍浠舵敞鍐屽埌Vue瀹炰緥涓� this.currentComponent = module.default; }).catch((error) => { diff --git a/Source/ProjectWeb/src/configDoc/UI/img.png b/Source/ProjectWeb/src/configDoc/UI/img.png new file mode 100644 index 0000000..ad38be0 --- /dev/null +++ b/Source/ProjectWeb/src/configDoc/UI/img.png Binary files differ diff --git a/Source/ProjectWeb/src/configDoc/UI/img_1.png b/Source/ProjectWeb/src/configDoc/UI/img_1.png new file mode 100644 index 0000000..ba9c0fc --- /dev/null +++ b/Source/ProjectWeb/src/configDoc/UI/img_1.png Binary files differ diff --git a/Source/ProjectWeb/src/configDoc/UI/img_2.png b/Source/ProjectWeb/src/configDoc/UI/img_2.png new file mode 100644 index 0000000..350e492 --- /dev/null +++ b/Source/ProjectWeb/src/configDoc/UI/img_2.png Binary files differ diff --git a/Source/ProjectWeb/src/configDoc/menu.md b/Source/ProjectWeb/src/configDoc/menu.md new file mode 100644 index 0000000..6c85775 --- /dev/null +++ b/Source/ProjectWeb/src/configDoc/menu.md @@ -0,0 +1,13 @@ +绯荤粺妯″潡閰嶇疆 > 涓氬姟鍔熻兘妯″潡,灞曠ず鍦˙/S绔殑椤甸潰闇�閰嶇疆"B/S"椤瑰唴瀹� +### 鐖惰彍鍗曢厤缃� + +> 鍊间笉鑳戒负绌猴紝鍙负浠绘剰鑻辨枃瀛楃 +### 閰嶇疆UI寮曟搸鑿滃崟 + +>1. 鈥�?鈥濆墠涓嶈缃�� +>2. 鈥�?鈥濆悗涓哄弬鏁帮紝蹇呴』鍖呭惈type鍜宑ontext鍙傛暟锛屽彲涓�".NET"涓�鑷� +>3. 濡傛灉context瀵瑰簲鐨刄I绗竴涓尯鍩熶负鏍戯紝鍒欒繕蹇呴』鏈塹uerytemplate鍙傛暟锛屽�间负鏍戝搴旂殑鏌ヨ妯℃澘 +### 閰嶇疆鑷畾涔夌粍浠惰彍鍗� + +>1. 鐩存帴閰嶇疆鏂囦欢鍚嶏紝瀵瑰簲鏂囦欢鍦╯rc/views/custom-ui鍐呫�傚彲閰嶇疆鍙傛暟鍦�?鍚�,鍙傛暟鍊煎湪缁勪欢涓�氳繃$route.query鑾峰彇 +>2. 閰嶇疆鍔犺矾寰剉iews锛屽閰嶇疆鎴愶細鈥渧iews/custom-ui/test鈥濇垨鑰呪�渧iews/xxx鈥� diff --git a/Source/ProjectWeb/src/configDoc/menu/img.png b/Source/ProjectWeb/src/configDoc/menu/img.png new file mode 100644 index 0000000..3780e08 --- /dev/null +++ b/Source/ProjectWeb/src/configDoc/menu/img.png Binary files differ diff --git a/Source/ProjectWeb/src/configDoc/menu/img_custom.png b/Source/ProjectWeb/src/configDoc/menu/img_custom.png new file mode 100644 index 0000000..e02aaa2 --- /dev/null +++ b/Source/ProjectWeb/src/configDoc/menu/img_custom.png Binary files differ diff --git a/Source/ProjectWeb/src/configDoc/menu/img_ui.png b/Source/ProjectWeb/src/configDoc/menu/img_ui.png new file mode 100644 index 0000000..2f73d7d --- /dev/null +++ b/Source/ProjectWeb/src/configDoc/menu/img_ui.png Binary files differ diff --git a/Source/ProjectWeb/src/router/avue-router.js b/Source/ProjectWeb/src/router/avue-router.js index dd431b5..52c14c9 100644 --- a/Source/ProjectWeb/src/router/avue-router.js +++ b/Source/ProjectWeb/src/router/avue-router.js @@ -137,14 +137,15 @@ parts='UI'; } // 濡傛灉闂彿鍓嶉潰閮ㄥ垎涓嶅湪 ['ui', 'UI', 'base'] 涓紝鍒欐槸鑷畾涔夌粍浠� - if (!['ui', 'UI', 'base','bs'].includes(parts)) { + if (!['ui', 'UI', 'base','bs'].includes(parts) && parts.indexOf('views/')==-1) { component = `views/custom-ui/${parts}`; + }else if (['UI', 'ui', 'base','bs'].includes(parts)) { + // 濡傛灉闂彿鍓嶉潰绛変簬 UI銆乽i 鍒欎负UI寮曟搸 + component = 'views/base/UIContentViewer'; + }else{ + component = `${parts}`; } - // 濡傛灉闂彿鍓嶉潰绛変簬 UI銆乽i 鍒欎负UI寮曟搸 - if (['UI', 'ui'].includes(parts)) { - component = 'views/base/UIContentViewer'; - } let name = oMenu[propsDefault.label], icon = oMenu[propsDefault.icon], children = oMenu[propsDefault.children], diff --git a/Source/ProjectWeb/src/views/preview/readMD.vue b/Source/ProjectWeb/src/views/preview/readMD.vue new file mode 100644 index 0000000..3605c29 --- /dev/null +++ b/Source/ProjectWeb/src/views/preview/readMD.vue @@ -0,0 +1,42 @@ +<template> + <div class="md-content"> + <mark-down-it-vue class="md-body" :content="htmlMD"></mark-down-it-vue> + </div> +</template> + +<script> +import MarkDownItVue from "markdown-it-vue" +import "markdown-it-vue/dist/markdown-it-vue.css" +import {verifyNull} from "@/util/validate"; + +export default { + name: "readMD", + components: {MarkDownItVue}, + data() { + return { + htmlMD: "", + type:'' + } + }, + created() { + if (verifyNull(this.$route.query.type)) { + this.$message.error("閰嶇疆鐨勪俊鎭敊璇紝璇烽厤缃畉ype鍙傛暟"); + return false; + } + this.type=this.$route.query.type; + axios.get(`./src/configDoc/${this.type}.md`).then((response) => { + this.htmlMD = response.data; + }); + /*require(`@/configDoc/${this.type}.md`).then((markdown) => { + debugger; + this.htmlMD = markdown; + }).catch((error) => { + console.log('閰嶇疆鏂囨。璇诲彇澶辫触:', error); + });*/ + } +} +</script> + +<style scoped> + +</style> -- Gitblit v1.9.3