Merge remote-tracking branch 'origin/master'

This commit is contained in:
liyawei
2022-04-28 19:50:17 +08:00
6 changed files with 254 additions and 236 deletions
@@ -32,10 +32,9 @@
checkable checkable
:loading="loading" :loading="loading"
:tree-data="gData" :tree-data="gData"
v-model:checkedKeys="selectedKey"
@select="onSelect"
@check="onCheck" @check="onCheck"
@expand="onExpand" @expand="onExpand"
v-model:checkedKeys="defaultCheckedKeys"
:defaultCheckedKeys="defaultCheckedKeys" :defaultCheckedKeys="defaultCheckedKeys"
:defaultExpandedKeys="defaultExpandedKeys" :defaultExpandedKeys="defaultExpandedKeys"
> >
@@ -86,9 +85,10 @@
this.queryDepartUserTreeList() this.queryDepartUserTreeList()
this.visible = true this.visible = true
}, },
onSelect(selectedKeys, info) { // onSelect(selectedKeys, info) {
this.selectedKey = selectedKeys // console.log(selectedKeys)
}, // this.selectedKey = selectedKeys
// },
onCheck(checkedKeys, info) { onCheck(checkedKeys, info) {
this.userIds = [] this.userIds = []
@@ -167,16 +167,7 @@
if (res.success) { if (res.success) {
this.gData = res.result this.gData = res.result
this.defaultExpandedKeys = [this.departId] this.defaultExpandedKeys = [this.departId]
if (this.personneQuery[this.query.db_field_name + '_id']) { if (this.userName && this.userName.length == 0) {
this.defaultCheckedKeys = this.personneQuery[this.query.db_field_name + '_id'].split(',')
this.selectedKey = this.personneQuery[this.query.db_field_name + '_id'].split(',')
} else if (this.personneQuery[this.query.db_field_name]) {
this.defaultCheckedKeys = this.personneQuery[this.query.db_field_name].split(',')
this.selectedKey = this.personneQuery[this.query.db_field_name].split(',')
} else {
this.defaultCheckedKeys = []
this.selectedKey = []
}
if (this.personneQuery[this.query.db_field_name + 'Name']) { if (this.personneQuery[this.query.db_field_name + 'Name']) {
this.userName = this.personneQuery[this.query.db_field_name + 'Name'].split(',') this.userName = this.personneQuery[this.query.db_field_name + 'Name'].split(',')
} else if (this.personneQuery[this.query.db_field_name]) { } else if (this.personneQuery[this.query.db_field_name]) {
@@ -184,6 +175,8 @@
} else { } else {
this.userName = [] this.userName = []
} }
}
if (this.userIds && this.userIds.length == 0) {
if (this.personneQuery[this.query.db_field_name + '_id']) { if (this.personneQuery[this.query.db_field_name + '_id']) {
this.userIds = this.personneQuery[this.query.db_field_name + '_id'].split(',') this.userIds = this.personneQuery[this.query.db_field_name + '_id'].split(',')
} else if (this.personneQuery[this.query.db_field_name]) { } else if (this.personneQuery[this.query.db_field_name]) {
@@ -191,6 +184,8 @@
} else { } else {
this.userIds = [] this.userIds = []
} }
}
this.defaultCheckedKeys = this.userIds
this.treeVisible = true this.treeVisible = true
} else { } else {
this.gData = [] this.gData = []
@@ -129,7 +129,7 @@
@change="dateChange({db_field_name:'xin1Che1Xing2Shi2Shi1Ri4Qi1'})" @change="dateChange({db_field_name:'xin1Che1Xing2Shi2Shi1Ri4Qi1'})"
format="YYYY-MM-DD" format="YYYY-MM-DD"
v-model="formInline.xin1Che1Xing2Shi2Shi1Ri4Qi1" v-model="formInline.xin1Che1Xing2Shi2Shi1Ri4Qi1"
:disabled="true" :disabled="false"
style="width: 100%"/> style="width: 100%"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
@@ -148,7 +148,7 @@
@change="dateChange({db_field_name:'implementTime'})" @change="dateChange({db_field_name:'implementTime'})"
format="YYYY-MM-DD" format="YYYY-MM-DD"
v-model="formInline.implementTime" v-model="formInline.implementTime"
:disabled="true" :disabled="false"
style="width: 100%"/> style="width: 100%"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
@@ -56,15 +56,15 @@
<a @click="VirtualListNameClick(record)">{{text}}</a> <a @click="VirtualListNameClick(record)">{{text}}</a>
</span> </span>
<span slot="operation" slot-scope="text,record"> <span slot="operation" slot-scope="text,record">
<a class="text-operation" @click="edit(record)">{{$t('edit')}}</a> <a class="text-operation" @click="edit(record)" :disabled="record.state == 1?true:false">{{$t('edit')}}</a>
<a class="text-operation" @click="withdraw(record)"> <a class="text-operation" @click="withdraw(record)">
{{record.state == 2 ? $t('release') : $t('withdraw')}} {{record.state == 2 ? $t('release') : $t('withdraw')}}
</a> </a>
<a class="text-operation" @click="maintenanceList(record)">{{$t('maintenanceList')}}</a> <a class="text-operation" :disabled="record.state == 1?true:false" @click="maintenanceList(record)">{{$t('maintenanceList')}}</a>
<a class="text-operation" :disabled="record.state == 2?true:false" @click="subscribe(record)"> <a class="text-operation" :disabled="record.state == 2?true:false" @click="subscribe(record)">
{{!record.readFlag || record.readFlag == 0 ? $t('subscribe') :$t('CancelSubscribe')}} {{!record.readFlag || record.readFlag == 0 ? $t('subscribe') :$t('CancelSubscribe')}}
</a> </a>
<a class="text-operation" :disabled="record.state == 2?true:false" @click="deleteLib(record)">{{$t('deleteLib')}}</a> <a class="text-operation" :disabled="record.state == 1?true:false" @click="deleteLib(record)">{{$t('deleteLib')}}</a>
</span> </span>
</a-table> </a-table>
</div> </div>
@@ -1,4 +1,5 @@
<template> <template>
<div>
<a-drawer <a-drawer
:title="title" :title="title"
:maskClosable="false" :maskClosable="false"
@@ -31,11 +32,10 @@
<span class="title-text-text" :title="$t('Required')">{{$t('Required')}}</span> <span class="title-text-text" :title="$t('Required')">{{$t('Required')}}</span>
</div> </div>
<a-form-model-item class="itemModel" prop="state"> <a-form-model-item class="itemModel" prop="state">
<a-select :placeholder="$t('PleaseSelect')+$t('Required')" v-model="formInline.isMust"> <a-select :placeholder="$t('PleaseSelect')+$t('Required')" v-model='formInline.isMust'>
<a-select-option v-for="(item, key) in isRequired" :key="key" :value="item.value"> <a-select-option :key="'1'" :value="'1'">{{$t('yes')}}
<span style="display: inline-block;width: 100%" :title=" item.label "> </a-select-option>
{{ item.label }} <a-select-option :key="'0'" :value="'0'">{{$t('not')}}
</span>
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-model-item> </a-form-model-item>
@@ -202,11 +202,9 @@
</div> </div>
<a-form-model-item class="itemModel" prop="paramsTemplateName"> <a-form-model-item class="itemModel" prop="paramsTemplateName">
<a-button type="primary" class="button-text" <a-button type="primary" class="button-text"
@click="clickButtonToUpload(item)"> @click="clickButtonToUpload()">
<!-- {{ (formInline[item.db_field_name] === 'null' || formInline[item.db_field_name] === '' ||--> {{ (formInline.fileTemplateConnectId === 'null' || formInline.fileTemplateConnectId === '' ||
<!-- formInline[item.db_field_name] == null) ? $t('clickUpload') : $t('viewUploadedFiles')--> formInline.fileTemplateConnectId == null) ? $t('clickUpload') : $t('viewUploadedFiles')}}
<!-- }}-->
{{ $t('clickUpload') }}
</a-button> </a-button>
</a-form-model-item> </a-form-model-item>
</div> </div>
@@ -215,7 +213,7 @@
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="24" > <a-col :span="24" >
<a-tabs> <a-tabs>
<a-tab-pane v-for='(item,index) in certCategoryParamsInfoEOList' :tab="item.textVal" :key="index + 1"> <a-tab-pane v-for='(item,index) in tt' :tab="item.textVal" :key="index + 1">
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<div class="box-title-text"> <div class="box-title-text">
@@ -226,7 +224,7 @@
<a-form-model-item class="itemModel" prop="paramsTemplateName"> <a-form-model-item class="itemModel" prop="paramsTemplateName">
<a-input class="box-input" <a-input class="box-input"
:disabled="disabled" :disabled="disabled"
v-model="item.textVal" v-model="item.paramsNumber"
:placeholder="$t('PleaseEnter')+$t('standard')"/> :placeholder="$t('PleaseEnter')+$t('standard')"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
@@ -272,14 +270,18 @@
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button> <a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button>
</div> </div>
</a-drawer> </a-drawer>
<uploadFile ref="uploadFile" @uploadSuccess="uploadSuccess"></uploadFile>
</div>
</template> </template>
<script> <script>
import PersonnelSelection from '@/components/PersonnelSelection/index' import PersonnelSelection from '@/components/PersonnelSelection/index'
import { getAction, postAction, downloadFile, putAction } from '@/api/manage' import { getAction, postAction, downloadFile, putAction } from '@/api/manage'
import uploadFile from '@/components/uploadFile/file'
export default { export default {
name: 'addModel', name: 'addModel',
components: { components: {
uploadFile,
PersonnelSelection PersonnelSelection
}, },
props: ['url'], props: ['url'],
@@ -340,7 +342,8 @@ export default {
disabled: false, disabled: false,
projectNameList: [], projectNameList: [],
title: '', title: '',
stateOne: '' stateOne: '',
tt : []
} }
}, },
mounted() { mounted() {
@@ -348,10 +351,22 @@ export default {
this.getSysCategoryTree() this.getSysCategoryTree()
}, },
methods: { methods: {
uploadSuccess(data) {
let attIdList = []
if (data && data.length > 0) {
data.map(item => {
attIdList.push(item.id || data.name)
})
}
this.$refs.uploadFile.visible = false
/** 赋值给当前对应的表单文件 */
this.formInline.fileTemplateConnectId = attIdList.join(',')
this.formInline = { ...this.formInline }
},
clickButtonToUpload(item) { clickButtonToUpload(item) {
// this.$refs.uploadFile.perentHandleFunc() // this.$refs.uploadFile.perentHandleFunc()
// this.$refs.uploadFile.state = item.flag // this.$refs.uploadFile.state = item.flag
// this.$refs.uploadFile.visible = true this.$refs.uploadFile.visible = true
// this.uploadName = item.db_field_name // this.uploadName = item.db_field_name
// getAction('sys/common/getFileInfos', { id: this.formInline[item.db_field_name] }).then((res) => { // getAction('sys/common/getFileInfos', { id: this.formInline[item.db_field_name] }).then((res) => {
// if (res.success) { // if (res.success) {
@@ -362,17 +377,16 @@ export default {
// }) // })
}, },
Onchangelabel(val) { Onchangelabel(val) {
this.certCategoryParamsInfoEOList = []
console.log(val,'val。。。') // this.formInline.certCategoryParamsInfoEOList = []
val.forEach((item) => { val.forEach((item) => {
let _tt = { this.tt.push({
textVal: item.text, // tab textVal: item.text, // tab
certCategory: '', // 所属认证类别 certCategory: '', // 所属认证类别
paramsNumber: '', // 编号 paramsNumber: '', // 编号
paramsName: '', // 参数名称 paramsName: '', // 参数名称
description: ''// 参数说明 description: ''// 参数说明
} })
this.certCategoryParamsInfoEOList.push(_tt)
}) })
}, },
Onchange() { Onchange() {
@@ -427,11 +441,14 @@ export default {
Action = postAction Action = postAction
} }
let query = JSON.parse(JSON.stringify(this.formInline)) let query = JSON.parse(JSON.stringify(this.formInline))
console.log(query,'queryqueryqueryquery')
Object.keys(query).forEach(res => { Object.keys(query).forEach(res => {
if (query[res] && query[res] instanceof Array) { if (query[res] && query[res] instanceof Array) {
query[res] = query[res].join(',') query[res] = query[res].join(',')
} }
}) })
let querytt = JSON.parse(JSON.stringify(this.tt))
query.certCategoryParamsInfoEOList = querytt
this.confirmLoading = true this.confirmLoading = true
Action(url, query).then((res) => { Action(url, query).then((res) => {
if (res.success) { if (res.success) {
@@ -113,6 +113,7 @@ export default {
dataSource: [], dataSource: [],
confirmLoading: false, confirmLoading: false,
url: { url: {
queryById: 'params/paramsInfo/queryById',
list: 'params/paramsInfo/page', list: 'params/paramsInfo/page',
add: 'params/paramsInfo/add', add: 'params/paramsInfo/add',
edit: 'params/paramsInfo/edit', edit: 'params/paramsInfo/edit',
@@ -227,7 +228,12 @@ export default {
}, },
//编辑 //编辑
edit(item) { edit(item) {
this.$refs.addModelRef.editModel(JSON.parse(JSON.stringify(item))) let _this = this
getAction(_this.url.queryById, { id: item.id }).then((res) => {
if (res.success) {
this.$refs.addModelRef.editModel(JSON.parse(JSON.stringify(res.result)))
}
})
}, },
//删除 //删除
deleteLib(val) { deleteLib(val) {
@@ -172,7 +172,7 @@
this.$message.success(this.$t('OperationSuccessful')) this.$message.success(this.$t('OperationSuccessful'))
this.visible = false this.visible = false
this.selectedRowKeys = [] this.selectedRowKeys = []
this.$emit('addModelList') this.$emit('transferListForm')
} else { } else {
this.$message.warning(this.$t('operationFailed')) this.$message.warning(this.$t('operationFailed'))
this.confirmLoading = false this.confirmLoading = false