Browse Source

webpack5

master
陈裕财 4 years ago
parent
commit
1d863cbf49
  1. 42
      build/webpack.base.conf.js
  2. 16
      config/index.js
  3. 3
      index.html
  4. 6
      package.json
  5. 71
      src/components/Tinymce/Index.vue
  6. 300
      src/components/VueEditor/Index.vue
  7. 124
      src/components/editor/ImgEditor.vue
  8. 2
      src/views/mdp/workflow/re/procdefParames/ProcdefParamesSet.vue
  9. 290
      src/views/mdp/workflow/ru/procinstParames/ProcinstParamesStartSet.vue
  10. 4
      src/views/xm/core/components/headEditor.vue
  11. 12
      src/views/xm/core/xmExchange/TaskUserEditor.vue
  12. 44
      src/views/xm/core/xmFile/XmFileAdd.vue
  13. 48
      src/views/xm/core/xmFile/XmFileEdit.vue
  14. 10
      src/views/xm/core/xmMenuExchange/MenuUserEditor.vue
  15. 28
      src/views/xm/core/xmProject/XmProjectAssess.vue
  16. 154
      src/views/xm/core/xmQuestion/XmQuestionAdd.vue
  17. 222
      src/views/xm/core/xmQuestion/XmQuestionEdit.vue
  18. 68
      src/views/xm/core/xmTestCase/XmTestCaseAdd.vue
  19. 64
      src/views/xm/core/xmTestCase/XmTestCaseEdit.vue

42
build/webpack.base.conf.js

@ -54,7 +54,7 @@ var threadLoaderConfig={
// 可以修改名称来创建其余选项都一样的池(pool)
name: "my-pool"
}
}
}
const publicCssLoaders=process.env.NODE_ENV === 'production'?[{loader:MiniCssExtractPlugin.loader,options:{publicPath:'../'}},'css-loader']:[ 'style-loader','css-loader']
function resolve(dir) {
@ -79,7 +79,7 @@ module.exports = {
},
output: {
clean:true,
path: config.build.assetsRoot,
path: config.build.assetsRoot,
filename: 'js/[name].[contenthash].js',
pathinfo: false,
publicPath: process.env.NODE_ENV === 'production'
@ -96,16 +96,16 @@ module.exports = {
// 加载器
module: {
// https://doc.webpack-china.org/guides/migrating/#module-loaders-module-rules
rules: [
rules: [
//...(config.dev.useEslint ? [createLintingRule()] : []),
{
test: /\.vue$/,
include: resolve('src'),
//include: resolve('src'),
use:[
threadLoaderConfig,
{
loader: 'vue-loader',
/**
/**
options:vueLoaderConfig,
*/
options: {
@ -115,30 +115,30 @@ module.exports = {
{ loader: 'cache-loader' },
{ loader: 'babel-loader', options: { presets: ['env'] } }
]
},
},
extractCSS: true,
hotReload:true,
},
hotReload:true,
},
}
]
},
},
{
test: /\.css$/,
use: publicCssLoaders,
},
},
{
test: /\.(sa|sc)ss$/,
use: publicCssLoaders.concat([
use: publicCssLoaders.concat([
// 将 Sass 编译成 CSS
'sass-loader',
]),
},
},
{
test: /\.less$/,
use: publicCssLoaders.concat([
use: publicCssLoaders.concat([
// 将 Sass 编译成 CSS
'less-loader',
]),
@ -149,7 +149,7 @@ module.exports = {
// 将 Sass 编译成 CSS
'stylus-loader',
]),
},
},
{ // 配置Babel将ES6+ 转换为ES5
test: /\.js$/,
use:[
@ -159,10 +159,10 @@ module.exports = {
options: {
presets: ['env'],
plugins: ['transform-runtime']
},
},
},
],
include: resolve('src'),
include: resolve('src'),
},
{
test: /\.svg$/,
@ -181,7 +181,7 @@ module.exports = {
}
},
{
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
type: 'asset/resource',
generator: {
filename: 'media/[hash][ext][query]'
@ -196,7 +196,7 @@ module.exports = {
}
]
},
},
plugins: [
new VueLoaderPlugin(),
],

16
config/index.js

