From a52ce4c9a594e78b5931d487e05d0dd54ac8cd36 Mon Sep 17 00:00:00 2001
From: lzhe <lzhe@example.com>
Date: 星期一, 07 十月 2024 22:38:28 +0800
Subject: [PATCH] Merge branch 'release' of http://122.9.151.159:9090/r/smart-web into release
---
src/views/dnc/craft/document/index.vue | 318 +++++++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 275 insertions(+), 43 deletions(-)
diff --git a/src/views/dnc/craft/document/index.vue b/src/views/dnc/craft/document/index.vue
index 0947fc2..771d798 100644
--- a/src/views/dnc/craft/document/index.vue
+++ b/src/views/dnc/craft/document/index.vue
@@ -1,7 +1,7 @@
<!--
* @Date: 2024-05-26 16:12:09
* @LastEditors: Sneed
- * @LastEditTime: 2024-05-26 21:56:20
+ * @LastEditTime: 2024-06-16 16:19:02
* @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/dnc/craft/document/index.vue
-->
<!--
@@ -15,7 +15,7 @@
<el-card shadow="never" style="height: 100%;" body-style="height: 100%">
<el-container>
<el-aside width="200px">
- <el-tree ref="group" node-key="id" :props="{
+ <el-tree :expand-on-click-node="false" ref="group" node-key="id" :props="{
label: 'name',
hasChildren: 'id'
}" @node-click="nodeClick" highlight-current :current-node-key="selectNode.id" :load="loadNode"
@@ -23,10 +23,20 @@
</el-aside>
<el-container>
<el-header>
- <el-button style="margin-left: 8px;margin-right: auto;" type="danger" plain
- :disabled="!selectNode.id || selectNode.id === 0" @click="del">鍒犻櫎</el-button>
+ <el-button style="margin-left: 8px;" type="danger" plain :disabled="selection.length === 0"
+ @click="del">鍒犻櫎</el-button>
+ <el-button style="margin-left: 8px;margin-right: auto;" type="primary"
+ @click="addNew">鏂板</el-button>
+ <!-- <el-select v-model="params.type" style="width: 240px;margin-left: 8px;">
+ <template #prefix>
+ 鏌ヨ鐩爣
+ </template>
+<el-option v-for="item in options.type" :key="item.value" :label="item.label" :value="item.value" />
+</el-select>
+<el-input style="width: 240px;margin-left: 8px;" v-model="params.keyword" placeholder="璇疯緭鍏ユ绱㈠唴瀹�"></el-input>
+<el-button @click="search" style="margin-left: 8px;" type="primary" icon="el-icon-search"></el-button> -->
</el-header>
- <el-main>
+ <el-main v-if="selectNode.id || selectNode.id == 0">
<el-row :gutter="20">
<el-col :span="12">
<scTable highlight-current-row @dataChange="dataChange" @row-click="rowClick"
@@ -35,33 +45,35 @@
<el-table-column type="selection" width="50"></el-table-column>
<el-table-column label="宸ヨ壓鍖呭悕绉�" prop="name" width="160">
</el-table-column>
- <el-table-column label="宸ヨ壓鍖呯紪鍙�" prop="allPathName" width="160"></el-table-column>
+ <el-table-column label="宸ヨ壓鍖呯紪鍙�" prop="code" width="160"></el-table-column>
<el-table-column label="鎿嶄綔" fixed="right" align="right" width="160">
<template #default="scope">
<el-button-group>
<el-button text type="primary" size="small"
@click="table_edit(scope.row, scope.$index)">缂栬緫</el-button>
<el-button text type="primary" size="small"
- @click="del([scope.row])">鍒犻櫎</el-button>
+ @click="openLog(scope.row)">鍙樻洿鏃ュ織</el-button>
</el-button-group>
</template>
</el-table-column>
</scTable>
</el-col>
<el-col :span="12">
- <h2>宸ヨ壓鍖呰鎯�</h2>
- <el-row>
+ <h2 style="background-color: var(--el-color-primary);color: #fff;padding: 4px 20px;">
+ 宸ヨ壓鍖呰鎯�</h2>
+ <el-row style="margin: 14px 0;">
<el-col :span="12">
- 宸ヨ壓鍖呭悕绉帮細
+ 宸ヨ壓鍖呭悕绉帮細{{ info.name }}
</el-col>
<el-col :span="12">
- 宸ヨ壓鍖呯紪鍙凤細
+ 宸ヨ壓鍖呯紪鍙凤細{{ info.code }}
</el-col>
<el-col :span="12">
- 宸ヨ壓鍖呮墍鍦ㄧ洰褰曪細
+ 宸ヨ壓鍖呮墍鍦ㄧ洰褰曪細{{ info.sourcePath }}
</el-col>
- <el-col :span="24">
- <Children></Children>
+ <el-col :span="24" style="margin: 14px 0;">
+ <Children @success="success" :list="list" @delete="searchFile" :id="info.id">
+ </Children>
</el-col>
</el-row>
</el-col>
@@ -71,23 +83,48 @@
</el-container>
</el-container>
</el-card>
- <el-dialog v-model="visible" title="鏂板缓鏂囦欢澶�" width="500">
- <el-form :model="formEdit" :rules="rulesEdit" ref="dialogForm" label-width="120px" label-position="center">
- <el-form-item label="涓婄骇鐩綍">
- <el-input disabled v-model="formEdit.parentName" />
- </el-form-item>
- <el-form-item label="鐩綍鍚嶇О" prop="name">
- <el-input v-model="formEdit.name" />
- </el-form-item>
- <el-col :span="24">
- <el-form-item>
- <slot>
- <el-button type="primary" @click="submit">鎻愪氦</el-button>
- </slot>
- </el-form-item>
- </el-col>
- </el-form>
- </el-dialog>
+ <scDialog v-model="newVisible">
+ <scForm ref="form" :config="config" :rules="rules" v-model="form" @submit="submit">
+ </scForm>
+ </scDialog>
+ <scDialog v-model="logVisible">
+ <el-container>
+ <el-header>
+ <el-button type="primary" @click="exportExcel">瀵煎嚭</el-button>
+ <el-input v-model="searchParams.fileName" style="width: 240px;margin-left: 8px;" placeholder="">
+ <template #prefix>鏂囦欢鍚嶇О</template>
+ </el-input>
+ <el-select v-model="searchParams.fileClass" style="width: 240px;margin-left: 8px;">
+ <template #prefix>
+ 鏂囦欢绫诲瀷
+ </template>
+ <el-option v-for="item in options.fileClass" :key="item.value" :label="item.label"
+ :value="item.value" />
+ </el-select>
+ <el-select v-model="searchParams.fileType" style="width: 240px;margin-left: 8px;">
+ <template #prefix>
+ 鏂囦欢灞炴��
+ </template>
+ <el-option v-for="item in options.fileType" :key="item.value" :label="item.label"
+ :value="item.value" />
+ </el-select>
+ </el-header>
+ <el-main>
+ <scTable highlight-current-row ref="table1" :apiObj="apiObj1" @selection-change="selectionChange"
+ stripe>
+ <el-table-column label="鏂囦欢鍚嶇О" prop="fileName" width="160">
+ </el-table-column>
+ <el-table-column label="鐗堟湰鍙�" prop="version" width="160"></el-table-column>
+ <el-table-column label="鏂囦欢绫诲瀷" prop="suffix" width="160"></el-table-column>
+ <el-table-column label="鏂囦欢灞炴��" prop="fileType" width="160"></el-table-column>
+ <el-table-column label="鎿嶄綔绫诲瀷" prop="operationType" width="160"></el-table-column>
+ <el-table-column label="鎿嶄綔浜哄憳" prop="operatorName" width="160"></el-table-column>
+ <el-table-column label="鎿嶄綔鏃堕棿" prop="operationTime" width="160"></el-table-column>
+ </scTable>
+ </el-main>
+ </el-container>
+ </scDialog>
+
</el-main>
</template>
@@ -97,29 +134,135 @@
components: {
Children
},
+ watch: {
+ searchParams: {
+ handler() {
+ this.$refs?.table1?.reload()
+ },
+ deep: true
+ }
+ },
data() {
return {
treeData: [],
selection: [],
+ params: {
+ type: 'BAG_OR_PROCESS'
+ },
selectNode: {
- id: 0
+ // id: 0
},
- visible: false,
- formEdit: {
- parentId: '',
- parentName: '',
- name: ''
+ apiObj: {
+ get: async (data) => {
+ let params = {
+ ...data,
+ catalogueId: this.selectNode.id,
+ // ...this.params
+ }
+ return await this.$HTTP.get(`/api/blade-dnc/dnc-art-bag/cur-sub-page`, {}, { params }).then(res => {
+ return res
+ })
+ }
},
- rulesEdit: {
- name: [
- { required: true, message: '蹇呭~' }
+ apiObj1: {
+ get: async (data) => {
+ let params = {
+ ...data,
+ catalogueId: this.selectNode.id,
+ // ...this.params
+ }
+ return await this.$HTTP.post(`/api/blade-dnc/dnc-art-bag-log/page`, {}, { params, data: { ...this.searchParams } }).then(res => {
+ return res
+ })
+ }
+ },
+ newVisible: false,
+ config: {
+ labelWidth: 120,
+ formItems: [
+ {
+ component: 'input',
+ label: '宸ヨ壓鍖呭悕绉�',
+ name: 'name',
+ options: {
+ placeholder: '',
+ maxlength: 100,
+ }
+ },
+ {
+ component: 'input',
+ label: '宸ヨ壓鍖呯紪鍙�',
+ name: 'code',
+ options: {
+ multiple: false,
+ data: []
+ },
+ disabled: false
+ }
]
},
+ form: {
+ },
+ rules: {
+ name: [
+ { required: true, message: '璇疯緭鍏�' },
+ ],
+ code: [
+ { required: true, message: '璇疯緭鍏�' },
+ ]
+ },
+ selection: [],
+ logVisible: false,
+ row: {},
+ options: {
+ type: [
+ {
+ value: 'BAG_OR_PROCESS',
+ label: '宸ヨ壓鍖呭拰绋嬪簭鏂囨。'
+ },
+ {
+ value: 'ONLY_BAG',
+ label: '浠呭伐鑹哄寘'
+ },
+ {
+ value: 'ONLY_PROCESS',
+ label: '浠呯▼搴忔枃妗�'
+ },
+ ],
+ fileType: [
+ {
+ value: 1,
+ label: '绋嬪簭'
+ },
+ {
+ value: 2,
+ label: '鏂囨。'
+ },
+ ]
+ },
+ searchParams: {
+ fileName: '',
+ fileClass: '',
+ fileType: '',
+ },
+ info: {},
+ list: []
}
},
created() {
+ this.init()
},
methods: {
+ init() {
+ this.$HTTP.get(`/api/blade-system/param/detail?paramKey=dnc.support.file.suffix.list`).then(res => {
+ this.options.fileClass = res.data.paramValue.split(',').map(v => {
+ return {
+ value: v,
+ label: v
+ }
+ })
+ })
+ },
loadNode(node, resolve) {
console.log(node, '>>>>>>')
let id = node.level === 0 ? '' : node.data.id
@@ -132,10 +275,62 @@
resolve(res.data)
})
},
- del() {
- this.$HTTP.delete(`/api/blade-dnc/dnc-process-catalogue/remove`, {}, { data: [this.selectNode.id] }).then(res => {
- this.$message.success("鎿嶄綔鎴愬姛");
+ addNew() {
+ this.$refs?.form?.resetFields()
+ this.form = {
+ name: '',
+ code: ''
+ }
+ this.config.formItems[1].disabled = false
+ this.newVisible = true
+ },
+ submit() {
+ if (this.form.id) {
+ return this.$HTTP.put(`/api/blade-dnc/dnc-art-bag/update?id=${this.form.id}&name=${this.form.name}`).then(res => {
+ if (res.success) {
+ this.newVisible = false
+ this.$refs.table.reload()
+ }
+ })
+ }
+ this.$HTTP.post(`/api/blade-dnc/dnc-art-bag/insert`, {
+ catalogueId: this.selectNode.id,
+ ...this.form
+ }).then(res => {
+ if (res.success) {
+ this.newVisible = false
+ this.$refs.table.reload()
+ } else {
+ this.$message.error(res.msg)
+ }
+
})
+ },
+ table_edit(row) {
+ this.$refs?.form?.resetFields()
+ this.form = {
+ name: row.name,
+ code: row.code,
+ id: row.id,
+ }
+ this.config.formItems[1].disabled = true
+ this.newVisible = true
+ },
+ selectionChange(selection) {
+ this.selection = selection
+ },
+ del() {
+ this.$confirm(`鏄惁纭鍒犻櫎?`, '鎻愮ず', {
+ type: 'warning',
+ }).then(() => {
+ this.$HTTP.delete(`/api/blade-dnc/dnc-art-bag/remove`, {}, { data: this.selection.map(v => v.id) }).then(res => {
+ this.$message.success("鎿嶄綔鎴愬姛");
+ this.$refs.table.reload()
+ })
+ }).catch(() => {
+ return false
+ })
+
},
nodeClick(node, treeNode) {
console.log(node, treeNode)
@@ -143,6 +338,43 @@
...node,
parentName: treeNode?.parent?.data?.name || '-'
}
+ this.$refs?.table?.reload()
+ },
+ openLog(row) {
+ this.logVisible = true
+ this.row = row
+ },
+ dataChange(data) {
+ console.log(data, '>>>>>>>>dataChange')
+ this.rowClick(data.data.records[0])
+ },
+ rowClick(row) {
+ if (!row) return this.info = {}
+ this.$HTTP.get(`/api/blade-dnc/dnc-art-bag/get/${row.id}`).then(res => {
+ if (res.success) {
+ this.info = res.data
+ this.searchFile()
+ } else {
+ this.info = {}
+ }
+ })
+
+ },
+ searchFile() {
+ this.$HTTP.get(`/api/blade-dnc/dnc-art-file/list?artBagId=${this.info.id}`).then(res => {
+ if (res.success) {
+ this.list = res.data
+ }
+ })
+ },
+ exportExcel() {
+
+ },
+ search() {
+
+ },
+ success() {
+ this.searchFile()
}
}
}
--
Gitblit v1.9.3