| | |
| | | <zt-dialog ref="dialog" column="2" title="选择配置项" :hasConfirm="true" @confirm="formSubmit" :append-to-body="true"> |
| | | <el-card shadow="never" class="aui-card--fill"> |
| | | <div class="mod-project-project}"> |
| | | <zt-table-wraper :dataForm="dataForm" ref="tableObj" v-slot="{ table }" query-url="/configItemChange/ConfigItemChange/getItemList"> |
| | | <zt-table-wraper :dataForm="dataForm" ref="tableObj" v-slot="{ table }" query-url="/configItemChange/ConfigItemChange/getItemList" |
| | | @dataLoaded="dataLoaded" |
| | | > |
| | | <el-table |
| | | :data="table.dataList" |
| | | height="100px" |
| | |
| | | </el-table-column> |
| | | <el-table-column prop="itemName" width="200" label="配置项名称"> |
| | | </el-table-column> |
| | | <el-table-column prop="itemDentify" align="center" min-width="290" label="配置项标识"> |
| | | <el-table-column prop="itemIdentify" align="center" min-width="290" label="配置项标识"> |
| | | </el-table-column> |
| | | <el-table-column prop="version" align="center" width="120" label="版本"> |
| | | </el-table-column> |
| | |
| | | clearable></zt-dict> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" width="120" align="center"> |
| | | <template v-slot="{ row }"> |
| | | <zt-table-button size="small" v-show="isPreview(row)" type="primary" |
| | | @click="preview(row)">预览 |
| | | </zt-table-button> |
| | | <zt-table-button size="small" v-show="isDownload(row)" type="primary" |
| | | @click="download(row)">下载 |
| | | </zt-table-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </zt-table-wraper> |
| | | </div> |
| | | </el-card> |
| | | <Preview ref="view" :pageMarkerfun="ConfigItemList"></Preview> |
| | | </zt-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import Preview from "@/views/pages/view.vue"; |
| | | export default { |
| | | name: 'configItem-list', |
| | | data() { |
| | | return { |
| | | pageCode:'', |
| | | ConfigItemList: 'ConfigItemList', |
| | | dataForm: { |
| | | id:'', |
| | | ids:null, |
| | | projectId:'', |
| | | checkBoxList:[], |
| | | pageCode:'', |
| | | configChangeList:[], |
| | | remarkList:[], |
| | | configOutboundList:[] |
| | | } |
| | | } |
| | | }, |
| | | components: { |
| | | Preview |
| | | }, |
| | | methods: { |
| | | init(projectId,id) { |
| | | init(projectId,param) { |
| | | console.log(projectId,param,'init projectId,ids,pageCode') |
| | | this.dataForm.projectId = projectId |
| | | this.dataForm.id = id |
| | | console.log(this.dataForm,'this.dataForm.id') |
| | | // this.$nextTick(()=>{ |
| | | // this.$refs.tableObj.query() |
| | | // }) |
| | | this.dataForm.ids = param.ids |
| | | this.dataForm.pageCode =param.pageCode |
| | | console.log(param.pageCode,'init pageCode') |
| | | this.$nextTick(()=>{ |
| | | this.$refs.tableObj.query() |
| | | }) |
| | | }, |
| | | indexFormat(index) { |
| | | return index += 1 |
| | | }, |
| | | dataLoaded(data){ |
| | | console.log(data,'data dataLoaded') |
| | | }, |
| | | changeRow(selection){ |
| | | this.dataForm.checkBoxList = selection |
| | | console.log(this.dataForm.checkBoxList,'this.dataForm.checkList 选中的列表数据') |
| | | this.dataForm.configChangeList = selection |
| | | this.dataForm.remarkList = selection |
| | | this.dataForm.configOutboundList = selection |
| | | console.log(this.dataForm.configChangeList,'this.dataForm.checkList 选中的列表数据') |
| | | }, |
| | | isPreview(row) { |
| | | if (row.files!=null) { |
| | | if (row.files.groups[0].fields[0].files[0]) { |
| | | let fileName = row.files.groups[0].fields[0].files[0].name |
| | | let suffixName = '' |
| | | if (fileName != null) { |
| | | let arr = fileName.split('.') |
| | | suffixName = arr[arr.length - 1].toLowerCase() |
| | | } |
| | | if (suffixName == 'pdf' || suffixName == 'doc' || suffixName == 'docx' || suffixName == 'jpg' || suffixName == 'jpeg' || suffixName == 'png' || suffixName == 'xls' || suffixName == 'xlsx') { |
| | | return true |
| | | } else { |
| | | return false |
| | | } |
| | | } else { |
| | | return false |
| | | } |
| | | } |
| | | }, |
| | | isDownload(row) { |
| | | if (row.files!=null) { |
| | | if (row.files.groups[0].fields[0].files[0]) { |
| | | return true |
| | | } else { |
| | | return false |
| | | } |
| | | } |
| | | }, |
| | | preview(row) { |
| | | this.$refs.view.openAccessoryFormatByForm(row) |
| | | }, |
| | | download(row) { |
| | | if (row.files!=null) { |
| | | if (row.files.groups[0].fields[0].files[0]) { |
| | | let url = row.files.groups[0].fields[0].files[0].url; |
| | | window.location.href = `${url}` |
| | | } |
| | | } |
| | | }, |
| | | async formSubmit(){ |
| | | console.log(this.dataForm,'this.dataForm') |
| | | let res = await this.$http.post('/configItemChange/ConfigItemChange/importItemList', this.dataForm) |
| | | this.$emit('getChangeItemList',this.dataForm) |
| | | await this.$tip.success() |
| | | this.$refs.dialog.close() |
| | | this.$emit('refreshDataList') |
| | | } |
| | | }, |
| | | } |