update 项目库

This commit is contained in:
赵霄
2023-11-15 17:00:12 +08:00
parent 6ef9769815
commit eefba03bd7
20 changed files with 2278 additions and 88 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ import { Base64 } from 'js-base64'
// 支持预览的文件类型
const CAN_PREVIEW_FILE_TYPE = ['pdf', 'image']
// 支持预览的文件后缀
const CAN_PREVIEW_FILE_SUFFIX = ['jpg', 'jpeg', 'png', 'raw', 'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'mp3', 'mp4', 'flv']
const CAN_PREVIEW_FILE_SUFFIX = ['jpg', 'jpeg', 'png', 'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx']
const FILE_TYPE_IMGS = ['jpg', 'jpeg', 'png', 'raw']
const FILE_TYPE_PDF = 'pdf'
+1 -1
View File
@@ -101,7 +101,7 @@ import FlowChartModal from './FlowChartModal.vue'
import UploadFile from './UploadFile'
// 支持预览的文件后缀
const CAN_PREVIEW_FILE_SUFFIX = ['jpg', 'jpeg', 'png', 'raw', 'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'mp3', 'mp4', 'flv']
const CAN_PREVIEW_FILE_SUFFIX = ['jpg', 'jpeg', 'png', 'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx']
const FILE_TYPE_IMGS = ['jpg', 'jpeg', 'png', 'raw']
const FILE_TYPE_PDF = 'pdf'
@@ -0,0 +1,116 @@
<template>
<div class="selection-wrapper">
<div class="box-title-text">
<a-input class="box-input"
:value="checkedValue"
:title="checkedValue"
disabled
:max-length="500"
@change="event => event.target.value = event.target.value.trim()"
:placeholder="placeholder" />
<a-button v-if="!disabled" type="primary" class="button-box" @click="handleClick">
{{ $t('projectLibrary.noncoincidenceItem.projectSelection') }}
</a-button>
</div>
<vehicle-project-selection-drawer ref="projectSelectModal" @listChange="handleListChange" />
</div>
</template>
<script>
import VehicleProjectSelectionDrawer from './VehicleProjectSelectionDrawer'
export default {
name: 'VehicleProjectSelection',
components: { VehicleProjectSelectionDrawer },
props: {
value: {
type: String,
default: ''
},
placeholder: {
type: String,
default: ''
},
disabled: {
type: Boolean,
default: false
},
// 是否只能选择
selectOnly: {
type: Boolean,
required: false,
default: false
},
// 名字字符串
nameStr: {
type: String,
required: false,
default: ''
},
// 回显取哪个字段的值
echoFieldName: {
type: String,
required: false,
default: 'projectName'
}
},
data () {
return {
checkedValue: null
}
},
watch: {
nameStr: {
immediate: true,
handler (val) {
this.checkedValue = val
}
}
},
methods: {
// 点击选择标准按钮
handleClick () {
this.$refs.projectSelectModal.open()
},
handleListChange (list) {
const ids = list.map(tt => tt.id).join(',')
this.checkedValue = list.map(tt => tt[this.echoFieldName]).join(',')
this.$emit('change', ids)
this.$emit('listChange', list)
}
},
model: {
prop: 'value',
event: 'change'
}
}
</script>
<style scoped lang="less">
@import '~@assets/less/common.less';
.selection-wrapper {
height: 40px;
line-height: 40px;
}
.box-title-text {
height: 100%;
display: flex;
align-items: center;
.box-input {
width: 100%;
}
.button-box {
margin-left: 10px;
}
}
/deep/ .ant-input[disabled] {
background-color: white;
color: rgba(0, 0, 0, 0.65);
}
</style>
@@ -7,17 +7,81 @@
@close="onClose"
:visible="visible"
:maskClosable="false"
destroyOnClose
class="custom-drawer-style">
<div class="custom-drawer-style-scroll">
<a-spin :spinning="confirmLoading">
</a-spin>
<!--查询区域-->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<!--项目名称-->
<a-col :md="6" :sm="12">
<a-form-item :label="$t('projectLibrary.projectName')">
<j-input :placeholder="$t('pleaseEnter') + $t('projectLibrary.projectName')" v-model="queryParam.projectName"></j-input>
</a-form-item>
</a-col>
<!--工作令编号-->
<a-col :md="6" :sm="12">
<a-form-item :label="$t('projectLibrary.workOrderNumber')">
<j-input :placeholder="$t('pleaseEnter') + $t('projectLibrary.workOrderNumber')" v-model="queryParam.workNumber"></j-input>
</a-form-item>
</a-col>
<!--项目健康状态-->
<a-col :md="6" :sm="12">
<a-form-item :label="$t('projectLibrary.projectHealthStatus')">
<j-dict-select-tag
class="box-input"
v-model="queryParam.projectHealth"
:placeholder="$t('pleaseSelect') + $t('projectLibrary.projectHealthStatus')"
:type="'select'"
:triggerChange="false"
:dictCode="'project_health'" />
</a-form-item>
</a-col>
<a-col :md="6" :sm="8">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchReset" icon="reload" ghost>{{ $t('reset') }}</a-button>
<a-button type="primary" @click="searchQuery" icon="search" style="margin-left: 8px" v-has="'vehicleItemLibrary:search'">
{{ $t('query') }}
</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<j-table
:columns="columns"
:dataSource="dataSource"
:can-drag="true"
rowKey="id"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:pagination="ipagination"
:scroll="{x: '100%'}"
:loading="loading"
@change="handleTableChange">
</j-table>
</div>
<div class="custom-drawer-style-bottom-btn">
<a-button @click="handleCancel" style="margin-bottom: 0;" :loading="loading">{{ $t('close') }}</a-button>
<a-button @click="handleOk" type="primary" style="margin-bottom: 0;" :loading="loading">
{{ $t('preservation') }}
</a-button>
</div>
</a-drawer>
</template>
<script>
import JTable from '../jero/JTable'
import { JeroListMixin } from '../../mixins/JeroListMixin'
export default {
name: 'VehicleProjectSelectionDrawer',
components: { JTable },
mixins: [JeroListMixin],
data () {
return {
visible: false,
@@ -26,57 +90,62 @@ export default {
// 存储表单的数据
form: {},
isEdit: false,
confirmLoading: false,
columns: [
// 项目来源
{
dataIndex: 'projectSource_dictText',
title: this.$t('projectLibrary.vehicleItemLibrary.projectSource'),
width: 250
width: 110
},
// 项目名称
{
dataIndex: 'projectName',
title: this.$t('projectLibrary.projectName'),
sorter: true,
width: 250,
scopedSlots: { customRender: 'projectName' }
width: 150
},
// 工作令编号
{
dataIndex: 'workNumber',
title: this.$t('projectLibrary.workOrderNumber'),
sorter: true,
width: 250
width: 150
},
// 项目负责人
{
dataIndex: 'nameWorkNo',
title: this.$t('projectLibrary.vehicleItemLibrary.projectLeader'),
width: 250
width: 150
},
// 项目健康状态
{
dataIndex: 'projectHealth_dictText',
title: this.$t('projectLibrary.projectHealthStatus'),
width: 250
},
// 操作
{
title: this.$t('operation'),
fixed: 'right',
width: 150,
scopedSlots: { customRender: 'operation' }
width: 120
}
],
disableMixinCreated: true,
url: {
list: '/projectLibrary/lawsProjectLibrary/page'
}
}
},
methods: {
open () {
this.visible = true
this.loadData(1)
},
onClose () {
this.visible = false
this.onClearSelected()
},
handleCancel () {
this.onClose()
},
handleOk () {
this.$emit('change', this.selectedRowKeys.join(','))
this.$emit('listChange', this.selectionRows)
this.onClose()
}
}
}