|
@@ -103,7 +103,18 @@
|
|
|
label="排序"
|
|
|
sortable="custom"
|
|
|
width="80"
|
|
|
- />
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div style="display: flex; align-items: center">
|
|
|
+ <span style="margin-right: 10px">{{ scope.row.sequence }}</span>
|
|
|
+ <i
|
|
|
+ class="el-icon-edit"
|
|
|
+ @click="handleEditSequence(scope.row)"
|
|
|
+ style="cursor: pointer; margin-left: 5px"
|
|
|
+ ></i>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column prop="name" label="项目名称" sortable="custom" />
|
|
|
<el-table-column prop="tech_report_location" label="技术报告位置" />
|
|
|
<el-table-column prop="department" label="部门" sortable="custom" />
|
|
@@ -273,6 +284,30 @@
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
<!-- 其余第一个tab的内容... -->
|
|
|
+ <!-- 修改序号 -->
|
|
|
+ <el-dialog
|
|
|
+ :visible.sync="dialogVisible"
|
|
|
+ title="修改序号"
|
|
|
+ width="30%"
|
|
|
+ append-to-body
|
|
|
+ v-el-drag-dialog
|
|
|
+ >
|
|
|
+ <el-form :model="sequenceForm" label-width="80px">
|
|
|
+ <el-form-item label="序号">
|
|
|
+ <el-input-number
|
|
|
+ v-model="sequenceForm.sequence"
|
|
|
+ :min="0"
|
|
|
+ controls-position="right"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <template #footer>
|
|
|
+ <span class="dialog-footer">
|
|
|
+ <el-button @click="dialogVisible = false">取消</el-button>
|
|
|
+ <el-button type="primary" @click="submitSequence">确定</el-button>
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -287,15 +322,18 @@ import {
|
|
|
delete_items,
|
|
|
update_items,
|
|
|
rateScope,
|
|
|
+ sequence,
|
|
|
} from "@/api/knowledge";
|
|
|
import { searchProject, exportItems } from "@/api/project";
|
|
|
import { mapState } from "vuex";
|
|
|
import CKEditor from "ckeditor4-vue";
|
|
|
import axios from "axios";
|
|
|
+import elDragDialog from "@/directive/el-drag-dialog";
|
|
|
export default {
|
|
|
compnents: {
|
|
|
ckeditor: CKEditor.component,
|
|
|
},
|
|
|
+ directives: { elDragDialog },
|
|
|
data() {
|
|
|
// 自定义验证规则
|
|
|
const validateDeleteConfirm = (rule, value, callback) => {
|
|
@@ -341,11 +379,13 @@ export default {
|
|
|
gsprPageForm: {
|
|
|
page: 1,
|
|
|
page_size: 30,
|
|
|
+ /* sort_field:'sequence',
|
|
|
+ sort_order:"asc", */
|
|
|
},
|
|
|
gsprTotal: 0,
|
|
|
departList: [],
|
|
|
- sort_field: "name",
|
|
|
- sort_order: "desc",
|
|
|
+ sort_field: "sequence",
|
|
|
+ sort_order: "asc",
|
|
|
hasExistingData: false,
|
|
|
gsprDialogVisible: false,
|
|
|
gsprDialogTitle: "",
|
|
@@ -396,6 +436,11 @@ export default {
|
|
|
language: "zh-cn",
|
|
|
height: "300px",
|
|
|
},
|
|
|
+ dialogVisible: false,
|
|
|
+ sequenceForm: {
|
|
|
+ sequence: 1,
|
|
|
+ id: null,
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
@@ -410,6 +455,28 @@ export default {
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
+ /* 修改序号 */
|
|
|
+ handleEditSequence(row) {
|
|
|
+ this.sequenceForm.sequence = row.sequence;
|
|
|
+ this.sequenceForm.id = row.id;
|
|
|
+ this.dialogVisible = true;
|
|
|
+ },
|
|
|
+ // 提交序号修改
|
|
|
+ async submitSequence() {
|
|
|
+ try {
|
|
|
+ await sequence({
|
|
|
+ id: this.sequenceForm.id,
|
|
|
+ new_sequence: this.sequenceForm.sequence,
|
|
|
+ });
|
|
|
+ this.$message.success("修改序号成功");
|
|
|
+ this.dialogVisible = false;
|
|
|
+ // 重新加载数据
|
|
|
+ this.fetchGsprData();
|
|
|
+ } catch (error) {
|
|
|
+ this.$message.error("修改序号失败:" + error.message);
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
/* 项目导出 */
|
|
|
async handleExport() {
|
|
|
const loading = this.$loading({
|
|
@@ -421,7 +488,7 @@ export default {
|
|
|
const response = await axios({
|
|
|
url: `${process.env.VUE_APP_BASE_API}/project-input/export`,
|
|
|
method: "post",
|
|
|
- data: {project_id: this.selectedProjectId},
|
|
|
+ data: { project_id: this.selectedProjectId },
|
|
|
headers: {
|
|
|
"Content-Type": "application/json",
|
|
|
Authorization: "Bearer " + localStorage.getItem("token"), // 根据实际token获取方式调整
|
|
@@ -523,6 +590,7 @@ export default {
|
|
|
);
|
|
|
|
|
|
this.contentForm = {
|
|
|
+ sequence: row.sequence,
|
|
|
project: selectedProject.id,
|
|
|
project_name: selectedProject.name,
|
|
|
id: row.id,
|