@ -10,23 +10,23 @@ module.exports = {
// Paths
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {
proxyTable: {
/**
'/api/m1/xm': {
target: 'http://localhost:7067',
changeOrigin: true,
pathRewrite: {
'^/api/m1/xm': '/xm'
}
},
/**
},
'/api/m1/workflow': {
target: 'http://localhost:7080',
changeOrigin: true,
pathRewrite: {
'^/api/m1/workflow': '/workflow'
}
},
},
**/
'/api': {
target: 'https://www.qingqinkj.com',
@ -58,7 +58,7 @@ module.exports = {
*/
// https://webpack.js.org/configuration/devtool/#development
devtool: '#cheap-source-map',
devtool: 'eval',
// If you have problems debugging vue-files in devtools,
// set this to false - it *may* help
@ -90,7 +90,7 @@ module.exports = {
productionSourceMap: false,
// https://webpack.js.org/configuration/devtool/#production
devtool: '#source-map',
devtool: false,
// Gzip off by default as many popular static hosts such as
// Surge or Netlify already gzip all static assets for you.
@ -105,4 +105,4 @@ module.exports = {
// Set to `true` or `false` to always turn it on or off
bundleAnalyzerReport: process.env.npm_config_report
}
}
}

3
index.html

@ -8,7 +8,8 @@
<title>项目管理系统</title>
</head>
<body>
<div id="app"></div>
<script src="./tinymce/tinymce.min.js"></script>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

6
package.json

@ -17,7 +17,7 @@
"@jiaminghi/data-view": "^2.10.0",
"axios": "0.17.1",
"clipboard": "1.7.1",
"vue-clipboard2": "^0.3.3",
"vue-clipboard2": "^0.3.1",
"codemirror": "5.32.0",
"dayjs": "^1.8.29",
"decimal.js": "^10.2.0",
@ -42,8 +42,7 @@
"showdown": "1.8.5",
"simplemde": "1.11.2",
"sortablejs": "1.7.0",
"vue": "2.6.10",
"vue-clipboard2": "^0.3.1",
"vue": "2.6.14",
"vue-contextmenujs": "^1.3.10",
"vue-count-to": "1.0.13",
"vue-cropper": "^0.2.9",
@ -87,7 +86,6 @@
"file-loader": "^6.2.0",
"friendly-errors-plugin": "^1.1.2",
"friendly-errors-webpack-plugin": "^1.7.0",
"happypack": "^4.0.0",
"html-webpack-plugin": "^5.4.0",
"less": "^4.1.2",
"less-loader": "^10.2.0",

71
src/components/Tinymce/Index.vue

@ -1,25 +1,22 @@
<template>
<div :class="{fullscreen:fullscreen}" class="tinymce-container editor-container">
<textarea :id="tinymceId" class="tinymce-textarea" />
<textarea :id="tinymceId" class="tinymce-textarea" />
<el-dialog id="editor-dialog" class="image-dialog" title="选择图片" :visible.sync="dialogVisible" width="70%" :close-on-click-modal="false" append-to-body>
<upload-image :multiple="true" :branch-id="userInfo.branchId" :dept-id="userInfo.deptid" :visible="dialogVisible" @cancel="dialogVisible=false" @confirm="handleConfirm"></upload-image>
</el-dialog>
</el-dialog>
</div>
</template>
<script>
import config from '@/common/config';//import
import UploadImage from '@/components/Image/UploadImage';
import { mapGetters } from 'vuex'
import config from '@/common/config';//import
import UploadImage from '@/components/Image/UploadImage';
import { mapGetters } from 'vuex'
import plugins from './plugins'
import toolbar from './toolbar'
import toolbar from './toolbar'
export default {
export default {
name: 'Tinymce',
components: { UploadImage },
props: {
props: {
value: {
type: String,
default: ''
@ -42,10 +39,10 @@ export default {
}
},
data() {
return {
return {
imageList:[],
dialogVisible:false,
editorHtmlData:this.value,
editorHtmlData:this.value,
tinymceId: 'vue-tinymce-'+new Date().getTime() + ((Math.random() * 1000).toFixed(0) + ''),
fullscreen: false,
languageTypeList: {
@ -57,19 +54,19 @@ export default {
computed: {
language() {
return this.languageTypeList[this.$store.getters.language]
},
},
...mapGetters([
'userInfo'
])
},
watch: {
value(val) {
value(val) {
if(val==this.editorHtmlData){
return;
}
this.$nextTick(() => window.tinymce.get(this.tinymceId).setContent(val || ''))
this.$nextTick(() => window.tinymce.get(this.tinymceId).setContent(val || ''))
},
editorHtmlData(val) {
editorHtmlData(val) {
this.$emit("input",val)
},
language() {
@ -78,12 +75,12 @@ export default {
}
},
mounted() {
this.$nextTick(() => this.initTinymce())
this.$nextTick(() => this.initTinymce())
},
/**
activated() {
this.initTinymce()
},
deactivated() {
this.destroyTinymce()
@ -117,29 +114,29 @@ export default {
fontsize_formats: "8pt 10pt 12pt 14pt 18pt 20pt 24pt 28pt 30pt 36pt 38pt 40pt 42pt 46pt 48pt",
font_formats: "微软雅黑='微软雅黑';宋体='宋体';黑体='黑体';仿宋='仿宋';楷体='楷体';隶书='隶书';幼圆='幼圆';Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings",
nonbreaking_force_tab: true, // inserting nonbreaking space &nbsp; need Nonbreaking Space Plugin
init_instance_callback: editor => {
init_instance_callback: editor => {
if (_this.value) {
editor.setContent(_this.value)
}
editor.on('NodeChange Change KeyUp SetContent', () => {
_this.editorHtmlData=editor.getContent()
}
editor.on('NodeChange Change KeyUp SetContent', () => {
_this.editorHtmlData=editor.getContent()
})
},
setup(editor) {
editor.on('FullscreenStateChanged', (e) => {
_this.fullscreen = e.state
})
editor.addButton('imageList',{
text:'图片库',
icon:false,
onclick:function(){
_this.dialogVisible=true;
_this.$nextTick(()=>{
_this.dialogVisible=true;
_this.$nextTick(()=>{
//document.getElementById("editor-dialog").style.zIndex="100000"
})
})
}
})
}
@ -176,9 +173,9 @@ export default {
// console.log(err);
// });
// },
})
})
this.setContent(this.value)
},
destroyTinymce() {
const tinymce = window.tinymce.get(this.tinymceId)
@ -189,13 +186,13 @@ export default {
tinymce.destroy()
}
},
setContent(value) {
setContent(value) {
window.tinymce.get(this.tinymceId).setContent(value)
},
getContent() {
window.tinymce.get(this.tinymceId).getContent()
},
insertImage () {
insertImage () {
let imageList = this.imageList;
let imageHtml = "";
(imageList || []).map(item => {
@ -206,10 +203,10 @@ export default {
}
this.dialogVisible = false;
},
handleConfirm(imgs){
handleConfirm(imgs){
this.imageList=imgs//{url:xxx,remark:xxxx}
this.insertImage();
this.insertImage();
},
imageSuccessCBK(arr) {
const _this = this
@ -250,4 +247,4 @@ export default {
z-index:20000 !important;
}
</style>
</style>

300
src/components/VueEditor/Index.vue

@ -1,300 +0,0 @@
<template>
<div>
<quill-editor style="width:100%;" v-model="content"
:options="editorOption"
:id="id"
ref="myTextEditor"
@blur="onEditorBlur($event)"
@focus="onEditorFocus($event)"
@ready="onEditorReady($event)">
<div :id="id+'_toolbar'" slot="toolbar">
<!-- Add a bold button -->
<button class="ql-bold">Bold</button>
<button class="ql-italic">Italic</button>
<button class="ql-underline">Underline</button>
<button class="ql-strike">Strike</button>
<button class="ql-header" value="1"></button>
<button class="ql-header" value="2"></button>
<button class="ql-header" value="3"></button>
<button class="ql-indent" value="+1"></button>
<button class="ql-indent" value="-1"></button>
<button class="ql-direction" value="rtl"></button>
<!-- Add font size dropdown -->
<select class="ql-size ql-picker">
<option value="small"></option>
<!-- Note a missing, thus falsy value, is used to reset to default -->
<option selected></option>
<option value="large"></option>
<option value="huge"></option>
</select>
<select class="ql-font">
<option selected="selected"></option>
<option value="serif"></option>
<option value="monospace"></option>
</select>
<select class="ql-color">
</select>
<select class="ql-background">
</select>
<!-- Add subscript and superscript buttons -->
<button class="ql-script" value="sub"></button>
<button class="ql-script" value="super"></button>
<button class="ql-link">链接</button>
<button class="ql-video">视频</button>
<!-- You can also add your own -->
<button id="custom-button-img" @click="mateImageButtonClick" style="width:80px;">图片库</button>
<el-upload ref="uploadFromFile" :action="uploadAction+'?userToken='+token" :on-change="fileChange" :accept="'image/*'" multiple :on-success="uploadSuccess" :on-error="handleUploadError" :show-file-list="false" :before-upload="beforeupload" :data="uploadOptions">
<el-button type="text">本地图片</el-button>
</el-upload>
</div>
</quill-editor>
<el-dialog title="裁剪图片" :visible.sync="shearMngVisible" top="0px" width="1100px" :lock-scroll="false" :close-on-click-modal="false" append-to-body>
<div slot="title">为了良好的客户体验app图片建议控制在50Kb左右宽400高300上限<br>如果是兼容pc的图片建议宽800高600为上限</div>
<shear-mng :imgWidth="myWidth" :imgHeight="myHeight" :image="image" :fullscreen.sync="fullscreen" :branch-id="uploadOptions.branchId" :category-id="image.categoryId" :remark="uploadOptions.remark" @cancel="shearMngVisible=false" @upload-success="uploadSuccess"></shear-mng>
</el-dialog>
<el-dialog title="选择图片" :visible.sync="addFormVisible" width="90%" top="0px" :close-on-click-modal="false" append-to-body>
<upload-image :branch-id="branchId" :multiple="true" :visible="addFormVisible" @cancel="addFormVisible=false" @confirm="handleConfirm"></upload-image>
</el-dialog>
</div>
</template>
<script>
import hljs from 'highlight.js'
//require styles
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
import {quillEditor,Quill} from 'vue-quill-editor'
import { ImageDrop } from 'quill-image-drop-module'
import ImageResize from 'quill-image-resize-module'
Quill.register('modules/imageDrop', ImageDrop)
Quill.register('modules/imageResize', ImageResize)
import util from '@/common/js/util';//
import UploadImage from '@/components/Image/UploadImage';
import ShearMng from '@/components/Image/ShearSelectUpload';
import config from '@/common/config';//config
import { mapGetters } from 'vuex'
export default {
props:['branchId','categoryId','deptid','remark','value','imgWidth','imgHeight','id'],
watch: {
'value':function(val){
this.content = val;
},
'content':function(content){
this.$emit('input',content)
},
'imgWidth':function(val){
this.myWidth = val;
},
'imgHeight':function(val){
this.myHeight = val;
}
},
data() {
return {
name: '03-example',
content: "请填写内容/上传图片/视频等",
editorOption: {
modules: {
toolbar: '#'+this.id+'_toolbar',
history: {
delay: 1000,
maxStack: 50,
userOnly: false
},
imageDrop: true,
imageResize: {
modules: [ 'Resize', 'DisplaySize', 'Toolbar' ]
}
}
},
fullscreen:false,
addFormVisible:false,
shearMngVisible:false,
/**begin 在下面加自定义属性,记得补上面的一个逗号**/
image:{categoryId:'123'},
uploadOptions:{branchId:this.branchId,categoryId:this.categoryId,fileName:'',remark:'',deptid:this.deptid},//
previewVisible:false,
myWidth:this.imgWidth,
myHeight:this.imgHeight,//80||178
currentEditorIndex:0,//
uploadAction:config.getArcImagePath()+"/arc/image/upload",
}
},
components: {
quillEditor,
'upload-image':UploadImage,
'shear-mng':ShearMng
},
computed: {
...mapGetters([
'userInfo','token'
]),
contentCode() {
return hljs.highlightAuto(this.content).value
},
editor() {
return this.$refs.myTextEditor.quill
}
},
methods: {
onEditorBlur(editor) {
//console.log('editor blur!', editor)
},
onEditorFocus(editor) {
//console.log('editor focus!', editor)
},
onEditorReady(editor) {
console.log('editor ready!', editor)
this.content = this.value
},
imageButtonClick(ev) {
var oEvent = ev || event;
oEvent.preventDefault();
let addImgRange = this.editor.getSelection()
if(addImgRange==null){
this.currentEditorIndex=0
}else{
this.currentEditorIndex=addImgRange.index;
}
this.addFormVisible=true;
return false;
},
mateImageButtonClick(ev) {
var oEvent = ev || event;
oEvent.preventDefault();
let addImgRange = this.editor.getSelection()
if(addImgRange==null){
this.currentEditorIndex=0
}else{
this.currentEditorIndex=addImgRange.index;
}
this.addFormVisible=true;
return false;
},
handleConfirm(imgs){
const range = this.editor.getSelection();
var editorPosition=this.currentEditorIndex;
if(range!=null){
editorPosition=range.index;
}
imgs.forEach(i=>{
this.editor.insertEmbed(editorPosition, 'image', i.url, Quill.sources.USER)
editorPosition=editorPosition+1;
})
this.currentEditorIndex=editorPosition;
//this.shearMngVisible=true;
},
//64,
uploadSuccess(res){
const range = this.editor.getSelection();
var editorPosition=this.currentEditorIndex;
if(range!=null){
editorPosition=range.index;
}
this.editor.insertEmbed(editorPosition, 'image', res.data.url, Quill.sources.USER)
this.currentEditorIndex=editorPosition+1;
this.shearMngVisible=false;
/* }); */
//this.$emit('cancel');
},
handleUploadError : function(err, file, fileList){
this.$message({showClose: true, message: "文件上传失败,请检查文件是否过大,建议图片文件控制在500K内", type: "warning" });
},
/**begin 在下面加自定义方法,记得补上面的一个逗号**/
converUrl(url){
if(url==null||url==''||url=='undefined'){
return url;
}
if(!url.indexOf('http')==0 && !url.indexOf('www')==0){
return config.getArcImagePath()+"/"+url;
}
return url;
},
previewImg(){
this.previewVisible=true;
},
beforeupload(file){
return true;
},
fileChange(file, fileList) {
var that = this;
console.log("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
console.log(file)
if(file.raw.type.indexOf('image')<0){
this.$message({showClose: true, message: "请选择图片文件", type: "warning" });
return false;
}
return true;
}
},
mounted() {
this.myWidth=this.imgWidth?this.imgWidth:400,
this.myHeight=this.imgHeight?this.imgHeight:300
console.log(this.$refs.uploadFromFile);
var that=this;
const imgHandler= function(isImage) {
console.log(isImage)
let addImgRange = that.editor.getSelection()
that.currentEditorIndex=addImgRange.index;
if (isImage) {
that.$refs.uploadFromFile.$el.querySelector(".el-upload input").click()
}
}
console.log(this.editor)
this.editor.getModule("toolbar").addHandler("image", imgHandler)
}
}
</script>
<style lang="scss">
.quill-editor,
.quill-code {
width: 50%;
float: left;
}
.quill-code {
height: auto;
border: none;
> .title {
border: 1px solid #ccc;
border-left: none;
height: 3em;
line-height: 3em;
text-indent: 1rem;
font-weight: bold;
}
> code {
width: 100%;
margin: 0;
padding: 1rem;
border: 1px solid #ccc;
border-top: none;
border-left: none;
border-radius: 0;
height: 30rem;
overflow-y: auto;
}
}
.quill-editor{
p {
>img {
float: left;
display: block;
}
}
}
</style>

124
src/components/editor/ImgEditor.vue

@ -1,124 +0,0 @@
<template>
<!--工具条1-->
<!--如果有更多工具条,放开此注释
<el-col :span="24" class="toolbar" size="small" style="padding-bottom: 0px;">
<el-col :span="4">
</el-col>
</el-col>
-->
<!--新增界面 Archive 档案信息表-->
<quill-editor ref="archiveContextEditor"
v-model="value"
:options="editorOption"
@blur="onEditorBlur($event)"
@focus="onEditorFocus($event)"
@ready="onEditorReady($event)">
</quill-editor>
</template>
<script>
//begin
import { quillEditor,Quill } from 'vue-quill-editor'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
import { ImageDrop } from 'quill-image-drop-module'
import ImageResize from 'quill-image-resize-module'
Quill.register('modules/imageDrop', ImageDrop)
Quill.register('modules/imageResize', ImageResize)
//end
export default {
props:['value']
data() {
return {
editorOption: {
modules: {
toolbar: [
[{ 'size': ['small', false, 'large'] }],
['bold', 'italic'],
[{ 'list': 'ordered'}, { 'list': 'bullet' }],
['link', 'image']
],
history: {
delay: 1000,
maxStack: 50,
userOnly: false
},
imageDrop: true,
imageResize: {
displayStyles: {
backgroundColor: 'black',
border: 'none',
color: 'white'
},
modules: [ 'Resize', 'DisplaySize', 'Toolbar' ]
}
}
}
}
},
mounted() {
},
computed: {
contentCode() {
return hljs.highlightAuto(this.content).value
},
},
methods: {
onEditorBlur(editor) {
// console.log('editor blur!', editor)
},
onEditorFocus(editor) {
// console.log('editor focus!', editor)
},
onEditorReady(editor) {
// console.log('editor ready!', editor)
}
},
components: {
// 'archive-edit':ArchiveEdit
'quill-editor':quillEditor
},
}
</script>
<style>
.quill-editor:not(.bubble) .ql-container,
.quill-editor:not(.bubble) .ql-container .ql-editor {
height: 30rem;
padding-bottom: 1rem;
}
</style>
<style lang="scss" scoped>
.quill-editor,
.quill-code {
width: 50%;
float: left;
}
.quill-code {
height: auto;
border: none;
> .title {
border: 1px solid #ccc;
border-left: none;
height: 3em;
line-height: 3em;
text-indent: 1rem;
font-weight: bold;
}
> code {
width: 100%;
margin: 0;
padding: 1rem;
border: 1px solid #ccc;
border-top: none;
border-left: none;
border-radius: 0;
height: 30rem;
overflow-y: auto;
}
}
</style>

2
src/views/mdp/workflow/re/procdefParames/ProcdefParamesSet.vue

@ -250,7 +250,7 @@
import Sticky from '@/components/Sticky' // header
import { mapGetters } from 'vuex'
import AttachmentUpload from '@/views/mdp/arc/archiveAttachment/AttachmentUpload';
import VueEditor from '@/components/VueEditor/Index';
import VueEditor from '@/components/Tinymce/index';
import UsersSelect from '@/views/mdp/sys/user/UsersSelect';
import FormDefForFlowNode from '@/views/mdp/form/formDef/FormDefForFlowNode';

290
src/views/mdp/workflow/ru/procinstParames/ProcinstParamesStartSet.vue

@ -1,38 +1,38 @@
<template>
<section>
<el-row class="page-container border">
<!--新增界面 ProcinstParames 流程实例参数设置表-->
<el-col :span="24">
<!--新增界面 ProcinstParames 流程实例参数设置表-->
<el-col :span="24">
<el-form :model="addForm" :label-width="labelWidth()" :rules="addFormRules" ref="addForm" >
<el-form-item label="流程标题" prop="mainTitle">
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" :span="10"> <el-input v-model="addForm.mainTitle" auto-complete="off"></el-input></el-col>
</el-form-item>
<el-form-item label="标签" prop="tagNames">
</el-form-item>
<el-form-item label="标签" prop="tagNames">
<font v-if="addForm.tagNames">
<el-tag v-for="tag in (addForm.tagNames.split(','))" :key="tag"
:type="'warning'"
:disable-transitions="false" >
{{tag }}
{{tag }}
</el-tag>
</font>
{{addForm.tagNames?'':'还没有标签,去打一个呗--> '}}
<el-button @click.native="tagSelectVisible=true" :loading="addLoading">打标签</el-button>
<el-button @click.native="tagSelectVisible=true" :loading="addLoading">打标签</el-button>
<el-button v-if="displayDiagram==false" @click="showDiagram()">查看流程图</el-button>
</el-form-item>
<el-form-item label="计划完成时间" prop="planFinishTime">
</el-form-item>
<el-form-item label="计划完成时间" prop="planFinishTime">
<el-col :span="10">
<el-date-picker style="width:100%;"
v-model="addForm.planFinishTime"
type="date" value-format="yyyy-MM-dd HH:mm:ss"
type="date" value-format="yyyy-MM-dd HH:mm:ss"
:picker-options="pickerOptions"
placeholder="选择计划完成日期" >
</el-date-picker>
</el-col> <font style="margin-left:5px;"></font>
</el-form-item>
<el-form-item label="发起部门" prop="deptid">
</el-form-item>
<el-form-item label="发起部门" prop="deptid">
<el-select v-model="addForm.deptid" clearable filterable placeholder="请选择">
<el-option
v-for="item in myDepts"
@ -40,16 +40,16 @@
:label="item.deptName"
:value="item.deptid">
</el-option>
</el-select>
</el-select>
<el-popover
placement="top-start"
title="设置主办监控人"
width="400"
trigger="manual" v-model="sponsorsAndMonitorsVisible">
<el-row>
trigger="manual" v-model="sponsorsAndMonitorsVisible">
<el-row>
<el-col :span="24" style="padding-top:5px;">
<font class="more-label-font">主办人:</font>
<font class="more-label-font">主办人:</font>
<el-select disabled value-key="userid" v-model="sponsors" multiple placeholder="请选择">
<el-option
v-for="item in baseUserList"
@ -59,10 +59,10 @@
<span style="float: left">{{ item.username }}</span>
<span style="float: right; color: #8492a6; font-size: 14px">{{ item.shortName }}</span>
</el-option>
</el-select>
</el-col>
</el-select>
</el-col>
<el-col :span="24" style="padding-top:5px;">
<font class="more-label-font">监控人:</font>
<font class="more-label-font">监控人:</font>
<el-select disabled value-key="userid" v-model="monitors" multiple placeholder="请选择">
<el-option
v-for="item in baseUserList"
@ -72,42 +72,42 @@
<span style="float: left">{{ item.username }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.shortName }}</span>
</el-option>
</el-select>
</el-col>
</el-select>
</el-col>
</el-row>
<el-button slot="reference" icon="el-icon-s-check" @click="showSponsorsAndMonitors">主办人监控人查询</el-button>
</el-popover>
</el-form-item>
</el-popover>
</el-form-item>
<div v-if="addForm.isRefForm=='1' && addForm.formId!=null && addForm.formId!='' && addForm.formShowType!='table' ">
<form-data-mng-for-flow-form :form-data-id="filters.formDataId" :qxCode="addForm.mainQx" :isFlowStart="true" :form-id="addForm.formId" :submit-event="formDataSubmitEvent" @submit="startSubmit"><div></div></form-data-mng-for-flow-form>
<form-data-mng-for-flow-form :form-data-id="filters.formDataId" :qxCode="addForm.mainQx" :isFlowStart="true" :form-id="addForm.formId" :submit-event="formDataSubmitEvent" @submit="startSubmit"><div></div></form-data-mng-for-flow-form>
</div>
<el-form-item label="流程正文" prop="mainContext" v-loading="listLoading">
<vue-editor v-if="screenWidth>=500" :branch-id="userInfo.branchId" v-model="addForm.mainContext"></vue-editor>
</el-form-item>
<vue-editor v-if="screenWidth<500" :branch-id="userInfo.branchId" v-model="addForm.mainContext"></vue-editor>
<vue-editor v-if="screenWidth>=500" :branch-id="userInfo.branchId" v-model="addForm.mainContext"></vue-editor>
</el-form-item>
<vue-editor v-if="screenWidth<500" :branch-id="userInfo.branchId" v-model="addForm.mainContext"></vue-editor>
<el-form-item label="流程附件" prop="attachment">
<el-button @click="showAttachment=!showAttachment">{{showAttachment==true?"隐藏附件":"显示附件"}}</el-button>
<el-col v-if="showAttachment" :span="24">
<el-col :xs="20" :sm="18" :md="16" :lg="14" :xl="12"><attachment-upload :branch-id="userInfo.branchId" :deptid="userInfo.deptid" :archive-id="addForm.id" :category-id="procdef.categoryId"></attachment-upload></el-col>
<el-col :xs="4" :sm="6" :md="8" :lg="10" :xl="12">
<el-popover
<el-popover
placement="top"
width="600"
trigger="click"
v-model="modelFilesVisible">
<div style="text-align: right; margin: 0">
v-model="modelFilesVisible">
<div style="text-align: right; margin: 0">
<attachment-upload :branch-id="userInfo.branchId" :deptid="userInfo.deptid" :archive-id="procdef.id" :category-id="procdef.categoryId"></attachment-upload>
</div>
</div>
<el-button slot="reference" class="hidden-sm-and-down" v-on:click="modelFilesVisible=!modelFilesVisible">模板</el-button>
</el-popover>
</el-col>
</el-col>
</el-form-item>
</el-form-item>
<el-form-item label="流程权限" prop="mainQx">
<el-button @click="showMainQxDialog">点击查看/设置流程权限</el-button><el-button @click="showNodeInfoDialog">配置审批人</el-button>
</el-form-item>
<el-form-item v-show="needAssignee!=''" label="下一步执行人" prop="needAssignee">
<el-form-item v-show="needAssignee!=''" label="下一步执行人" prop="needAssignee">
<el-col :span="16">
<el-select style="width:60%" value-key="userid" v-model="nextAssigneeList" multiple placeholder="请选择">
<el-option
@ -119,33 +119,33 @@
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.shortName }}</span>
</el-option>
</el-select>
<el-button @click.native="userSelectVisible=true" :loading="addLoading">更多人员</el-button>
<el-button @click.native="userSelectVisible=true" :loading="addLoading">更多人员</el-button>
</el-col>
</el-form-item>
<el-form-item>
<el-button @click.native="handleCancel" icon="el-icon-back">取消</el-button>
<el-button type="primary" @click.native="startHandle" :loading="addLoading" icon="el-icon-finished">发起流程</el-button>
</el-form-item>
</el-form>
</el-form-item>
<el-form-item>
<el-button @click.native="handleCancel" icon="el-icon-back">取消</el-button>
<el-button type="primary" @click.native="startHandle" :loading="addLoading" icon="el-icon-finished">发起流程</el-button>
</el-form-item>
</el-form>
</el-col>
<el-dialog append-to-body
title="配置流程总体权限"
:visible.sync="mainQxVisible"
width="60%">
<act-qx-code-set :qxType="'mainQx'" :formFields="formFields" :visible="mainQxVisible" :qxCode="addForm.mainQx" @cancel="onMainQxCancel" @confirm="onMainQxSelected"></act-qx-code-set>
width="60%">
<act-qx-code-set :qxType="'mainQx'" :formFields="formFields" :visible="mainQxVisible" :qxCode="addForm.mainQx" @cancel="onMainQxCancel" @confirm="onMainQxSelected"></act-qx-code-set>
</el-dialog>
<el-dialog append-to-body
title="配置审批人"
:visible.sync="nodeInfoVisible"
fullscreen
>
<procinst-node-info-set :node-infos="nodeInfos" :visible="nodeInfoVisible" @cancel="onNodeInfosCancel" @confirm="onNodeInfosConfirm"></procinst-node-info-set>
>
<procinst-node-info-set :node-infos="nodeInfos" :visible="nodeInfoVisible" @cancel="onNodeInfosCancel" @confirm="onNodeInfosConfirm"></procinst-node-info-set>
</el-dialog>
<el-dialog
title="流程图"
:visible.sync="displayDiagram"
width="80%" append-to-body >
width="80%" append-to-body >
<el-image :fit="'contain'" :src="diagramUrl">
<div slot="error" class="image-slot">
<i class="el-icon-picture-outline"></i>
@ -153,22 +153,22 @@
<div slot="placeholder" class="image-slot">
正在全力加载中<i class="el-icon-loading"></i>
</div>
</el-image>
<span slot="footer" class="dialog-footer">
</el-image>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="displayDiagram = false">关闭</el-button>
</span>
</el-dialog>
<el-dialog append-to-body
title="设置标签"
:visible.sync="tagSelectVisible"
width="60%">
<tag-mng :tagIds="addForm.tagIds==null?null:addForm.tagIds.split(',')" :jump="true" @select-confirm="onTagSelected"></tag-mng>
width="60%">
<tag-mng :tagIds="addForm.tagIds==null?null:addForm.tagIds.split(',')" :jump="true" @select-confirm="onTagSelected"></tag-mng>
</el-dialog>
<el-dialog append-to-body
title="选择员工"
:visible.sync="userSelectVisible"
width="60%">
<users-select :select-userids="nextAssigneeList.map(i=>i.userid)" @confirm="onUserSelected"></users-select>
width="60%">
<users-select :select-userids="nextAssigneeList.map(i=>i.userid)" @confirm="onUserSelected"></users-select>
</el-dialog>
</el-row>
</section>
@ -176,21 +176,21 @@
<script>
import seq from '@/common/js/sequence';//
import util from '@/common/js/util';//import
import config from '@/common/config';//import
import { listUserNames } from '@/api/mdp/sys/user';
import { startProc } from '@/api/mdp/workflow/ru/execution';
import AttachmentUpload from '@/views/mdp/arc/archiveAttachment/AttachmentUpload';
import util from '@/common/js/util';//import
import config from '@/common/config';//import
import { listUserNames } from '@/api/mdp/sys/user';
import { startProc } from '@/api/mdp/workflow/ru/execution';
import AttachmentUpload from '@/views/mdp/arc/archiveAttachment/AttachmentUpload';
import FormDataMngForFlowForm from '@/views/mdp/form/formData/FormDataMngForFlowForm';//
import VueEditor from '@/components/VueEditor/Index';
import VueEditor from '@/components/Tinymce/index';
import Sticky from '@/components/Sticky' // header
import { mapGetters } from 'vuex'
import TagMng from '@/views/mdp/arc/tag/TagMng';
import UsersSelect from '@/views/mdp/sys/user/UsersSelect';
import ActQxCodeSet from '@/views/mdp/workflow/re/procdefParames/ActQxCodeSet';
import ProcinstNodeInfoSet from '@/views/mdp/workflow/ru/procinstParames/ProcinstNodeInfoSet';
import { getBpmnActAssignees } from '@/api/mdp/workflow/re/procdefNodeInfo';
import TagMng from '@/views/mdp/arc/tag/TagMng';
import UsersSelect from '@/views/mdp/sys/user/UsersSelect';
import ActQxCodeSet from '@/views/mdp/workflow/re/procdefParames/ActQxCodeSet';
import ProcinstNodeInfoSet from '@/views/mdp/workflow/ru/procinstParames/ProcinstNodeInfoSet';
import { getBpmnActAssignees } from '@/api/mdp/workflow/re/procdefNodeInfo';
export default {
name:'ProcinstParamesStartSet',
@ -198,7 +198,7 @@
...mapGetters([
'userInfo','myDepts'
]),
screenWidth:function(){
return screen.width;
},
@ -210,7 +210,7 @@
if(visible==true){
if(!this.procdef){
return;
}
}
this.initByProcdef();
this.needAssignee=''
this.needAssigneeNum=-1;
@ -219,23 +219,23 @@
this.initByParams();
this.initBaseUserList();
}
},
},
'nextAssigneeList':function(nextAssigneeList){
this.$refs.addForm.validateField('needAssignee');
}
},
},
data() {
var validateNeedAssignee = (rule, value, callback) => {
if(this.needAssignee=='need-mulit-assignee' && this.nextAssigneeList.length<this.needAssigneeNum){//need-mulit-assignee 需要一个或者多个 need-single-assignee 只需要一个
callback(new Error(this.needAssigneeMsg));
callback(new Error(this.needAssigneeMsg));
}else if(this.needAssignee=='need-single-assignee' ){
if(this.nextAssigneeList.length<=0 ){
callback(new Error(this.needAssigneeMsg));
}else if(this.nextAssigneeList.length>1 ){
callback(new Error('只允许指定一个执行人'));
}
}
callback();
if(this.nextAssigneeList.length<=0 ){
callback(new Error(this.needAssigneeMsg));
}else if(this.nextAssigneeList.length>1 ){
callback(new Error('只允许指定一个执行人'));
}
}
callback();
};
return {
filters:{
@ -249,7 +249,7 @@
bizPkId:'',//
bizParentPkid:'',//bizPkid
formDataId:'',//form
extVars:{ //
extVars:{ //
},
flowVars:{//,flowVarspostrestUrl
@ -340,17 +340,17 @@
id:'',isRefForm:'',monitors:'',sponsors:'',formId:'',procDefId:'',userid:'',lastDate:'',mainContext:'',mainTitle:'',categoryId:'',formShowType:''
},
sponsors:[],//
monitors:[],//
monitors:[],//
formDataSubmitEvent:false,
needAssignee:'',//
needAssigneeMsg:'',//
needAssigneeNum:-1,
nextAssigneeList: [],
activeTab:'flowinfoTab',
diagramUrl:'',
diagramUrl:'',
displayDiagram:false,
modelFilesVisible:false,
baseUserList:[],
baseUserList:[],
userSelectVisible:false,
tagSelectVisible:false,
mainQxVisible:false,
@ -371,19 +371,19 @@
this.$emit('cancel');
},
//ProcinstParames @submit="afterAddSubmit"
startSubmit: function (formData) {
startSubmit: function (formData) {
this.$refs.addForm.validate((valid) => {
if (valid) {
this.$confirm('确认提交吗?', '提示', {}).then(() => {
let params = {procinstParames:this.addForm,formData:formData};
let params = {procinstParames:this.addForm,formData:formData};
if(this.params){
params.extVars=this.params.extVars
params.flowVars=this.params.flowVars
}
this.addLoading = true;
this.addLoading = true;
params.procinstParames.startDeptName=this.myDepts.filter(d=>d.deptid==this.addForm.deptid)[0].deptName;
params.procinstParames.startUsername=this.userInfo.username
params.procinstParames.userid=this.userInfo.userid
@ -394,7 +394,7 @@
params.nodeInfos=this.nodeInfos
console.log(params);
startProc(params).then((res) => {
this.addLoading = false;
this.addLoading = false;
var tips=res.data.tips;
if(tips.isOk){
this.$refs['addForm'].resetFields();
@ -402,7 +402,7 @@
this.needAssignee='';
this.needAssigneeMsg='';
this.$emit('submit');// @submit="afterAddSubmit"
this.$message({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' });
this.$message({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' });
this.handleCancel();
}else if(tips.tipscode=='need-mulit-assignee'){//need-mulit-assignee need-single-assignee
this.needAssignee=tips.tipscode
@ -415,9 +415,9 @@
this.needAssigneeNum=1;
this.$refs.addForm.validateField('needAssignee');
}else{
this.$message({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' });
this.$message({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' });
}
}).catch(() => {
this.addLoading = false;
});
@ -428,21 +428,21 @@
/**begin 在下面加自定义方法,记得补上面的一个逗号**/
// ProcdefParames
getProcdefParamess() {
//
},
handleUploadChange(){
},
onUserSelected: function(users){
onUserSelected: function(users){
users.forEach(u=>{
if(!this.baseUserList.some(i=>i.userid==u.userid)){
this.baseUserList.push(u);
}
this.userSelectVisible=false;
}
this.userSelectVisible=false;
this.nextAssigneeList=users;
})
},
initBaseUserList(sponsorsAndMonitorsVisible){
@ -455,7 +455,7 @@
sponsors=[{userid:currentUserid,username:currentUsername}]
}else{
sponsors=that.addForm.sponsors.split(',').map(i=>{return {userid:i,username:i==currentUserid?currentUsername:i}});
}
}
//console.log("monitors-----------"+this.addForm.monitors);
//console.log("sponsors-----------"+this.addForm.sponsors);
//console.log("userInfo.userid-----------"+this.userInfo.userid);
@ -463,7 +463,7 @@
monitors=[{userid:currentUserid,username:currentUsername}]
}else{
monitors=that.addForm.monitors.split(',').map(i=>{return {userid:i,username:i==currentUserid?currentUsername:i}});
}
}
var userids=[].concat(sponsors.map(u=>u.userid)).concat(monitors.map(u=>u.userid));
var baseUserList=sponsors.concat(monitors.filter(m=>!sponsors.some(s=>s.userid==m.userid)))
var baseUserListNoIncludeMe=baseUserList.filter(i=>i.userid!=currentUserid);
@ -471,13 +471,13 @@
if(baseUserListNoIncludeMe.length<=0){
that.monitors=monitors
that.sponsors=sponsors
that.baseUserList=baseUserList
that.baseUserList=baseUserList
this.sponsorsAndMonitorsVisible=sponsorsAndMonitorsVisible
return;
}else{
listUserNames({userids:baseUserList.map(i=>i.userid),branchId:that.userInfo.branchId}).then(res=>{
if(res.data.tips.isOk){
baseUserList=res.data.data
baseUserList=res.data.data
baseUserList.forEach(u=>{
monitors.forEach((m,index)=>{
if(m.userid==u.userid){
@ -497,32 +497,32 @@
this.sponsorsAndMonitorsVisible=sponsorsAndMonitorsVisible
});
}
},
showDiagram(){
this.diagramUrl=config.getBaseDomainUrl()+config.getWorkflowBasePath()+"/mdp/workflow/re/procdef/diagram/"+this.procdef.id;
this.displayDiagram=true;
},
startHandle(){
startHandle(){
var date=new Date();
if(!this.monitors || this.monitors.length==0){
this.$message.error("监控人不能为空");
return;
}
if(!this.sponsors || this.sponsors.length==0){
this.$message.error("主办人不能为空");
return;
}
this.formDataSubmitEvent=date.getTime();
this.formDataSubmitEvent=date.getTime();
if(this.addForm.formId==''||this.addForm.formId==null || this.addForm.isRefForm!='1'){
this.startSubmit()
}
},
labelWidth:function(){
if (screen.width <=375){
return "80px"
@ -537,11 +537,11 @@
onTagSelected:function(tags){
this.tagSelectVisible=false;
console.log("tags"+JSON.stringify(tags));
this.addForm.tagIds=tags.map(t=>t.tagId).join(",");
this.addForm.tagNames=tags.map(t=>t.tagName).join(",");
this.addForm.tagIds=tags.map(t=>t.tagId).join(",");
this.addForm.tagNames=tags.map(t=>t.tagName).join(",");
},
},
onMainQxSelected:function(qxCode){
this.mainQxVisible=false;
this.addForm.mainQx=qxCode;
@ -553,31 +553,31 @@
this.nodeInfoVisible=false;
this.nodeInfos=nodeInfos
},
onMainQxCancel:function(){
this.mainQxVisible=false;
this.mainQxVisible=false;
},
showMainQxDialog:function(){
this.mainQxVisible=true;
this.mainQxVisible=true;
},
showNodeInfoDialog:function(){
if(this.nodeInfos==null || this.nodeInfos.length==0){
this.listBpmnActAssignees(true)
}else{
this.nodeInfoVisible=true;
}
}
},
onFormFieldsLoad:function(formFields){
this.formFields=formFields;
},
initByParams(){
if(this.params){
this.filters.params=this.params;
if( this.params.formId && this.params.formDataId){
if( this.params.formId && this.params.formDataId){
this.addForm.formId=this.params.formId
this.filters.formDataId=this.params.formDataId
}
}
if(this.params.mainTitle!='' && this.params.mainTitle!=null){
this.addForm.mainTitle=this.params.mainTitle
}
@ -586,70 +586,70 @@
}
if(this.params.bizUrl!='' && this.params.bizUrl!=null ){
this.addForm.mainContext=this.addForm.mainContext+'<br><p><a href='+this.params.bizUrl+' target="_blank">'+'点击查看业务数据'+'</a></p>'
}
}
if(this.params.restUrl!='' && this.params.restUrl!=null){
this.addForm.restUrl=this.params.restUrl
}
}
if(this.params.bizKey!='' && this.params.bizKey!=null){
this.addForm.bizKey=this.params.bizKey
}
}
}
},
initByProcdef(){
//this.addForm=Object.assign(this.addForm, this.procdef);
this.addForm.id=seq.sn();
this.addForm.procDefId=this.procdef.id;
this.addForm.procDefId=this.procdef.id;
this.addForm.modelKey=this.procdef.key;
this.addForm.mainTitle=(this.procdef.mainTitle!=null && this.procdef.mainTitle!='')?this.procdef.mainTitle:this.procdef.name;
this.addForm.mainContext=this.procdef.mainContext;
this.addForm.deptid=this.userInfo.deptid;
this.addForm.userid=this.userInfo.userid;
this.addForm.branchId=this.userInfo.branchId;
this.addForm.formId=this.procdef.formId;
this.addForm.isRefForm=this.procdef.isRefForm;
this.addForm.branchId=this.userInfo.branchId;
this.addForm.formId=this.procdef.formId;
this.addForm.isRefForm=this.procdef.isRefForm;
this.addForm.monitors=(this.procdef.monitors!=null && this.procdef.monitors!='')?this.procdef.monitors:this.userInfo.userid;
this.addForm.sponsors=(this.procdef.sponsors!=null && this.procdef.sponsors!='')?this.procdef.sponsors:this.userInfo.userid;
var planFinishTime = new Date();
this.addForm.sponsors=(this.procdef.sponsors!=null && this.procdef.sponsors!='')?this.procdef.sponsors:this.userInfo.userid;
var planFinishTime = new Date();
planFinishTime.setTime(planFinishTime.getTime() + 3600 * 1000 * 24 * 7);
this.addForm.planFinishTime=util.formatDate.format(planFinishTime,'yyyy-MM-dd hh:mm:ss')
this.addForm.tagIds=this.procdef.tagIds;
this.addForm.tagNames=this.procdef.tagNames;
this.addForm.mainQx=this.procdef.mainQx;
},
showSponsorsAndMonitors(){
if( (this.monitors==null || this.monitors.length==0 || this.sponsors==null||this.sponsors.length==0) && this.sponsorsAndMonitorsVisible==false ){
this.initBaseUserList(true)
}else{
this.sponsorsAndMonitorsVisible=!this.sponsorsAndMonitorsVisible;
}
}
},
listBpmnActAssignees(nodeInfoVisible){
this.nodeInfos=[];
this.nodeInfos=[];
this.listLoading = true;
let params = { };
let params = { };
params.procDefId=this.procdef.id
getBpmnActAssignees(params).then(res=>{
var tips=res.data.tips;
this.listLoading = false;
if(tips.isOk){
if(tips.isOk){
this.nodeInfos=res.data.data;
if(nodeInfoVisible==true){
this.nodeInfos=res.data.data;
if(nodeInfoVisible==true){
this.nodeInfoVisible=true
}
}else{
this.$message({showClose: true, message: tips.msg, type: 'error' });
}
});
});
},
/**end 在上面加自定义方法**/
},//end method
components: {
components: {
// 'procinst-parames-edit':ProcinstParamesEdit
'form-data-mng-for-flow-form':FormDataMngForFlowForm,
'form-data-mng-for-flow-form':FormDataMngForFlowForm,
'vue-editor':VueEditor,
'attachment-upload':AttachmentUpload,
'sticky': Sticky,UsersSelect,TagMng,ActQxCodeSet,ProcinstNodeInfoSet
@ -660,9 +660,9 @@
this.initByParams();// params params
//this.listBpmnActAssignees();
this.initBaseUserList();
});
});
/**在下面写其它函数***/
}//end mounted
}
@ -670,4 +670,4 @@
<style scoped>
</style>
</style>

4
src/views/xm/core/components/headEditor.vue

@ -16,7 +16,7 @@
<script>
import util from '@/common/js/util';//
import { mapGetters } from 'vuex';
import VueEditor from '@/components/VueEditor';
import VueEditor from '@/components/Tinymce/index';
import {sn} from '@/common/js/sequence';
export default {
props:["id","user","projectId","taskId","quoteId","replyId"],
@ -83,4 +83,4 @@ export default {
clear: both;
content: "";
}
</style>
</style>

12
src/views/xm/core/xmExchange/TaskUserEditor.vue

@ -9,7 +9,7 @@
<vue-editor :id="id" :branch-id="userInfo.branchId" :category-id="projectId+'-'+taskId" v-model="content"></vue-editor>
</div>
<div style="margin-top:20px;"></div>
<el-button @click="publish" class="toolbar" type="primary">发布</el-button> <el-button @click="clearContent" style="margin-right: 0.25rem;" class="toolbar" type="plain"></el-button>
<el-button @click="publish" class="toolbar" type="primary">发布</el-button> <el-button @click="clearContent" style="margin-right: 0.25rem;" class="toolbar" type="plain"></el-button>
</div>
</div>
</template>
@ -17,7 +17,7 @@
<script>
import util from '@/common/js/util';//
import { mapGetters } from 'vuex';
import VueEditor from '@/components/VueEditor';
import VueEditor from '@/components/Tinymce/index';
import {sn} from '@/common/js/sequence';
export default {
props:['id',"projectId","taskId",'user'],
@ -34,13 +34,13 @@ export default {
methods: {
publish() {
let params = {
content: this.content,
content: this.content,
}
if(!this.content){
this.$message.error("请输入内容再提交");
return;
}
this.$emit('publish',params);
}
this.$emit('publish',params);
},
clearContent(){
this.content="";
@ -76,4 +76,4 @@ export default {
clear: both;
content: "";
}
</style>
</style>

44
src/views/xm/core/xmFile/XmFileAdd.vue

@ -1,15 +1,15 @@
<template>
<section class="page-container page-full-height padding border">
<el-row>
<!--新增界面 XmFile xm_file-->
<!--新增界面 XmFile xm_file-->
<el-form :model="addForm" label-width="120px" :rules="addFormRules" ref="addForm">
<el-form-item label="项目名称">
{{addForm.projectName}}
<!-- <el-input v-model="addForm.projectName" placeholder="项目名称" ></el-input> -->
</el-form-item>
</el-form-item>
<el-form-item label="文件名称" prop="name">
<el-input v-model="addForm.name" placeholder="文件名称" ></el-input>
</el-form-item>
</el-form-item>
<el-form-item label="文件说明" prop="description">
<vue-editor :branch-id="userInfo.branchId" v-model="addForm.description"></vue-editor>
</el-form-item>
@ -18,13 +18,13 @@
</el-form-item>
<el-form-item label="创建人">
{{userInfo.username}}
</el-form-item>
</el-form-item>
<el-form-item>
<el-col :span="24" :offset="8">
<el-button @click.native="handleCancel">取消</el-button>
<el-button v-loading="load.add" type="primary" @click.native="addSubmit" :disabled="load.add==true">提交</el-button>
<el-col :span="24" :offset="8">
<el-button @click.native="handleCancel">取消</el-button>
<el-button v-loading="load.add" type="primary" @click.native="addSubmit" :disabled="load.add==true">提交</el-button>
</el-col>
</el-form-item>
</el-form-item>
</el-form>
</el-row>
</section>
@ -32,14 +32,14 @@
<script>
import util from '@/common/js/util';//
//import { listOption } from '@/api/mdp/meta/itemOption';//
//import { listOption } from '@/api/mdp/meta/itemOption';//
import { addXmFile } from '@/api/xm/core/xmFile';
import { mapGetters } from 'vuex';
import VueEditor from '@/components/VueEditor';
import VueEditor from '@/components/Tinymce/index';
import AttachmentUpload from "@/views/mdp/arc/archiveAttachment/AttachmentUpload"; //
import {sn} from '@/common/js/sequence';
export default {
export default {
computed: {
...mapGetters([
'userInfo','roles'
@ -55,11 +55,11 @@
if(visible==true){
//
}
}
}
},
data() {
return {
options:{},// params=[{categoryId:'0001',itemCode:'sex'}] {'sex':[{optionValue:'1',optionName:'',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'',seqOrder:'2',fp:'',isDefault:'0'}]}
options:{},// params=[{categoryId:'0001',itemCode:'sex'}] {'sex':[{optionValue:'1',optionName:'',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'',seqOrder:'2',fp:'',isDefault:'0'}]}
load:{ list: false, edit: false, del: false, add: false },//...
addFormRules: {
id: [
@ -86,9 +86,9 @@
addSubmit: function () {
this.$refs.addForm.validate((valid) => {
if (valid) {
this.$confirm('确认提交吗?', '提示', {}).then(() => {
this.$confirm('确认提交吗?', '提示', {}).then(() => {
this.load.add=true
let params = Object.assign({}, this.addForm);
let params = Object.assign({}, this.addForm);
addXmFile(params).then((res) => {
this.load.add=false
var tips=res.data.tips;
@ -96,7 +96,7 @@
this.$refs['addForm'].resetFields();
this.$emit('submit');// @submit="afterAddSubmit"
}
this.$message({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' });
this.$message({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err => this.load.add=false);
});
}
@ -127,11 +127,11 @@
}
/**begin 在下面加自定义方法,记得补上面的一个逗号**/
/**end 在上面加自定义方法**/
},//end method
components: {
components: {
'upload': AttachmentUpload,
'vue-editor' :VueEditor,
// 'xm-file-edit':XmFileEdit
@ -140,7 +140,7 @@
this.addForm=Object.assign(this.addForm, this.xmFile);
this.setDefaultData();
/**在下面写其它函数***/
}//end mounted
}
@ -150,4 +150,4 @@
.el-form-item__content{
margin-left: 0;
}
</style>
</style>

48
src/views/xm/core/xmFile/XmFileEdit.vue

@ -1,14 +1,14 @@
<template>
<section class="page-container page-full-height padding border">
<el-row>
<!--编辑界面 XmFile xm_file-->
<el-row>
<!--编辑界面 XmFile xm_file-->
<el-form :model="editForm" label-width="120px" :rules="editFormRules" ref="editForm">
<el-form-item label="项目名称" prop="projectName">
{{editForm.projectName}}
</el-form-item>
</el-form-item>
<el-form-item label="文件名称" prop="name">
<el-input v-model="editForm.name" placeholder="文件名称"></el-input>
</el-form-item>
</el-form-item>
<el-form-item label="文件说明" prop="description">
<vue-editor :branch-id="userInfo.branchId" v-model="editForm.description"></vue-editor>
</el-form-item>
@ -17,16 +17,16 @@
</el-form-item>
<el-form-item label="创建人" prop="createUsername">
{{editForm.createUsername}}
</el-form-item>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
{{editForm.createTime}}
</el-form-item>
<el-form-item>
<el-col :span="24" :offset="8">
<el-button @click.native="handleCancel">取消</el-button>
<el-button v-loading="load.edit" type="primary" @click.native="editSubmit" :disabled="load.edit==true">提交</el-button>
</el-col>
</el-form-item>
</el-form-item>
<el-form-item>
<el-col :span="24" :offset="8">
<el-button @click.native="handleCancel">取消</el-button>
<el-button v-loading="load.edit" type="primary" @click.native="editSubmit" :disabled="load.edit==true">提交</el-button>
</el-col>
</el-form-item>
</el-form>
</el-row>
</section>
@ -37,10 +37,10 @@
//import { listOption } from '@/api/mdp/meta/itemOption';//
import { editXmFile } from '@/api/xm/core/xmFile';
import { mapGetters } from 'vuex'
import VueEditor from '@/components/VueEditor';
import VueEditor from '@/components/Tinymce/index';
import AttachmentUpload from "@/views/mdp/arc/archiveAttachment/AttachmentUpload"; //
export default {
export default {
computed: {
...mapGetters([
'userInfo','roles'
@ -51,15 +51,15 @@
'xmFile':function( xmFile ) {
this.editForm = xmFile;
},
'visible':function(visible) {
'visible':function(visible) {
if(visible==true){
//
}
}
}
},
data() {
return {
options:{},// params=[{categoryId:'0001',itemCode:'sex'}] {'sex':[{optionValue:'1',optionName:'',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'',seqOrder:'2',fp:'',isDefault:'0'}]}
options:{},// params=[{categoryId:'0001',itemCode:'sex'}] {'sex':[{optionValue:'1',optionName:'',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'',seqOrder:'2',fp:'',isDefault:'0'}]}
load:{ list: false, edit: false, del: false, add: false },//...
editFormRules: {
id: [
@ -86,9 +86,9 @@
editSubmit: function () {
this.$refs.editForm.validate((valid) => {
if (valid) {
this.$confirm('确认提交吗?', '提示', {}).then(() => {
this.$confirm('确认提交吗?', '提示', {}).then(() => {
this.load.edit=true
let params = Object.assign({}, this.editForm);
let params = Object.assign({}, this.editForm);
editXmFile(params).then((res) => {
this.load.edit=false
var tips=res.data.tips;
@ -96,7 +96,7 @@
this.$refs['editForm'].resetFields();
this.$emit('submit');// @submit="afterEditSubmit"
}
this.$message({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' });
this.$message({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err =>this.load.edit=false);
});
}
@ -121,13 +121,13 @@
}
/**end 在上面加自定义方法**/
},//end method
components: {
components: {
// 'xm-file-edit':XmFileEdit
'upload': AttachmentUpload,
'vue-editor' :VueEditor,
},
mounted() {
this.editForm=Object.assign(this.editForm, this.xmFile);
this.editForm=Object.assign(this.editForm, this.xmFile);
}
}
@ -135,4 +135,4 @@
<style scoped>
</style>
</style>

10
src/views/xm/core/xmMenuExchange/MenuUserEditor.vue

@ -9,7 +9,7 @@
<vue-editor :id="id" :branch-id="userInfo.branchId" :category-id="productId+'-'+menuId" v-model="content"></vue-editor>
</div>
<div style="margin-top:20px;"></div>
<el-button @click="publish" class="toolbar" type="primary">发布</el-button> <el-button @click="clearContent" style="margin-right: 0.25rem;" class="toolbar" type="plain"></el-button>
<el-button @click="publish" class="toolbar" type="primary">发布</el-button> <el-button @click="clearContent" style="margin-right: 0.25rem;" class="toolbar" type="plain"></el-button>
</div>
</div>
</template>
@ -17,7 +17,7 @@
<script>
import util from '@/common/js/util';//
import { mapGetters } from 'vuex';
import VueEditor from '@/components/VueEditor';
import VueEditor from '@/components/Tinymce/index';
import {sn} from '@/common/js/sequence';
export default {
props:['id',"productId","menuId",'user'],
@ -34,13 +34,13 @@ export default {
methods: {
publish() {
let params = {
content: this.content,
content: this.content,
}
if(!this.content){
this.$message.error("请输入内容再提交");
return;
}
this.$emit('publish',params);
this.$emit('publish',params);
},
clearContent(){
this.content="";
@ -76,4 +76,4 @@ export default {
clear: both;
content: "";
}
</style>
</style>

28
src/views/xm/core/xmProject/XmProjectAssess.vue

@ -31,13 +31,13 @@
<el-form-item label="项目考核" >
<el-input v-if="Eligible" style="width:auto !important;" v-model="selProject.assess" type="number" min="0"></el-input>
<span v-else>{{selProject.assess}}</span>
</el-form-item>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="考核备注" >
<vue-editor v-if="Eligible" :branch-id="userInfo.branchId" v-model="selProject.assessRemarks"></vue-editor>
<span v-else>{{selProject.assessRemarks}}</span>
</el-form-item>
</el-form-item>
</el-col>
</el-form>
</el-row>
@ -49,10 +49,10 @@
//import Sticky from '@/components/Sticky' // header
//import { listOption } from '@/api/mdp/meta/itemOption';//
import { mapGetters } from 'vuex';
import VueEditor from '@/components/VueEditor';
import VueEditor from '@/components/Tinymce/index';
import { editAssess, listXmProject, delXmProject, batchDelXmProject } from '@/api/xm/core/xmProject';
export default {
export default {
props: ["selProject"],
computed: {
...mapGetters([
@ -83,7 +83,7 @@
},
xmProjects: [],//
load:{ list: false, edit: false, del: false, add: false },//...
editFormVisible: false,//
//xmProject
editForm: {
@ -125,23 +125,23 @@
this.load.list = true;
listXmProject(params).then((res) => {
var tips=res.data.tips;
if(tips.isOk){
if(tips.isOk){
this.xmProjects = res.data.data;
console.log(this.xmProjects);
}else{
this.$message({showClose: true, message: tips.msg, type: 'error' });
}
}
this.load.list = false;
}).catch( err => this.load.list = false );
},
// XmProject xm_project
showEdit: function() {
let params = Object.assign({}, this.selProject);
let params = Object.assign({}, this.selProject);
editAssess(params).then((res) => {
console.log(res);
var tips=res.data.tips;
if(tips.isOk){
if(tips.isOk){
}
this.$message({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err => this.load.list = false);
@ -154,17 +154,17 @@
this.$emit('row-click',row, event, column);// @row-click="rowClick"
}
/**begin 自定义函数请在下面加**/
/**end 自定义函数请在上面加**/
},//end methods
components: {
components: {
//
'vue-editor' :VueEditor,
},
mounted() {
mounted() {
this.$nextTick(() => {
this.status = this.selProject.status;
});
});
}
}
@ -200,4 +200,4 @@
text-overflow: ellipsis;
white-space: nowrap;
}
</style>
</style>

154
src/views/xm/core/xmQuestion/XmQuestionAdd.vue

@ -5,45 +5,45 @@
<el-step title="已激活,待确认" description="创建后自动激活、关闭后重新激活)"></el-step>
<el-step title="已确认,待解决" description="业务确认缺陷后变为已确认"></el-step>
<el-step title="已解决,待关闭" description="开发修复缺陷后,变成已解决"></el-step>
<el-step title="已关闭(可重新激活)" description="测试通过后变为已关闭,已关闭缺陷可以重新激活"></el-step>
<el-step title="已关闭(可重新激活)" description="测试通过后变为已关闭,已关闭缺陷可以重新激活"></el-step>
</el-steps>
</el-row>
<el-row class="page-main page-height-80 padding">
<el-form :model="addForm" :rules="addFormRules" ref="addForm">
<el-row class="page-main page-height-80 padding">
<el-form :model="addForm" :rules="addFormRules" ref="addForm">
<el-form-item label="缺陷标题" prop="name">
<el-input v-model="addForm.name" placeholder="缺陷标题" ></el-input>
</el-form-item>
</el-form-item>
<el-form-item label="隶属" prop="taskName">
<el-tooltip content="隶属项目"><el-tag :closable="!selProject" @click="showProjectList" @close.stop="clearProject">{{this.filters.selProject?this.filters.selProject.name:'未关联项目'}}</el-tag></el-tooltip>
<el-tooltip content="隶属项目"><el-tag :closable="!selProject" @click="showProjectList" @close.stop="clearProject">{{this.filters.selProject?this.filters.selProject.name:'未关联项目'}}</el-tag></el-tooltip>
<el-divider direction="vertical"></el-divider>
<el-tooltip content="隶属任务"><el-tag closable @click="showSelectTask" @close.stop="handleCloseTaskTag">{{addForm.taskName?addForm.taskName:'未关联任务'}}</el-tag> </el-tooltip>
<el-divider direction="vertical"></el-divider>
<el-tooltip content="隶属故事"><el-tag closable @click="showSelectMenu" @close.stop="handleCloseMenuTag">{{addForm.menuName?addForm.menuName:"未关联故事"}}</el-tag></el-tooltip>
</el-form-item>
</el-form-item>
<el-form-item label="缺陷属性" prop="priority">
<el-col :span="24">
<el-select v-model="addForm.priority" placeholder="请选择紧急程度">
<el-option v-for="(i,index) in options['urgencyLevel']" :label="i.optionName" :value="i.optionValue" :key="i.optionValue">{{i.optionName}}</el-option>
</el-select>
<el-option v-for="(i,index) in options['urgencyLevel']" :label="i.optionName" :value="i.optionValue" :key="i.optionValue">{{i.optionName}}</el-option>
</el-select>
<el-select v-model="addForm.bugSeverity" placeholder="请选择严重程度">
<el-option v-for="(i,index) in options['bugSeverity']" :label="i.optionName" :value="i.optionValue" :key="i.optionValue">{{i.optionName}}</el-option>
</el-select>
<el-option v-for="(i,index) in options['bugSeverity']" :label="i.optionName" :value="i.optionValue" :key="i.optionValue">{{i.optionName}}</el-option>
</el-select>
<el-select v-model="addForm.solution" placeholder="请选择解决方案">
<el-option v-for="(i,index) in options['bugSolution']" :label="i.optionName" :value="i.optionValue" :key="i.optionValue">{{i.optionName}}</el-option>
</el-select>
<el-option v-for="(i,index) in options['bugSolution']" :label="i.optionName" :value="i.optionValue" :key="i.optionValue">{{i.optionName}}</el-option>
</el-select>
</el-col>
</el-form-item>
</el-form-item>
<el-form-item label="提出人" prop="askUsername">
<el-tag @click="showGroupUsers('askUsername')">{{addForm.askUsername?addForm.askUsername:'未关联提出人'}}</el-tag>
<el-tag @click="showGroupUsers('askUsername')">{{addForm.askUsername?addForm.askUsername:'未关联提出人'}}</el-tag>
<el-tooltip content="最晚解决时间"><el-date-picker :clearable="false" style="width:150px;" type="date" placeholder="选择日期" v-model="addForm.endTime" value-format="yyyy-MM-dd" format="yyyy-MM-dd"></el-date-picker></el-tooltip>
</el-form-item>
</el-form-item>
<el-form-item label="指派给" prop="handlerUsername">
{{addForm.handlerUsername}} <el-button @click="sendToAsk">指派给提出人</el-button><el-button @click="sendToCreater">指派给创建人</el-button><el-button @click="showGroupUsers('handlerUsername')">指派给其它人</el-button>
</el-form-item>
<el-form-item label="测试步骤" prop="opStep">
</el-form-item>
<el-form-item label="测试步骤" prop="opStep">
<el-tooltip content="点击切换为富文本编辑|普通文本">
<el-button icon="el-icon-refresh" @click="opStepEditorVisible=!opStepEditorVisible" type="text"></el-button>
</el-tooltip>
@ -51,11 +51,11 @@
<el-input style="width:100%;" v-model="addForm.opStep" type="textarea" :rows="2"> </el-input>
</div>
<div v-else>
<vue-editor :id="'opStep'+addForm.id" :branch-id="userInfo.branchId" v-model="addForm.opStep" ref="opStep"></vue-editor>
</div>
</el-form-item>
<el-form-item label="预期结果" prop="expectResult">
<vue-editor :id="'opStep'+addForm.id" :branch-id="userInfo.branchId" v-model="addForm.opStep" ref="opStep"></vue-editor>
</div>
</el-form-item>
<el-form-item label="预期结果" prop="expectResult">
<el-tooltip content="点击切换为富文本编辑|普通文本">
<el-button icon="el-icon-refresh" @click="expectResultEditorVisible=!expectResultEditorVisible" type="text"></el-button>
</el-tooltip>
@ -63,10 +63,10 @@
<el-input style="width:100%;" v-model="addForm.expectResult" type="textarea" :rows="2"> </el-input>
</div>
<div v-else>
<vue-editor v-if="expectResultEditorVisible==true" :id="'expectResult'+addForm.id" :branch-id="userInfo.branchId" v-model="addForm.expectResult" ref="expectResult"></vue-editor>
</div>
</el-form-item>
<el-form-item label="缺陷描述" prop="description">
<vue-editor v-if="expectResultEditorVisible==true" :id="'expectResult'+addForm.id" :branch-id="userInfo.branchId" v-model="addForm.expectResult" ref="expectResult"></vue-editor>
</div>
</el-form-item>
<el-form-item label="缺陷描述" prop="description">
<el-tooltip content="点击切换为富文本编辑|普通文本">
<el-button icon="el-icon-refresh" @click="descriptionEditorVisible=!descriptionEditorVisible" type="text"></el-button>
</el-tooltip>
@ -75,54 +75,54 @@
</div>
<div v-else>
<vue-editor :id="'description_'+addForm.id" :branch-id="userInfo.branchId" v-model="addForm.description"></vue-editor>
</div>
</el-form-item>
</div>
</el-form-item>
</el-form>
<el-drawer title="选中用户" :visible.sync="selectUserVisible" size="80%" append-to-body :close-on-click-modal="false">
<xm-group-mng :sel-project="filters.selProject" :is-select-single-user="1" @user-confirm="onUserConfirm"></xm-group-mng>
</el-drawer>
</el-drawer>
<el-drawer title="选中任务" :visible.sync="selectTaskVisible" fullscreen size="80%" append-to-body :close-on-click-modal="false">
<xm-task-list :sel-project="filters.selProject" @task-selected="onSelectedTask"></xm-task-list>
</el-drawer>
</el-drawer>
<el-drawer append-to-body title="故事选择" :visible.sync="selectMenuVisible" fullscreen :close-on-click-modal="false">
<xm-menu-select :is-select-menu="true" @selected="onSelectedMenu" :sel-project="filters.selProject"></xm-menu-select>
</el-drawer>
<el-drawer title="选中项目" :visible.sync="selectProjectVisible" size="80%" append-to-body :close-on-click-modal="false">
<xm-project-list @project-confirm="onPorjectConfirm"></xm-project-list>
</el-drawer>
</el-drawer>
</el-row>
<el-row>
<el-button @click.native="handleCancel">取消</el-button>
<el-button v-loading="load.add" type="primary" @click.native="addSubmit" :disabled="load.add==true">保存</el-button>
<el-row>
<el-button @click.native="handleCancel">取消</el-button>
<el-button v-loading="load.add" type="primary" @click.native="addSubmit" :disabled="load.add==true">保存</el-button>
</el-row>
</section>
</template>
<script>
import util from '@/common/js/util';//
import { listOption } from '@/api/mdp/meta/itemOption';//
import { listOption } from '@/api/mdp/meta/itemOption';//
import { addXmQuestion } from '@/api/xm/core/xmQuestion';
import { mapGetters } from 'vuex';
import AttachmentUpload from "@/views/mdp/arc/archiveAttachment/AttachmentUpload"; //
import {sn} from '@/common/js/sequence';
import VueEditor from '@/components/VueEditor';
import VueEditor from '@/components/Tinymce/index';
import XmGroupMng from '../xmProjectGroup/XmProjectGroupMng';
import xmMenuSelect from '../xmMenu/XmMenuSelect';
import xmMenuSelect from '../xmMenu/XmMenuSelect';
import XmProjectList from '../xmProject/XmProjectList';
import XmTaskList from '../xmTask/XmTaskList';
export default {
export default {
computed: {
...mapGetters([
'userInfo','roles'
]),
]),
},
props:['xmQuestion','visible',"selProject",'qtype','xmTestCaseExec','xmTestCase'],
watch: {
@ -141,7 +141,7 @@
},
selProject:function(selProject){
if(!selProject){
this.filters.selProject=null;
this.filters.selProject=null;
this.addForm.projectId=''
this.addForm.projectName=''
}else{
@ -156,13 +156,13 @@
filters:{
selProject:null,
},
options:{
options:{
urgencyLevel:[],
bugSeverity:[],
bugSolution:[],
bugStatus:[],
bugType:[],
},// params=[{categoryId:'0001',itemCode:'sex'}] {'sex':[{optionValue:'1',optionName:'',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'',seqOrder:'2',fp:'',isDefault:'0'}]}
},// params=[{categoryId:'0001',itemCode:'sex'}] {'sex':[{optionValue:'1',optionName:'',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'',seqOrder:'2',fp:'',isDefault:'0'}]}
load:{ list: false, edit: false, del: false, add: false },//...
addFormRules: {
name: [
@ -181,8 +181,8 @@
qtype:'',
attachment: [],
},
/**begin 在下面加自定义属性,记得补上面的一个逗号**/
fileVisible: true,
/**begin 在下面加自定义属性,记得补上面的一个逗号**/
fileVisible: true,
selectUserVisible: false,
userFieldName:'',
selectTaskVisible:false,
@ -197,7 +197,7 @@
},//end data
methods: {
// @cancel="addFormVisible=false"
handleCancel:function(){
handleCancel:function(){
this.setDefaultData();
this.$emit('cancel');
},
@ -206,9 +206,9 @@
this.$refs.addForm.validate((valid) => {
console.log(this.addForm.handlerUserid);
if (valid) {
this.$confirm('确认提交吗?', '提示', {}).then(() => {
this.load.add=true
let params = Object.assign({}, this.addForm);
this.$confirm('确认提交吗?', '提示', {}).then(() => {
this.load.add=true
let params = Object.assign({}, this.addForm);
if(params.expectResult){
params.expectResult=params.expectResult.replace(/<p>\n<br>\n<\p>/g,"");
@ -229,13 +229,13 @@
this.$emit('submit');// @submit="afterAddSubmit"
this.handleCancel();
}
this.$message({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' });
this.$message({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err => this.load.add=false);
});
}
});
},
/**begin 在下面加自定义方法,记得补上面的一个逗号**/
/**begin 在下面加自定义方法,记得补上面的一个逗号**/
//
onChange : function(file,fileList){
let list = [];
@ -253,12 +253,12 @@
this.addForm.attachment = list;
console.log(list);
}
},
},
setDefaultData() {
this.addForm.id = sn('bug_');
if(this.filters.selProject){
this.addForm.projectId = this.filters.selProject.id;
this.addForm.projectName = this.filters.selProject.name;
}
@ -300,12 +300,12 @@
this.addForm.handlerUserid=user.userid
this.addForm.handlerUsername=user.username
}
}
}
this.selectUserVisible=false
},
showSelectTask:function(){
if(this.filters.selProject==null){
this.$message({showClose: true, message: "请先选项目", type: 'error' });
this.$message({showClose: true, message: "请先选项目", type: 'error' });
return ;
}
this.selectTaskVisible=true;
@ -325,7 +325,7 @@
},
showSelectMenu:function(){
if(this.filters.selProject==null){
this.$message({showClose: true, message: "请先选项目", type: 'error' });
this.$message({showClose: true, message: "请先选项目", type: 'error' });
return ;
}
this.selectMenuVisible=true;
@ -338,7 +338,7 @@
handleCloseMenuTag:function(){
this.addForm.menuId=''
this.addForm.menuName=""
},
},
sendToCreater(){
this.addForm.handlerUsername=this.addForm.createUsername
this.addForm.handlerUserid=this.addForm.createUserid
@ -354,10 +354,10 @@
this.filters.selProject=project
this.addForm.projectId=project.id
this.addForm.projectName=project.name
this.selectProjectVisible=false;
this.selectProjectVisible=false;
},
clearProject(){
this.filters.selProject=null
this.filters.selProject=null
this.addForm.projectId=''
this.addForm.projectName=''
},
@ -377,9 +377,9 @@
}
}
/**end 在上面加自定义方法**/
},//end method
components: {
components: {
// 'xm-question-edit':XmQuestionEdit
'upload': AttachmentUpload,XmGroupMng,VueEditor,XmTaskList,xmMenuSelect,XmProjectList
},
@ -395,7 +395,7 @@
this.setDefaultData();
this.initByExec();
listOption([{categoryId:'all',itemCode:'bugSeverity'},{categoryId:'all',itemCode:'bugSolution'},{categoryId:'all',itemCode:'bugStatus'},{categoryId:'all',itemCode:'bugType'},{categoryId:'all',itemCode:'urgencyLevel'}] ).then(res=>{
if(res.data.tips.isOk){
if(res.data.tips.isOk){
this.options['bugSeverity']=res.data.data.bugSeverity
this.options['bugSolution']=res.data.data.bugSolution
this.options['bugStatus']=res.data.data.bugStatus
@ -404,7 +404,7 @@
}
});
/**在下面写其它函数***/
}//end mounted
}
@ -412,17 +412,17 @@
<style lang="scss" scoped>
.wf-main-context-box {
.wf-main-context-box {
border:1px dashed #000;
margin-bottom: 10px;
margin-top: 30px;
margin-top: 30px;
padding:10px;
}
.wf-main-context p {
color: #585858;
.wf-main-context p {
color: #585858;
}
.wf-main-context p > img {
max-width: 100%;
max-width: 100%;
}
</style>
</style>

222
src/views/xm/core/xmQuestion/XmQuestionEdit.vue

@ -1,109 +1,109 @@
<template>
<section class="page-container padding border">
<section class="page-container padding border">
<el-row>
<font class="font">{{editForm.name}}</font>
</el-row>
</el-row>
<el-row class="padding-bottom">
<el-tooltip content="项目"><el-tag type="warning">{{selProject.name}} </el-tag></el-tooltip>
<el-tooltip content="项目"><el-tag type="warning">{{selProject.name}} </el-tag></el-tooltip>
<el-divider direction="vertical"></el-divider>
<el-tag>{{editForm.createUsername}} {{editForm.createTime}} 创建 </el-tag>
<el-divider direction="vertical"></el-divider>
<el-date-picker :clearable="false" style="width:150px;" type="date" placeholder="到期日期" v-model="editForm.endTime" value-format="yyyy-MM-dd" format="yyyy-MM-dd"></el-date-picker>
</el-row>
</el-row>
<el-row class="padding-bottom">
<el-steps :active="calcBugStep" simple finish-status="success">
<el-step title="已激活,待确认" description="创建后自动激活、关闭后重新激活)"></el-step>
<el-step title="已确认,待解决" description="业务确认缺陷后变为已确认"></el-step>
<el-step title="已解决,待关闭" description="开发修复缺陷后,变成已解决"></el-step>
<el-step title="已关闭(可重新激活)" description="测试通过后变为已关闭,已关闭缺陷可以重新激活"></el-step>
<el-step title="已关闭(可重新激活)" description="测试通过后变为已关闭,已关闭缺陷可以重新激活"></el-step>
</el-steps>
</el-row>
<el-row class="page-main page-height-70">
<el-form :model="editForm" :rules="editFormRules" ref="editForm">
</el-row>
<el-row class="page-main page-height-70">
<el-form :model="editForm" :rules="editFormRules" ref="editForm">
<el-form-item label="隶属任务\故事" prop="taskName">
<el-tooltip content="隶属任务"><el-tag closable @click="showSelectTask" @close.stop="handleCloseTaskTag">{{editForm.taskName?editForm.taskName:'未关联任务'}}</el-tag> </el-tooltip>
<el-divider direction="vertical"></el-divider>
<el-tooltip content="隶属故事"><el-tag closable @click="showSelectMenu" @close.stop="handleCloseMenuTag">{{editForm.menuName?editForm.menuName:"未关联故事"}}</el-tag></el-tooltip>
</el-form-item>
</el-form-item>
<el-form-item label="缺陷属性" prop="priority">
<el-col :span="24">
<el-select v-model="editForm.priority" placeholder="请选择紧急程度">
<el-option v-for="(i,index) in options['urgencyLevel']" :label="i.optionName" :value="i.optionValue" :key="i.optionValue">{{i.optionName}}</el-option>
</el-select>
<el-option v-for="(i,index) in options['urgencyLevel']" :label="i.optionName" :value="i.optionValue" :key="i.optionValue">{{i.optionName}}</el-option>
</el-select>
<el-select v-model="editForm.bugSeverity" placeholder="请选择严重程度">
<el-option v-for="(i,index) in options['bugSeverity']" :label="i.optionName" :value="i.optionValue" :key="i.optionValue">{{i.optionName}}</el-option>
</el-select>
<el-option v-for="(i,index) in options['bugSeverity']" :label="i.optionName" :value="i.optionValue" :key="i.optionValue">{{i.optionName}}</el-option>
</el-select>
<el-select v-model="editForm.solution" placeholder="请选择解决方案">
<el-option v-for="(i,index) in options['bugSolution']" :label="i.optionName" :value="i.optionValue" :key="i.optionValue">{{i.optionName}}</el-option>
</el-select>
<el-option v-for="(i,index) in options['bugSolution']" :label="i.optionName" :value="i.optionValue" :key="i.optionValue">{{i.optionName}}</el-option>
</el-select>
</el-col>
</el-form-item>
</el-form-item>
<el-form-item label="指派给" prop="handlerUsername">
{{editForm.handlerUsername}} <el-button @click="sendToCreater">指派给创建人</el-button><el-button @click="showGroupUsers('handlerUsername')">选其它人</el-button>
</el-form-item>
<el-form-item label="测试步骤" prop="opStep">
<el-col :span="24" v-if="editForm.expectResult">
</el-form-item>
<el-form-item label="测试步骤" prop="opStep">
<el-col :span="24" v-if="editForm.expectResult">
<div class="wf-main-context-box" v-if="editForm.opStep">
<div class="wf-main-context" v-html="editForm.opStep"></div>
<div class="wf-main-context" v-html="editForm.opStep"></div>
</div>
</el-col>
</el-col>
<font v-else></font>
</el-form-item>
<el-form-item label="预期结果" prop="expectResult">
<el-col :span="24" v-if="editForm.expectResult">
</el-form-item>
<el-form-item label="预期结果" prop="expectResult">
<el-col :span="24" v-if="editForm.expectResult">
<div class="wf-main-context-box" >
<div class="wf-main-context" v-html="editForm.expectResult"></div>
<div class="wf-main-context" v-html="editForm.expectResult"></div>
</div>
</el-col>
</el-col>
<font v-else></font>
</el-form-item>
<el-form-item label="流转信息">
</el-form-item>
<el-form-item label="流转信息">
<el-button icon="el-icon-search" v-if="flowInfoVisible==false" @click="showFlowInfo" >查询流转信息</el-button>
<el-button icon="el-icon-search" v-else @click="flowInfoVisible=false" >隐藏流转信息</el-button>
<el-col :span="24" style="padding-top:12px;">
<!--列表 XmQuestionHandle xm_question_handle-->
<el-col :span="24" style="padding-top:12px;">
<!--列表 XmQuestionHandle xm_question_handle-->
<el-table v-show="flowInfoVisible" max-height="300" :data="xmQuestionHandles" highlight-current-row v-loading="load.list" border style="width: 100%;">
<el-table-column sortable type="index" width="40"></el-table-column>
<el-table-column sortable type="index" width="40"></el-table-column>
<el-table-column label="处理意见" prop="receiptMessage" min-width="200" >
<template slot-scope="scope">
<div v-html="scope.row.receiptMessage"></div>
</template>
</el-table-column>
</el-table-column>
<el-table-column prop="handlerUsername" label="指派动作" width="250" >
<template slot-scope="scope">
<el-tag>{{scope.row.handlerUsername}}</el-tag> <el-tag> {{scope.row.targetUsername}} </el-tag><br><span style="font-size:8px;">{{scope.row.receiptTime}}</span>
</template>
</el-table-column>
<el-table-column prop="handleStatus" label="状态" width="80" :formatter="formatterOption"></el-table-column>
</el-table-column>
<el-table-column prop="handleStatus" label="状态" width="80" :formatter="formatterOption"></el-table-column>
<el-table-column prop="handleSolution" label="解决方案" width="100" :formatter="formatterOption"></el-table-column>
</el-table>
</el-table>
</el-col>
</el-form-item>
</el-form-item>
<el-form-item label="缺陷描述" prop="description">
<el-col v-if="editForm.description" :span="24" >
<el-col v-if="editForm.description" :span="24" >
<div class="wf-main-context-box" >
<div class="wf-main-context" v-html="editForm.description"></div>
</div>
</el-col>
<font v-else></font>
</el-form-item>
</el-form-item>
<el-form-item label="上次处理意见" prop="lremark">
<el-col v-if="editForm.lremark" :span="24" >
<el-col v-if="editForm.lremark" :span="24" >
<div class="wf-main-context-box" >
<div class="wf-main-context" v-html="editForm.lremark"></div>
</div>
</el-col>
<font v-else></font>
</el-form-item>
</el-form-item>
<el-form-item label="处理意见" prop="receiptMessage">
<el-tooltip content="点击切换为富文本编辑|普通文本">
<el-button icon="el-icon-refresh" @click="receiptMessageEditorVisible=!receiptMessageEditorVisible" type="text"></el-button>
</el-tooltip>
@ -113,57 +113,57 @@
<div v-else>
<vue-editor :id="'receiptMessage_'+editForm.id" :branch-id="userInfo.branchId" v-model="editForm.receiptMessage"></vue-editor>
</div>
</el-form-item>
</el-form>
</div>
</el-form-item>
</el-form>
<el-drawer title="选中用户" :visible.sync="selectUserVisible" size="80%" append-to-body :close-on-click-modal="false">
<xm-group-mng :sel-project="selProject" :is-select-single-user="1" @user-confirm="onUserConfirm"></xm-group-mng>
</el-drawer>
</el-drawer>
<el-drawer title="选中任务" :visible.sync="selectTaskVisible" size="80%" fullscreen append-to-body :close-on-click-modal="false">
<xm-task-list :sel-project="selProject" @task-selected="onSelectedTask"></xm-task-list>
</el-drawer>
</el-drawer>
<el-drawer append-to-body title="故事选择" :visible.sync="selectMenuVisible" fullscreen :close-on-click-modal="false">
<xm-menu-select :is-select-menu="true" @selected="onSelectedMenu" :sel-project="selProject"></xm-menu-select>
</el-drawer>
</el-row>
<el-row class="padding">
<el-button @click.native="handleCancel">取消</el-button>
</el-drawer>
</el-row>
<el-row class="padding">
<el-button @click.native="handleCancel">取消</el-button>
<el-button v-if="editForm.bugStatus !='closed'" v-loading="load.edit" type="primary" @click.native="handleQuestion(editForm.bugStatus)" :disabled="load.edit==true">暂存</el-button>
<el-button v-if="editForm.bugStatus=='active'" v-loading="load.edit" type="primary" @click.native="handleQuestion('confirmed')" :disabled="load.edit==true">确认</el-button>
<el-button v-if="editForm.bugStatus=='active'" v-loading="load.edit" type="primary" @click.native="handleQuestion('active')" :disabled="load.edit==true">不是缺陷</el-button>
<el-button v-if="editForm.bugStatus=='active'" v-loading="load.edit" type="primary" @click.native="handleQuestion('resolved')" :disabled="load.edit==true">直接解决</el-button>
<el-button v-if="editForm.bugStatus=='active'" v-loading="load.edit" type="primary" @click.native="handleQuestion('closed')" :disabled="load.edit==true">直接关闭</el-button>
<el-button v-if="editForm.bugStatus=='confirmed'" v-loading="load.edit" type="primary" @click.native="handleQuestion('resolved')" :disabled="load.edit==true">解决</el-button>
<el-button v-if="editForm.bugStatus=='confirmed'" v-loading="load.edit" type="primary" @click.native="handleQuestion('closed')" :disabled="load.edit==true">关闭</el-button>
<el-button v-if="editForm.bugStatus=='resolved'" v-loading="load.edit" type="primary" @click.native="handleQuestion('closed')" :disabled="load.edit==true">关闭</el-button>
<el-button v-if="editForm.bugStatus=='resolved'" v-loading="load.edit" type="primary" @click.native="handleQuestion('active')" :disabled="load.edit==true">重新激活</el-button>
<el-button v-if="editForm.bugStatus=='closed'" v-loading="load.edit" type="primary" @click.native="handleQuestion('active')" :disabled="load.edit==true">重新激活</el-button>
</el-row>
<el-button v-if="editForm.bugStatus=='active'" v-loading="load.edit" type="primary" @click.native="handleQuestion('confirmed')" :disabled="load.edit==true">确认</el-button>
<el-button v-if="editForm.bugStatus=='active'" v-loading="load.edit" type="primary" @click.native="handleQuestion('active')" :disabled="load.edit==true">不是缺陷</el-button>
<el-button v-if="editForm.bugStatus=='active'" v-loading="load.edit" type="primary" @click.native="handleQuestion('resolved')" :disabled="load.edit==true">直接解决</el-button>
<el-button v-if="editForm.bugStatus=='active'" v-loading="load.edit" type="primary" @click.native="handleQuestion('closed')" :disabled="load.edit==true">直接关闭</el-button>
<el-button v-if="editForm.bugStatus=='confirmed'" v-loading="load.edit" type="primary" @click.native="handleQuestion('resolved')" :disabled="load.edit==true">解决</el-button>
<el-button v-if="editForm.bugStatus=='confirmed'" v-loading="load.edit" type="primary" @click.native="handleQuestion('closed')" :disabled="load.edit==true">关闭</el-button>
<el-button v-if="editForm.bugStatus=='resolved'" v-loading="load.edit" type="primary" @click.native="handleQuestion('closed')" :disabled="load.edit==true">关闭</el-button>
<el-button v-if="editForm.bugStatus=='resolved'" v-loading="load.edit" type="primary" @click.native="handleQuestion('active')" :disabled="load.edit==true">重新激活</el-button>
<el-button v-if="editForm.bugStatus=='closed'" v-loading="load.edit" type="primary" @click.native="handleQuestion('active')" :disabled="load.edit==true">重新激活</el-button>
</el-row>
</section>
</template>
<script>
import util from '@/common/js/util';//
import { listOption } from '@/api/mdp/meta/itemOption';//
import { editXmQuestion } from '@/api/xm/core/xmQuestion';
import { listOption } from '@/api/mdp/meta/itemOption';//
import { editXmQuestion } from '@/api/xm/core/xmQuestion';
import { listXmQuestionHandle } from '@/api/xm/core/xmQuestionHandle';
import { mapGetters } from 'vuex';
import AttachmentUpload from "@/views/mdp/arc/archiveAttachment/AttachmentUpload"; //
import {sn} from '@/common/js/sequence';
import XmGroupMng from '../xmProjectGroup/XmProjectGroupMng';
import VueEditor from '@/components/VueEditor';
import VueEditor from '@/components/Tinymce/index';
import XmTaskList from '../xmTask/XmTaskList';
import xmMenuSelect from '../xmMenu/XmMenuSelect';
import xmMenuSelect from '../xmMenu/XmMenuSelect';
export default {
export default {
computed: {
...mapGetters([
'userInfo','roles'
]),
calcBugStep(){
]),
calcBugStep(){
if(this.editForm.bugStatus=='active'){
return 1
}else if(this.editForm.bugStatus=='confirmed'){
@ -189,17 +189,17 @@
}else{
this.flowInfoVisible=false;
}
}
}
},
data() {
return {
options:{
options:{
urgencyLevel:[],
bugSeverity:[],
bugSolution:[],
bugStatus:[],
bugType:[],
},// params=[{categoryId:'0001',itemCode:'sex'}] {'sex':[{optionValue:'1',optionName:'',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'',seqOrder:'2',fp:'',isDefault:'0'}]}
},// params=[{categoryId:'0001',itemCode:'sex'}] {'sex':[{optionValue:'1',optionName:'',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'',seqOrder:'2',fp:'',isDefault:'0'}]}
load:{ list: false, edit: false, del: false, add: false },//...
editFormRules: {
name: [
@ -217,21 +217,21 @@
id:'',name:'',projectId:'',projectName:'',taskId:'',taskName:'',endTime:'',askUserid:'',askUsername:'',handlerUserid:'',handlerUsername:'',priority:'',solution:'',processTime:'',receiptMessage:'',receiptTime:'',description:'',createUserid:'',createUsername:'',createTime:'',status:'',receiptMessage:'',
attachment: [],
},
/**begin 在下面加自定义属性,记得补上面的一个逗号**/
fileVisible: true,
/**begin 在下面加自定义属性,记得补上面的一个逗号**/
fileVisible: true,
selectUserVisible: false,
userFieldName:'',
xmQuestionHandles:[],
selectTaskVisible:false,
flowInfoVisible:false,
selectMenuVisible:false,
selectMenuVisible:false,
receiptMessageEditorVisible:false,
/**end 在上面加自定义属性**/
}//end return
},//end data
methods: {
// @cancel="editFormVisible=false"
handleCancel:function(){
handleCancel:function(){
this.$emit('cancel');
},
//XmQuestion xm_question @submit="afterAddSubmit"
@ -239,11 +239,11 @@
this.$refs.editForm.validate((valid) => {
console.log(this.editForm.handlerUserid);
if (valid) {
this.$confirm('确认提交吗?', '提示', {}).then(() => {
this.$confirm('确认提交吗?', '提示', {}).then(() => {
this.load.edit=true
let params = Object.assign({}, this.editForm);
let params = Object.assign({}, this.editForm);
params.tardgetBugStatus=tardgetBugStatus;
if(params.expectResult){
params.expectResult=params.expectResult.replace(/<p>\n<br>\n<\p>/g,"");
params.expectResult=params.expectResult.replace(/<p><br><\/p>/g,"");
@ -263,13 +263,13 @@
this.$emit('submit');// @submit="afterAddSubmit"
this.handleCancel();
}
this.$message({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' });
this.$message({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err => this.load.edit=false);
});
}
});
},
/**begin 在下面加自定义方法,记得补上面的一个逗号**/
/**begin 在下面加自定义方法,记得补上面的一个逗号**/
//
onChange : function(file,fileList){
let list = [];
@ -287,7 +287,7 @@
this.editForm.attachment = list;
console.log(list);
}
},
},
formateDate(time) {
const date = new Date(time);
const m = date.getMonth()+1;
@ -316,12 +316,12 @@
this.editForm.handlerUserid=user.userid
this.editForm.handlerUsername=user.username
}
}
}
this.selectUserVisible=false
},
},
handleQuestion:function(tardgetBugStatus){
var oldBugStatus=this.editForm.bugStatus;
if(tardgetBugStatus=="closed"){
var oldBugStatus=this.editForm.bugStatus;
if(tardgetBugStatus=="closed"){
if( !this.roles.some(i=>i.roleid=='testAdmin') && !this.roles.some(i=>i.roleid=='tester') && !this.roles.some(i=>i.roleid=='testTeamAdmin') ){
this.$message({showClose: true,message:"只有测试经理、测试组长、测试员可以关闭bug",type:"error"});
return ;
@ -334,7 +334,7 @@
}
this.editSubmit(tardgetBugStatus);
},
formatterOption: function(row,column,cellValue, index){
formatterOption: function(row,column,cellValue, index){
var columnName=column.property;
var key="";
if(columnName=='handleStatus'){
@ -363,7 +363,7 @@
},
getXmQuestionHandle:function(){
var params={
questionId:this.editForm.id
questionId:this.editForm.id
}
this.load.list=true
listXmQuestionHandle(params).then(res=>{
@ -372,19 +372,19 @@
if(tips.isOk){
this.xmQuestionHandles=res.data.data;
}
this.$message({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' });
this.$message({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err => this.load.list=false);
},
showSelectTask:function(){
if(this.selProject==null){
this.$message({showClose: true, message: "请先选项目", type: 'error' });
this.$message({showClose: true, message: "请先选项目", type: 'error' });
return ;
}
this.selectTaskVisible=true;
},
onSelectedTask(task){
this.editForm.taskId=task.id
this.editForm.taskName=task.name
this.editForm.taskName=task.name
this.selectTaskVisible=false;
},
handleCloseTaskTag:function(){
@ -405,10 +405,10 @@
this.getXmQuestionHandle();
},
/**end 在上面加自定义方法**/
showSelectMenu:function(){
if(this.selProject==null){
this.$message({showClose: true, message: "请先选项目", type: 'error' });
this.$message({showClose: true, message: "请先选项目", type: 'error' });
return ;
}
this.selectMenuVisible=true;
@ -421,17 +421,17 @@
handleCloseMenuTag:function(){
this.editForm.menuId=''
this.editForm.menuName=""
},
},
},//end method
components: {
components: {
// 'xm-question-edit':XmQuestionEdit
'upload': AttachmentUpload,XmGroupMng,VueEditor,XmTaskList,xmMenuSelect
},
mounted() {
console.log("question_add");
this.editForm=Object.assign(this.editForm, this.xmQuestion);
this.editForm=Object.assign(this.editForm, this.xmQuestion);
listOption([{categoryId:'all',itemCode:'bugSeverity'},{categoryId:'all',itemCode:'bugSolution'},{categoryId:'all',itemCode:'bugStatus'},{categoryId:'all',itemCode:'bugType'},{categoryId:'all',itemCode:'urgencyLevel'}] ).then(res=>{
if(res.data.tips.isOk){
if(res.data.tips.isOk){
this.options['bugSeverity']=res.data.data.bugSeverity
this.options['bugSolution']=res.data.data.bugSolution
this.options['bugStatus']=res.data.data.bugStatus
@ -441,27 +441,27 @@
});
//this.getXmQuestionHandle();
/**在下面写其它函数***/
}//end mounted
}
</script>
<style lang="scss" scoped>
.wf-main-context-box {
.wf-main-context-box {
border:1px dashed #000;
padding:10px;
}
.wf-main-context p {
color: #585858;
.wf-main-context p {
color: #585858;
display: block;
margin-block-start: 0em !important;
margin-block-end: 0em !important;
margin-inline-start: 0px !important;
margin-inline-end: 0px !important;
margin-inline-end: 0px !important;
}
.wf-main-context p > img {
max-width: 100%;
max-width: 100%;
}
</style>
</style>

68
src/views/xm/core/xmTestCase/XmTestCaseAdd.vue

@ -1,38 +1,38 @@
<template>
<section class="page-container page-full-height padding border">
<el-row>
<!--新增界面 XmTestCase 测试用例-->
<el-form :model="addForm" label-width="120px" :rules="addFormRules" ref="addForm">
<!--新增界面 XmTestCase 测试用例-->
<el-form :model="addForm" label-width="120px" :rules="addFormRules" ref="addForm">
<el-form-item label="标题" prop="caseName">
<el-input v-model="addForm.caseName" placeholder="标题" ></el-input>
</el-form-item>
</el-form-item>
<el-form-item label="模块名称" prop="moduleName">
<el-input v-model="addForm.moduleName" placeholder="模块名称" ></el-input>
</el-form-item>
</el-form-item>
<el-form-item label="关联的故事" prop="menuId">
<el-tag v-if="addForm.menuName && addForm.menuName!=''" closable @close="clearFiltersMneu">{{addForm.menuName}}</el-tag>
<el-tag v-else>还没关联任何故事</el-tag>
<el-button @click="showMenu">关联故事</el-button>
</el-form-item>
</el-form-item>
<el-form-item>
<el-col :span="12">测试步骤</el-col>
<el-col :span="12" offset="0">预期结果</el-col>
<el-col :span="12">
<vue-editor :id="'testStep'" :branch-id="userInfo.branchId" v-model="addForm.testStep" ref="testStep"></vue-editor>
<vue-editor :id="'testStep'" :branch-id="userInfo.branchId" v-model="addForm.testStep" ref="testStep"></vue-editor>
</el-col>
<el-col :span="12" offset="0">
<vue-editor :id="'expectResult'" :branch-id="userInfo.branchId" v-model="addForm.expectResult" ref="expectResult"></vue-editor>
</el-col>
<el-col :span="12" offset="0">
<vue-editor :id="'expectResult'" :branch-id="userInfo.branchId" v-model="addForm.expectResult" ref="expectResult"></vue-editor>
</el-col>
</el-form-item>
<el-form-item>
<el-button @click.native="handleCancel">取消</el-button>
<el-button v-loading="load.add" type="primary" @click.native="addSubmit" :disabled="load.add==true">提交</el-button>
<el-button v-loading="load.add" type="warning" @click.native="addSubmit(true)" :disabled="load.add==true">提交后继续新建</el-button>
<el-button @click.native="handleCancel">取消</el-button>
<el-button v-loading="load.add" type="primary" @click.native="addSubmit" :disabled="load.add==true">提交</el-button>
<el-button v-loading="load.add" type="warning" @click.native="addSubmit(true)" :disabled="load.add==true">提交后继续新建</el-button>
</el-form-item>
</el-form-item>
</el-form>
<el-drawer append-to-body title="故事选择" :visible.sync="menuVisible" fullscreen :close-on-click-modal="false">
<xm-menu-select :visible="menuVisible" :is-select-menu="true" :multi="true" :exclude-iteration-id="iteration?iteration.id:''" @menus-selected="onSelectedMenus" ></xm-menu-select>
</el-drawer>
@ -44,13 +44,13 @@
import util from '@/common/js/util';//
import {sn} from '@/common/js/sequence';//
import { listOption } from '@/api/mdp/meta/itemOption';//
import { listOption } from '@/api/mdp/meta/itemOption';//
import { addXmTestCase } from '@/api/xm/core/xmTestCase';
import { mapGetters } from 'vuex'
import xmMenuSelect from '../xmMenu/XmMenuSelect';
import VueEditor from '@/components/VueEditor';
import VueEditor from '@/components/Tinymce/index';
export default {
export default {
computed: {
...mapGetters([
'userInfo','roles'
@ -61,15 +61,15 @@
'xmTestCase':function( xmTestCase ) {
//this.addForm = xmTestCase;
},
'visible':function(visible) {
'visible':function(visible) {
if(visible==true){
//
}
}
}
},
data() {
return {
options:{},// params=[{categoryId:'0001',itemCode:'sex'}] {'sex':[{optionValue:'1',optionName:'',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'',seqOrder:'2',fp:'',isDefault:'0'}]}
options:{},// params=[{categoryId:'0001',itemCode:'sex'}] {'sex':[{optionValue:'1',optionName:'',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'',seqOrder:'2',fp:'',isDefault:'0'}]}
load:{ list: false, edit: false, del: false, add: false },//...
addFormRules: {
menuId: [
@ -97,24 +97,24 @@
},
//XmTestCase @submit="afterAddSubmit"
addSubmit: function (next) {
this.$refs.addForm.validate((valid) => {
if (valid) {
this.$confirm('确认提交吗?', '提示', {}).then(() => {
this.$confirm('确认提交吗?', '提示', {}).then(() => {
this.load.add=true
let params = Object.assign({}, this.addForm);
let params = Object.assign({}, this.addForm);
params.cbranchId=this.userInfo.branchId
params.luserid=this.userInfo.userid
params.lusername=this.userInfo.username
params.id=sn('case_')
params.lusername=this.userInfo.username
params.id=sn('case_')
addXmTestCase(params).then((res) => {
this.load.add=false
var tips=res.data.tips;
if(tips.isOk && next!=true){
this.$emit('submit');// @submit="afterAddSubmit"
}
this.$message({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' });
this.$message({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err => this.load.add=false);
});
}
@ -139,18 +139,18 @@
this.addForm.menuId=""
this.addForm.menuName=""
this.$refs.addForm.validateField('menuId',valid=>{})
}
}
/**end 在上面加自定义方法**/
},//end method
components: {
components: {
// 'xm-test-case-edit':XmTestCaseEdit
xmMenuSelect,VueEditor
},
mounted() {
//this.addForm=Object.assign(this.addForm, this.xmTestCase);
//this.addForm=Object.assign(this.addForm, this.xmTestCase);
/**在下面写其它函数***/
}//end mounted
}
@ -158,4 +158,4 @@
<style scoped>
</style>
</style>

64
src/views/xm/core/xmTestCase/XmTestCaseEdit.vue

@ -1,40 +1,40 @@
<template>
<section class="page-container page-full-height padding border">
<el-row>
<!--新增界面 XmTestCase 测试用例-->
<el-form :model="editForm" label-width="120px" :rules="editFormRules" ref="editForm">
<!--新增界面 XmTestCase 测试用例-->
<el-form :model="editForm" label-width="120px" :rules="editFormRules" ref="editForm">
<el-form-item label="标题" prop="caseName">
<el-input v-model="editForm.caseName" placeholder="标题" ></el-input>
</el-form-item>
</el-form-item>
<el-form-item label="模块名称" prop="moduleName">
<el-input v-model="editForm.moduleName" placeholder="模块名称" ></el-input>
</el-form-item>
</el-form-item>
<el-form-item label="关联的故事" prop="menuId">
<el-tag v-if="editForm.menuId && editForm.menuId!=''" @close="clearFiltersMneu">{{editForm.menuName}}</el-tag>
<el-tag v-else>还没关联任何故事</el-tag>
<el-button v-if="!editForm.menuId" @click="showMenu">关联故事</el-button>
</el-form-item>
</el-form-item>
<el-form-item label="状态" prop="moduleName">
<el-radio v-model="editForm.caseStatus" label="1" placeholder="状态" >正常</el-radio>
<el-radio v-model="editForm.caseStatus" label="0" placeholder="状态" >作废</el-radio>
</el-form-item>
</el-form-item>
<el-form-item>
<el-col :span="12">测试步骤</el-col>
<el-col :span="12" offset="0">预期结果</el-col>
<el-col :span="12">
<vue-editor :id="'testStep3'" :branch-id="userInfo.branchId" v-model="editForm.testStep" ref="testStep"></vue-editor>
<vue-editor :id="'testStep3'" :branch-id="userInfo.branchId" v-model="editForm.testStep" ref="testStep"></vue-editor>
</el-col>
<el-col :span="12" offset="0">
<vue-editor :id="'expectResult3'" :branch-id="userInfo.branchId" v-model="editForm.expectResult" ref="expectResult"></vue-editor>
</el-col>
<el-col :span="12" offset="0">
<vue-editor :id="'expectResult3'" :branch-id="userInfo.branchId" v-model="editForm.expectResult" ref="expectResult"></vue-editor>
</el-col>
</el-form-item>
<el-form-item>
<el-button @click.native="handleCancel">取消</el-button>
<el-button v-loading="load.edit" type="primary" @click.native="editSubmit" :disabled="load.edit==true">提交</el-button>
</el-form-item>
<el-button @click.native="handleCancel">取消</el-button>
<el-button v-loading="load.edit" type="primary" @click.native="editSubmit" :disabled="load.edit==true">提交</el-button>
</el-form-item>
</el-form>
<el-drawer append-to-body title="故事选择" :visible.sync="menuVisible" fullscreen :close-on-click-modal="false">
<xm-menu-select :visible="menuVisible" :is-select-menu="true" :multi="true" :exclude-iteration-id="iteration?iteration.id:''" @menus-selected="onSelectedMenus" ></xm-menu-select>
</el-drawer>
@ -44,13 +44,13 @@
<script>
import util from '@/common/js/util';//
import { listOption } from '@/api/mdp/meta/itemOption';//
import { listOption } from '@/api/mdp/meta/itemOption';//
import { editXmTestCase } from '@/api/xm/core/xmTestCase';
import { mapGetters } from 'vuex'
import xmMenuSelect from '../xmMenu/XmMenuSelect';
import VueEditor from '@/components/VueEditor';
import VueEditor from '@/components/Tinymce/index';
export default {
export default {
computed: {
...mapGetters([
'userInfo','roles'
@ -61,15 +61,15 @@
'xmTestCase':function( xmTestCase ) {
this.editForm = xmTestCase;
},
'visible':function(visible) {
'visible':function(visible) {
if(visible==true){
//
}
}
}
},
data() {
return {
options:{},// params=[{categoryId:'0001',itemCode:'sex'}] {'sex':[{optionValue:'1',optionName:'',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'',seqOrder:'2',fp:'',isDefault:'0'}]}
options:{},// params=[{categoryId:'0001',itemCode:'sex'}] {'sex':[{optionValue:'1',optionName:'',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'',seqOrder:'2',fp:'',isDefault:'0'}]}
load:{ list: false, add: false, del: false, edit: false },//...
editFormRules: {
menuId: [
@ -97,26 +97,26 @@
},
//XmTestCase @submit="afterAddSubmit"
editSubmit: function () {
if( !this.roles.some(i=>i.roleid=='testAdmin') && !this.roles.some(i=>i.roleid=='tester') && !this.roles.some(i=>i.roleid=='testTeamAdmin') ){
this.$message({showClose: true,message:"只有测试经理、测试组长、测试员可以操作",type:"error"});
return ;
}
this.$refs.editForm.validate((valid) => {
if (valid) {
this.$confirm('确认提交吗?', '提示', {}).then(() => {
this.$confirm('确认提交吗?', '提示', {}).then(() => {
this.load.edit=true
let params = Object.assign({}, this.editForm);
let params = Object.assign({}, this.editForm);
params.luserid=this.userInfo.userid
params.lusername=this.userInfo.username
params.lusername=this.userInfo.username
editXmTestCase(params).then((res) => {
this.load.edit=false
var tips=res.data.tips;
if(tips.isOk){
this.$emit('submit');// @submit="afterAddSubmit"
}
this.$message({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' });
this.$message({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err => this.load.edit=false);
});
}
@ -141,18 +141,18 @@
this.editForm.menuId=""
this.editForm.menuName=""
this.$refs.editForm.validateField('menuId',valid=>{})
}
}
/**end 在上面加自定义方法**/
},//end method
components: {
components: {
// 'xm-test-case-edit':XmTestCaseEdit
xmMenuSelect,VueEditor
},
mounted() {
this.editForm=Object.assign(this.editForm, this.xmTestCase);
this.editForm=Object.assign(this.editForm, this.xmTestCase);
/**在下面写其它函数***/
}//end mounted
}
@ -160,4 +160,4 @@
<style scoped>
</style>
</style>
Loading…
Cancel
Save