Compare commits

...

2 Commits

  1. 626
      ant-design-vue-jeecg/src/views/requirementitem/RequirementItemList.vue

@ -6,34 +6,37 @@
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :xl="6" :lg="7" :md="8" :sm="24"> <a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="项目"> <a-form-item label="项目">
<j-dict-select-tag placeholder="请选择项目" v-model="queryParam.projectId" dictCode="projectx,project_name,id"/> <j-dict-select-tag placeholder="请选择项目" v-model="queryParam.projectId" dictCode="projectx,project_name,id" />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24"> <a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="类型"> <a-form-item label="类型">
<j-dict-select-tag placeholder="请选择类型" v-model="queryParam.typeId" dictCode="requirement_type,type_name,id"/> <j-dict-select-tag placeholder="请选择类型" v-model="queryParam.typeId"
dictCode="requirement_type,type_name,id" />
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="需求编码">
<a-input placeholder="请输入需求编码" v-model="queryParam.requirementCode"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="中文名称">
<a-input placeholder="请输入中文名称" v-model="queryParam.requirementName"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="需求等级">
<j-dict-select-tag placeholder="请选择需求等级" v-model="queryParam.requirementLevel"
dictCode="requirement_level"></j-dict-select-tag>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="需求状态">
<j-dict-select-tag placeholder="请选择需求状态" v-model="queryParam.requirementStatus"
dictCode="requirement_status"></j-dict-select-tag>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="需求编码">
<a-input placeholder="请输入需求编码" v-model="queryParam.requirementCode"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="中文名称">
<a-input placeholder="请输入中文名称" v-model="queryParam.requirementName"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="需求等级">
<j-dict-select-tag placeholder="请选择需求等级" v-model="queryParam.requirementLevel" dictCode="requirement_level"></j-dict-select-tag>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="需求状态">
<j-dict-select-tag placeholder="请选择需求状态" v-model="queryParam.requirementStatus" dictCode="requirement_status"></j-dict-select-tag>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24"> <a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button> <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
@ -47,42 +50,36 @@
<!-- 操作按钮区域 --> <!-- 操作按钮区域 -->
<div class="table-operator"> <div class="table-operator">
<a-button @click="handleAddxqlx(1,'')" type="primary" icon="plus">新增</a-button> <a-button @click="handleAddxqlx(1, '')" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('需求管理')">导出</a-button> <a-button type="primary" icon="download" @click="handleExportXls('需求管理')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
@change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button> <a-button type="primary" icon="import">导入</a-button>
</a-upload> </a-upload>
<a-button @click="wdxq()" type="primary" icon="search">我的需求</a-button> <a-button @click="wdxq()" type="primary" icon="search">我的需求</a-button>
<!-- 高级查询区域 --> <!-- 高级查询区域 -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> <j-super-query :fieldList="superFieldList" ref="superQueryModal"
@handleSuperQuery="handleSuperQuery"></j-super-query>
</div> </div>
<!-- table区域-begin --> <!-- table区域-begin -->
<div> <div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a> <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{
selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected">清空</a> <a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div> </div>
<a-table <a-table ref="table" size="middle" :scroll="{ x: true }" bordered rowKey="id" :columns="columns"
ref="table" :dataSource="dataSource" :pagination="ipagination" :loading="loading"
size="middle" :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" class="j-table-force-nowrap"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap"
@change="handleTableChange"> @change="handleTableChange">
<span slot="zh" slot-scope="text, record" v-if="record.xqflag==='1'"> <span slot="zh" slot-scope="text, record" v-if="record.xqflag === '1'">
<a @click="zhmk(record)">模块</a> <a @click="zhmk(record)">模块</a>
<a-divider type="vertical"/> <a-divider type="vertical" />
<a @click="zhgn(record)">功能</a> <a @click="zhgn(record)">功能</a>
<a-divider type="vertical"/> <a-divider type="vertical" />
<a @click="zhgz(record)">规则</a> <a @click="zhgz(record)">规则</a>
</span> </span>
<span v-else>无操作权限</span> <span v-else>无操作权限</span>
@ -96,18 +93,12 @@
</template> </template>
<template slot="fileSlot" slot-scope="text"> <template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button <a-button v-else :ghost="true" type="primary" icon="download" size="small" @click="downloadFile(text)">
v-else
:ghost="true"
type="primary"
icon="download"
size="small"
@click="downloadFile(text)">
下载 下载
</a-button> </a-button>
</template> </template>
<span slot="action" slot-scope="text, record"> <!-- <span slot="action" slot-scope="text, record">
<a @click="checkqx(record)">编辑</a> <a @click="checkqx(record)">编辑</a>
<a-divider type="vertical" /> <a-divider type="vertical" />
@ -117,13 +108,30 @@
<a>删除</a> <a>删除</a>
</a-popconfirm> </a-popconfirm>
<a-divider type="vertical" /> <a-divider type="vertical" />
<a @click="handleAddxqlx(0,record)">拆分</a> <a @click="handleAddxqlx(0, record)">拆分</a>
<a-divider type="vertical" /> <a-divider type="vertical" />
<a @click="cqdx(record)">抽取对象</a> <a @click="cqdx(record)">抽取对象</a>
<a-divider type="vertical" /> <a-divider type="vertical" />
<a v-if="record.xqflag==='1'" @click="qrxq(record.id)">确认需求</a> <a v-if="record.xqflag === '1'" @click="qrxq(record.id)">确认需求</a>
</span> -->
<span slot="action" slot-scope="text, record" class="action-buttons">
<div>
<a @click="checkqx(record)">编辑</a>
<a-divider type="vertical" />
<a @click="handleDetail(record)">详情</a>
<a-divider type="vertical" />
<a-popconfirm title="确定删除吗?" @confirm="() => handleDeleteQx(record)">
<a>删除</a>
</a-popconfirm>
</div>
<div>
<a @click="handleAddxqlx(0, record)">拆分</a>
<a-divider type="vertical" />
<a @click="cqdx(record)">抽取对象</a>
<a-divider type="vertical" />
<a v-if="record.xqflag === '1'" @click="qrxq(record.id)">确认需求</a>
</div>
</span> </span>
</a-table> </a-table>
</div> </div>
@ -137,220 +145,324 @@
<script> <script>
import '@/assets/less/TableExpand.less' import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin' import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin' import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import RequirementItemModal from './modules/RequirementItemModal' import RequirementItemModal from './modules/RequirementItemModal'
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' import { filterMultiDictText } from '@/components/dict/JDictSelectUtil'
import { httpAction, getAction } from '@/api/manage' import { httpAction, getAction } from '@/api/manage'
import ModulexModal1 from "../modulex/modules/ModulexModal1"; import ModulexModal1 from "../modulex/modules/ModulexModal1";
import FunctionxModal1 from "../functionx/modules/FunctionxModal1"; import FunctionxModal1 from "../functionx/modules/FunctionxModal1";
import RulexModal1 from "../rulex/modules/RulexModal1"; import RulexModal1 from "../rulex/modules/RulexModal1";
import RequirementEntityList1 from "../requiremententity/RequirementEntityList1"; import RequirementEntityList1 from "../requiremententity/RequirementEntityList1";
import { Tooltip, Typography } from 'ant-design-vue';
export default { export default {
name: 'RequirementItemList', name: 'RequirementItemList',
mixins:[JeecgListMixin, mixinDevice], mixins: [JeecgListMixin, mixinDevice],
components: { components: {
RequirementItemModal,ModulexModal1,FunctionxModal1,RulexModal1,RequirementEntityList1 RequirementItemModal, ModulexModal1, FunctionxModal1, RulexModal1, RequirementEntityList1
}, },
data () { data() {
return { return {
description: '需求管理管理页面', description: '需求管理管理页面',
// //
columns: [ columns: [
{ {
title: '#', title: '#',
dataIndex: '', dataIndex: '',
key:'rowIndex', key: 'rowIndex',
width:60, width: 60,
align:"center", align: "center",
customRender:function (t,r,index) { customRender: function (t, r, index) {
return parseInt(index)+1; return parseInt(index) + 1;
}
},
{
title: '项目',
align: "center",
dataIndex: 'projectId_dictText',
customRender: this.renderTextColumn
},
{
title: '类型',
align: "center",
dataIndex: 'typeId_dictText'
},
{
title: '上级需求',
align: "center",
dataIndex: 'upperId_dictText',
customRender: this.renderTextColumn
},
// {
// title:'',
// align:"center",
// dataIndex: 'requirementCode'
// },
{
title: '需求编码',
align: 'center',
dataIndex: 'requirementCode',
customRender: (text) => {
if (text) {
const truncatedText = text.length > 10 ? text.substring(0, 10) : text;
return (
<Tooltip title={text}>
<span>{truncatedText}</span>
</Tooltip>
);
} else {
return null;
} }
}
},
{
title: '中文名称',
align: "center",
dataIndex: 'requirementName',
customRender: this.renderTextColumn
},
{
title: '需求等级',
align: "center",
dataIndex: 'requirementLevel_dictText'
},
{
title: '需求状态',
align: "center",
dataIndex: 'requirementStatus_dictText'
},
// {
// title: '',
// align: "center",
// dataIndex: 'requirementDescribe',
// scopedSlots: { customRender: 'htmlSlot' },
// },
{
title: '需求描述',
align: "center",
dataIndex: 'requirementDescribe',
scopedSlots: {
customRender: 'htmlSlot'
}, },
{ customRender: (text) => {
title:'项目', if (text) {
align:"center", // <p>
dataIndex: 'projectId_dictText' const strippedText = text.replace(/<p>/g, '').replace(/<\/p>/g, '')
}, if (strippedText.length > 40) {
{ return (
title: '类型', <Tooltip title={strippedText}>
align: "center", <div class="ellipsis-text" style="text-align: left;">
dataIndex: 'typeId_dictText' <span>{strippedText.slice(0, 20)}</span>
}, <br />
{ <span>{strippedText.slice(20, 40)}</span>
title:'上级需求', </div>
align:"center", </Tooltip>
dataIndex: 'upperId_dictText' );
}, } else if (strippedText.length > 20) {
{ return (
title:'需求编码', <div style="text-align: left;">
align:"center", <span>{strippedText.slice(0, 20)}</span>
dataIndex: 'requirementCode' <br />
}, <span>{strippedText.slice(20)}</span>
{ </div>
title:'中文名称', );
align:"center", } else {
dataIndex: 'requirementName' return <span style="text-align: left;">{strippedText}</span>;
}, }
{ } else {
title:'需求等级', return null; // or any fallback value you prefer
align:"center", }
dataIndex: 'requirementLevel_dictText'
},
{
title:'需求状态',
align:"center",
dataIndex: 'requirementStatus_dictText'
},
{
title:'需求描述',
align:"center",
dataIndex: 'requirementDescribe',
scopedSlots: {customRender: 'htmlSlot'},
},
{
title:'需求图片',
align:"center",
dataIndex: 'requirementPic'
},
{
title:'需求文件',
align:"center",
dataIndex: 'requirementFile'
},
{
title:'创建人',
align:"center",
dataIndex: 'createBy_dictText'
},
{
title:'修改人',
align:"center",
dataIndex: 'updateBy_dictText'
},
{
title: '转化',
dataIndex: 'zh',
align: "center",
scopedSlots: {customRender: 'zh'}
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
} }
],
url: {
list: "/requirementitem/requirementItem/list",
delete: "/requirementitem/requirementItem/delete",
deleteBatch: "/requirementitem/requirementItem/deleteBatch",
exportXlsUrl: "/requirementitem/requirementItem/exportXls",
importExcelUrl: "requirementitem/requirementItem/importExcel",
qrxq:"/requirementitem/requirementItem/qrxq",
checkqx:"/requirementtype/requirementType/checkqx",
wdxqlist:"/requirementitem/requirementItem/wdxqlist",
checkzh:"/modulex/modulex/checkzh",
}, },
dictOptions:{}, {
superFieldList:[], title: '图片',
align: "center",
dataIndex: 'requirementPic',
scopedSlots: {customRender: 'imgSlot'}
},
{
title: '文件',
align: "center",
dataIndex: 'requirementFile',
scopedSlots: { customRender: 'fileSlot' }
},
{
title: '创建人',
align: "center",
dataIndex: 'createBy_dictText'
},
{
title: '修改人',
align: "center",
dataIndex: 'updateBy_dictText'
},
{
title: '转化',
dataIndex: 'zh',
align: "center",
scopedSlots: { customRender: 'zh' }
},
{
title: '操作',
dataIndex: 'action',
align: "center",
fixed: "right",
width: 147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/requirementitem/requirementItem/list",
delete: "/requirementitem/requirementItem/delete",
deleteBatch: "/requirementitem/requirementItem/deleteBatch",
exportXlsUrl: "/requirementitem/requirementItem/exportXls",
importExcelUrl: "requirementitem/requirementItem/importExcel",
qrxq: "/requirementitem/requirementItem/qrxq",
checkqx: "/requirementtype/requirementType/checkqx",
wdxqlist: "/requirementitem/requirementItem/wdxqlist",
checkzh: "/modulex/modulex/checkzh",
},
dictOptions: {},
superFieldList: [],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
// 1020
renderTextColumn(text) {
if (text) {
if (text.length > 20) {
return (
<Tooltip title={text}>
<div class="ellipsis-text" style="text-align: center;">
<span>{text.slice(0, 10)}</span>
<br />
<span>{text.slice(10, 20)}</span>
</div>
</Tooltip>
);
} else if (text.length > 10) {
return (
<div style="text-align: center;">
<span>{text.slice(0, 10)}</span>
<br />
<span>{text.slice(10)}</span>
</div>
);
} else {
return <span style="text-align: center;">{text}</span>;
}
} else {
return null; // or any fallback value you prefer
} }
}, },
created() { zhmk(record) {
this.getSuperFieldList(); getAction(this.url.checkzh, { requirementid: record.id, funlevel: 2 }).then((res) => {
if (res.success) {
this.$refs.modulex.add(record);
this.$refs.modulex.title = "新增";
this.$refs.modulex.disableSubmit = false;
} else {
this.$message.warning(res.message);
}
});
}, },
computed: { zhgn(record) {
importExcelUrl: function(){ getAction(this.url.checkzh, { requirementid: record.id, funlevel: 3 }).then((res) => {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; if (res.success) {
}, this.$refs.functionxm.add(record);
this.$refs.functionxm.title = "新增";
this.$refs.functionxm.disableSubmit = false;
} else {
this.$message.warning(res.message);
}
});
}, },
methods: { zhgz(record) {
zhmk(record){ getAction(this.url.checkzh, { requirementid: record.id, funlevel: 4 }).then((res) => {
getAction(this.url.checkzh,{requirementid:record.id,funlevel:2}).then((res)=>{ if (res.success) {
if (res.success) { this.$refs.rulexmd.add(record);
this.$refs.modulex.add(record); this.$refs.rulexmd.title = "新增";
this.$refs.modulex.title = "新增"; this.$refs.rulexmd.disableSubmit = false;
this.$refs.modulex.disableSubmit = false; } else {
}else{ this.$message.warning(res.message);
this.$message.warning(res.message); }
} });
}); },
}, checkqx(record) {
zhgn(record){ getAction(this.url.checkqx, { createBy: record.createBy }).then((res) => {
getAction(this.url.checkzh,{requirementid:record.id,funlevel:3}).then((res)=>{ if (res.success) {
if (res.success) { this.$refs.modalForm.edit(record);
this.$refs.functionxm.add(record); this.$refs.modalForm.title = "编辑";
this.$refs.functionxm.title = "新增"; this.$refs.modalForm.disableSubmit = false;
this.$refs.functionxm.disableSubmit = false; } else {
}else{ this.$message.warning(res.message);
this.$message.warning(res.message); }
} });
}); },
}, cqdx(record) {
zhgz(record){ this.$refs.rel1.showModal();
getAction(this.url.checkzh,{requirementid:record.id,funlevel:4}).then((res)=>{ this.$refs.rel1.edit(record);
if (res.success) { this.$refs.rel1.disableSubmit = false;
this.$refs.rulexmd.add(record); },
this.$refs.rulexmd.title = "新增"; wdxq() {
this.$refs.rulexmd.disableSubmit = false; this.searchQuerywdxq();
}else{ },
this.$message.warning(res.message); qrxq(id) {
} getAction(this.url.qrxq, { id: id }).then((res) => {
}); if (res.success) {
}, this.$message.success(res.message);
checkqx(record){ this.loadData();
getAction(this.url.checkqx,{createBy:record.createBy}).then((res)=>{ } else {
if (res.success) { this.$message.warning(res.message);
this.$refs.modalForm.edit(record); }
this.$refs.modalForm.title = "编辑"; });
this.$refs.modalForm.disableSubmit = false; },
}else{ initDictConfig() {
this.$message.warning(res.message); },
} getSuperFieldList() {
}); let fieldList = [];
}, fieldList.push({ type: 'string', value: 'projectId', text: '项目id', dictCode: 'projectx,project_name,id' })
cqdx(record){ fieldList.push({ type: 'string', value: 'typeId', text: '类型id', dictCode: 'requirement_type,type_name,id' })
this.$refs.rel1.showModal(); fieldList.push({ type: 'string', value: 'upperId', text: '上级需求', dictCode: 'requirement_item,requirement_name,id' })
this.$refs.rel1.edit(record); fieldList.push({ type: 'string', value: 'requirementCode', text: '需求编码', dictCode: '' })
this.$refs.rel1.disableSubmit = false; fieldList.push({ type: 'string', value: 'requirementName', text: '中文名称', dictCode: '' })
}, fieldList.push({ type: 'int', value: 'requirementLevel', text: '需求等级', dictCode: 'requirement_level' })
wdxq(){ fieldList.push({ type: 'int', value: 'requirementStatus', text: '需求状态', dictCode: 'requirement_status' })
this.searchQuerywdxq(); fieldList.push({ type: 'string', value: 'requirementDescribe', text: '需求描述', dictCode: '' })
}, fieldList.push({ type: 'string', value: 'requirementPic', text: '需求图片', dictCode: '' })
qrxq(id){ fieldList.push({ type: 'string', value: 'requirementFile', text: '需求文件', dictCode: '' })
getAction(this.url.qrxq,{id:id}).then((res)=>{ this.superFieldList = fieldList
if (res.success) {
this.$message.success(res.message);
this.loadData();
}else{
this.$message.warning(res.message);
}
});
},
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'projectId',text:'项目id',dictCode:'projectx,project_name,id'})
fieldList.push({type:'string',value:'typeId',text:'类型id',dictCode:'requirement_type,type_name,id'})
fieldList.push({type:'string',value:'upperId',text:'上级需求',dictCode:'requirement_item,requirement_name,id'})
fieldList.push({type:'string',value:'requirementCode',text:'需求编码',dictCode:''})
fieldList.push({type:'string',value:'requirementName',text:'中文名称',dictCode:''})
fieldList.push({type:'int',value:'requirementLevel',text:'需求等级',dictCode:'requirement_level'})
fieldList.push({type:'int',value:'requirementStatus',text:'需求状态',dictCode:'requirement_status'})
fieldList.push({type:'string',value:'requirementDescribe',text:'需求描述',dictCode:''})
fieldList.push({type:'string',value:'requirementPic',text:'需求图片',dictCode:''})
fieldList.push({type:'string',value:'requirementFile',text:'需求文件',dictCode:''})
this.superFieldList = fieldList
}
} }
} }
}
</script> </script>
<style scoped> <style scoped>
@import '~@assets/less/common.less'; @import '~@assets/less/common.less';
</style>
.action-buttons {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
}
.button-group {
display: flex;
flex-wrap: wrap;
align-items: flex-start;
margin-bottom: 8px;
}
.button-group a {
margin-right: 8px;
white-space: nowrap;
}</style>

Loading…
Cancel
Save