{
+ this.form[prop] = this.form[prop] ?? [];
+ });
+ }
}
},
deep: true,
@@ -348,7 +378,7 @@ export default {
// 处理输入框数据
this.form[opt.prop] = response.data;
// 更新下外部的 dataForm,防止code字段有数据也报空的bug
- this.$emit('update', this.form)
+ this.$emit('update', this.form);
}
});
}
@@ -377,11 +407,12 @@ export default {
// 上传成功的特殊处理
beforeUpload() {},
// 上传前的验证规则可通过 bind 属性传入
- handleUploadSuccess(response, file, fileList) {
- this.form.files.push({
+ handleUploadSuccess(response, file, prop) {
+ console.log('[handleUploadSuccess]', response, file, prop);
+ this.form[prop].push({
fileName: file.name,
fileUrl: response.data,
- fileType: 2,
+ fileType: prop == 'files' ? 2 : 1,
});
this.$modal.msgSuccess('上传成功');
this.$emit('update', this.form);
@@ -395,8 +426,8 @@ export default {
this.uploadOpen = !this.uploadOpen;
},
- handleDeleteFile(file) {
- this.form.files = this.form.files.filter(
+ handleDeleteFile(file, prop) {
+ this.form[prop] = this.form[prop].filter(
(item) => item.fileUrl != file.fileUrl
);
this.$emit('update', this.form);
diff --git a/src/components/Editor/index.vue b/src/components/Editor/index.vue
index 7cb684f3..1b0d68c1 100644
--- a/src/components/Editor/index.vue
+++ b/src/components/Editor/index.vue
@@ -124,9 +124,9 @@ export default {
this.Quill = new Quill(editor, this.options);
// 取消自动聚焦 start
this.$nextTick(() => {
- this.Quill.blur();
+ this.Quill?.blur();
if (!this.readOnly) {
- this.Quill.enable();
+ this.Quill?.enable();
}
});
// 如果设置了上传地址则自定义图片上传事件
diff --git a/src/layout/components/DialogWithMenu.vue b/src/layout/components/DialogWithMenu.vue
deleted file mode 100644
index efd6428e..00000000
--- a/src/layout/components/DialogWithMenu.vue
+++ /dev/null
@@ -1,978 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/views/base/coreEquipment/components/AssetsUpload.vue b/src/views/base/coreEquipment/components/AssetsUpload.vue
index bd19723d..a5a3319d 100644
--- a/src/views/base/coreEquipment/components/AssetsUpload.vue
+++ b/src/views/base/coreEquipment/components/AssetsUpload.vue
@@ -46,35 +46,36 @@
}}文件大小不超过2MB
-
+
+
+
+
+ 添加属性
+
+
+
编辑
- 确定
+ 保存
-
+
-
-
-
-
-
-
+ ]"
+ @refreshDataList="getList"
+ @cancel="cancelEdit"
+ @destroy="cancelEdit" />
@@ -96,21 +132,21 @@ export default {
tableBtn: [
this.$auth.hasPermi(`base:core-equipment:update`)
? {
- type: 'detail',
- btnName: '详情',
- }
+ type: 'detail',
+ btnName: '详情',
+ }
: undefined,
this.$auth.hasPermi('base:core-equipment:update')
? {
- type: 'edit',
- btnName: '修改',
- }
+ type: 'edit',
+ btnName: '修改',
+ }
: undefined,
this.$auth.hasPermi('base:core-equipment:delete')
? {
- type: 'delete',
- btnName: '删除',
- }
+ type: 'delete',
+ btnName: '删除',
+ }
: undefined,
].filter((v) => v),
tableProps: [
@@ -176,14 +212,18 @@ export default {
type: 'separate',
},
{
- type: this.$auth.hasPermi('base:core-equipment:export') ? 'button' : '',
+ type: this.$auth.hasPermi('base:core-equipment:export')
+ ? 'button'
+ : '',
btnName: '导出',
name: 'export',
plain: true,
color: 'primary',
},
{
- type: this.$auth.hasPermi('base:core-equipment:create') ? 'button' : '',
+ type: this.$auth.hasPermi('base:core-equipment:create')
+ ? 'button'
+ : '',
btnName: '新增',
name: 'add',
plain: true,
@@ -196,7 +236,9 @@ export default {
input: true,
label: '设备名称',
prop: 'name',
- rules: [{ required: true, message: '设备名称不能为空', trigger: 'blur' }],
+ rules: [
+ { required: true, message: '设备名称不能为空', trigger: 'blur' },
+ ],
// bind: {
// disabled: this.editMode == 'detail', // some condition, like detail mode...
// }
@@ -225,7 +267,9 @@ export default {
label: '设备类型',
prop: 'equipmentTypeId',
url: '/base/core-equipment-type/page?pageNo=1&pageSize=100',
- rules: [{ required: true, message: '设备类型不能为空', trigger: 'blur' }],
+ rules: [
+ { required: true, message: '设备类型不能为空', trigger: 'blur' },
+ ],
bind: {
filterable: true,
},
@@ -235,7 +279,11 @@ export default {
label: '预计生产时间(min/天)',
prop: 'workTime',
rules: [
- { required: true, message: '预计生产时间不能为空', trigger: 'blur' },
+ {
+ required: true,
+ message: '预计生产时间不能为空',
+ trigger: 'blur',
+ },
{
type: 'number',
message: '请输入正确的数字值',
@@ -291,7 +339,11 @@ export default {
label: '单件产品加工时间(s)',
prop: 'processingTime',
rules: [
- { required: true, message: '单件产品加工时间不能为空', trigger: 'blur' },
+ {
+ required: true,
+ message: '单件产品加工时间不能为空',
+ trigger: 'blur',
+ },
{
type: 'number',
message: '请输入正确的数字值',
@@ -322,13 +374,19 @@ export default {
[
{
upload: true,
- label: '上传资料',
+ label: '设备资料',
prop: 'files',
},
],
[
- { input: true, label: '备注', prop: 'remark' }
+ {
+ upload: true,
+ label: '设备图片',
+ prop: 'files2',
+ fileType: 1,
+ },
],
+ [{ input: true, label: '备注', prop: 'remark' }],
// [
// {
// assetUpload: true,
@@ -429,7 +487,7 @@ export default {
// 表单参数
form: {
id: null,
- files: []
+ files: [],
},
showUploadComponents: false, // 是否显示上传组件
};
@@ -441,36 +499,36 @@ export default {
computedRows() {
return this.showUploadComponents
? [
- ...this.rows,
- [
- {
- assetUpload: true,
- key: 'eq-assets', // 用于区分不同的上传组件
- label: '上传资料',
- fieldName: 'assets',
- subcomponent: AssetsUpload,
- prop: 'uploadedAssets',
- default: [],
- bind: {
- 'is-pic-mode': false,
+ ...this.rows,
+ [
+ {
+ assetUpload: true,
+ key: 'eq-assets', // 用于区分不同的上传组件
+ label: '上传资料',
+ fieldName: 'assets',
+ subcomponent: AssetsUpload,
+ prop: 'uploadedAssets',
+ default: [],
+ bind: {
+ 'is-pic-mode': false,
+ },
},
- },
- ],
- [
- {
- assetUpload: true,
- key: 'eq-pics', // 用于区分不同的上传组件
- label: '上传图片',
- fieldName: 'images',
- subcomponent: AssetsUpload,
- // prop: '',
- // default: [],
- bind: {
- 'is-pic-mode': true,
+ ],
+ [
+ {
+ assetUpload: true,
+ key: 'eq-pics', // 用于区分不同的上传组件
+ label: '上传图片',
+ fieldName: 'images',
+ subcomponent: AssetsUpload,
+ // prop: '',
+ // default: [],
+ bind: {
+ 'is-pic-mode': true,
+ },
},
- },
- ],
- ]
+ ],
+ ]
: this.rows;
},
},
@@ -512,7 +570,8 @@ export default {
spec: undefined,
description: undefined,
remark: undefined,
- files: []
+ files: [],
+ files2: [],
};
this.resetForm('form');
},
@@ -540,9 +599,12 @@ export default {
if (!valid) {
return;
}
+ const payload = Object.assign({}, this.form);
+ payload.files = [...payload.files, ...payload.files2];
+ delete payload.files2;
// 修改的提交
if (this.form.id != null) {
- updateEquipment(this.form).then((response) => {
+ updateEquipment(payload).then((response) => {
this.$modal.msgSuccess('修改成功');
this.open = false;
this.getList();
@@ -550,7 +612,7 @@ export default {
return;
}
// 添加的提交
- createEquipment(this.form).then((response) => {
+ createEquipment(payload).then((response) => {
this.$modal.msgSuccess('新增成功');
this.open = false;
this.getList();
@@ -569,7 +631,7 @@ export default {
this.getList();
this.$modal.msgSuccess('删除成功');
})
- .catch(() => { });
+ .catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
@@ -587,7 +649,7 @@ export default {
this.$download.excel(response, '设备.xls');
this.exportLoading = false;
})
- .catch(() => { });
+ .catch(() => {});
},
// 查看详情
viewDetail(id) {
diff --git a/src/views/base/coreHotMaterial/add-or-updata.vue b/src/views/base/coreHotMaterial/add-or-updata.vue
index 361e6d1e..4ffcd316 100644
--- a/src/views/base/coreHotMaterial/add-or-updata.vue
+++ b/src/views/base/coreHotMaterial/add-or-updata.vue
@@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
- * @LastEditTime: 2023-11-25 11:25:23
+ * @LastEditTime: 2023-11-27 20:12:00
* @Description:
-->
@@ -11,7 +11,7 @@
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
- label-width="100px">
+ label-width="90px">
diff --git a/src/views/base/coreHotMaterial/index.vue b/src/views/base/coreHotMaterial/index.vue
index 0e8a9ce6..0667b5c9 100644
--- a/src/views/base/coreHotMaterial/index.vue
+++ b/src/views/base/coreHotMaterial/index.vue
@@ -29,7 +29,7 @@
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
- width="50%">
+ width="45%">
diff --git a/src/views/base/coreProduct/add-or-updata.vue b/src/views/base/coreProduct/add-or-updata.vue
index 57f2e71d..a3cee7eb 100644
--- a/src/views/base/coreProduct/add-or-updata.vue
+++ b/src/views/base/coreProduct/add-or-updata.vue
@@ -2,14 +2,14 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
- * @LastEditTime: 2023-11-27 09:23:56
+ * @LastEditTime: 2023-11-27 20:07:09
* @Description:
-->
@@ -114,14 +114,6 @@
-