Bläddra i källkod

bugfix 解决一部分0703反馈bug

docs_0727
lb 1 år sedan
förälder
incheckning
9c3133aa29
12 ändrade filer med 104 tillägg och 119 borttagningar
  1. +2
    -1
      public/index.html
  2. +31
    -11
      src/components/BaseSearchForm.vue
  3. +6
    -4
      src/components/DialogWithMenu.vue
  4. +4
    -2
      src/mixins/basic-page.js
  5. +1
    -1
      src/router/index.js
  6. +0
    -1
      src/views/atomViews/ListViewWithHead.vue
  7. +31
    -26
      src/views/modules/pms/order/components/BaseSearchForm.vue
  8. +1
    -1
      src/views/modules/pms/order/components/DialogJustForm.vue
  9. +4
    -2
      src/views/modules/pms/order/components/ListSectionWithHead.vue
  10. +3
    -49
      src/views/modules/pms/order/index.vue
  11. +2
    -0
      src/views/modules/sys/user-add-or-update.vue
  12. +19
    -21
      src/views/modules/sys/user.vue

+ 2
- 1
public/index.html Visa fil

@@ -39,8 +39,9 @@
<script>
// window.SITE_CONFIG['apiURL'] = 'http://192.168.1.103:8080/pms-am';
// window.SITE_CONFIG['apiURL'] = 'http://192.168.1.49:8080/pms-am'; // tengyun
window.SITE_CONFIG['apiURL'] = 'http://192.168.1.67:8080/pms-am'; // wenzhang
// window.SITE_CONFIG['apiURL'] = 'http://192.168.1.62:8080/pms-am'; // tao
window.SITE_CONFIG['apiURL'] = 'http://192.168.1.21:8080/pms-am'; // xv
// window.SITE_CONFIG['apiURL'] = 'http://192.168.1.21:8080/pms-am'; // xv
// window.SITE_CONFIG['apiURL'] = 'http://localhost:3000/p//////ms-am'; // xv
</script>
<% } %>


+ 31
- 11
src/components/BaseSearchForm.vue Visa fil

@@ -8,20 +8,40 @@
:key="opt.prop"
:label="opt.label ? opt.label : null"
:prop="opt.prop ?? '' + index"
:rules="opt.bind?.rules ? opt.bind.rules : undefined"
>
<el-input v-if="opt.input" v-model="dataForm[opt.prop]" v-bind="opt.bind" clearable size="small" />
<el-select v-if="opt.select" v-model="dataForm[opt.prop]" v-bind="opt.bind" clearable size="small">
<el-option v-for="item in opt.select" :key="item.value + Math.random().toString()" :label="item.label" :value="item.value" />
:rules="opt.bind?.rules ? opt.bind.rules : undefined">
<el-input
v-if="opt.input"
v-model="dataForm[opt.prop]"
v-bind="opt.bind"
clearable
size="small"
@keydown.enter.native.prevent="handleBtnClick('查询')" />
<el-select
v-if="opt.select"
v-model="dataForm[opt.prop]"
v-bind="opt.bind"
clearable
size="small"
@keydown.enter.native.prevent="handleBtnClick('查询')">
<el-option
v-for="item in opt.select"
:key="item.value + Math.random().toString()"
:label="item.label"
:value="item.value" />
</el-select>
<el-date-picker v-if="opt.timerange" v-model="dataForm[opt.prop]" v-bind="opt.bind" clearable size="small" />
<el-date-picker
v-if="opt.timerange"
v-model="dataForm[opt.prop]"
v-bind="opt.bind"
clearable
size="small"
@keydown.enter.native.prevent="handleBtnClick('查询')" />
<el-upload
v-if="opt.upload"
size="small"
:key="'upload_' + Math.random().toString()"
class="inline-block pl-3"
action="https://jsonplaceholder.typicode.com/posts/"
>
action="https://jsonplaceholder.typicode.com/posts/">
<el-button type="primary">上传文件</el-button>
</el-upload>
<el-button
@@ -30,9 +50,9 @@
size="small"
:type="opt.button.type"
v-bind="opt.bind"
@click="handleBtnClick(opt.button.name)"
>{{ opt.button.name }}</el-button
>
@click="handleBtnClick(opt.button.name)">
{{ opt.button.name }}
</el-button>
</el-form-item>
</el-form>
</el-row>


+ 6
- 4
src/components/DialogWithMenu.vue Visa fil

@@ -4,7 +4,7 @@
:visible="dialogVisible"
:destroy-on-close="false"
@close="handleClose"
:close-on-click-modal="configs.clickModalToClose ?? true">
:close-on-click-modal="configs.clickModalToClose ?? false">
<!-- title -->
<div slot="title" class="dialog-title">
<h1 class="">
@@ -497,16 +497,18 @@ export default {
setTimeout(
() => {
Object.keys(this.dataForm).forEach((key) => {
console.log('reset form, key', key)
if (excludeId && key === "id") return;
if ("files" in this.dataForm) this.dataForm.files = [];
if ("fileIds" in this.dataForm) this.dataForm.fileIds = [];
else this.dataForm[key] = null;
else if ("fileIds" in this.dataForm) this.dataForm.fileIds = [];
else this.$set(this.dataForm, key, null)
if (Array.isArray(this.fileList)) {
this.fileList = [];
}
});
this.activeMenu = this.configs.menu[0].name;
this.$refs.dataForm[0].clearValidate();
this.$refs.dataForm[0].resetFields();
console.log("清除Form...", this.dataForm);
},
immediate ? 0 : 200
);


+ 4
- 2
src/mixins/basic-page.js Visa fil

@@ -103,18 +103,20 @@ export default {
this.$refs.addOrUpdate.init(val.data.id);
});
} else if (val.type === "delete") {
console.log('va', val)
this.deleteHandle(val.data.id, val.data.name)
}
},
// 删除
deleteHandle(id, name) {
this.$confirm(`确定对[名称=${name}]进行删除操作?`, "提示", {
this.$confirm(`确定对删除 ${name}?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.$http.delete(this.urlOptions.deleteURL, { data: [id] }).then(({ data }) => {
// this.$http.delete(this.urlOptions.deleteURL, { data: [id] }).then(({ data }) => {
this.$http.delete(this.urlOptions.deleteURL + `/${id}`).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: "操作成功",


+ 1
- 1
src/router/index.js Visa fil

@@ -74,7 +74,7 @@ export function addDynamicRoute(routeParams, router) {
}

const router = new Router({
mode: 'history',
mode: 'hash',
scrollBehavior: () => ({ y: 0 }),
routes: pageRoutes.concat(moduleRoutes)
})


+ 0
- 1
src/views/atomViews/ListViewWithHead.vue Visa fil

@@ -274,7 +274,6 @@ export default {
}).then(({ data: res }) => {
if (res.code === 0) {
this.$message.success("删除成功!");

this.page = 1;
this.size =
"defaultPageSize" in this.tableConfig.column ? this.tableConfig.column.defaultPageSize : 20;


+ 31
- 26
src/views/modules/pms/order/components/BaseSearchForm.vue Visa fil

@@ -6,26 +6,45 @@

<div class="actual-form">
<el-form :inline="true" :model="dataForm" :rules="headConfig.rules">
<!-- <el-col :span="opt.span ? +opt.span : 4" v-for="opt in options" :key="opt.id"> -->
<el-form-item
v-for="(opt, index) in headConfig.fields"
:key="opt.prop"
:label="opt.label ? opt.label : null"
:prop="opt.prop ?? '' + index"
:rules="opt.bind?.rules ? opt.bind.rules : undefined"
>
<el-input v-if="opt.input" v-model="dataForm[opt.prop]" v-bind="opt.bind" clearable size="small" />
<el-select v-if="opt.select" v-model="dataForm[opt.prop]" v-bind="opt.bind" clearable size="small">
<el-option v-for="item in opt.select" :key="item.value + Math.random().toString()" :label="item.label" :value="item.value" />
:rules="opt.bind?.rules ? opt.bind.rules : undefined">
<el-input
v-if="opt.input"
v-model="dataForm[opt.prop]"
v-bind="opt.bind"
clearable
size="small"
@keydown.enter.native.prevent="handleBtnClick('查询')" />
<el-select
v-if="opt.select"
v-model="dataForm[opt.prop]"
v-bind="opt.bind"
clearable
size="small"
@keydown.enter.native.prevent="handleBtnClick('查询')">
<el-option
v-for="item in opt.select"
:key="item.value + Math.random().toString()"
:label="item.label"
:value="item.value" />
</el-select>
<el-date-picker v-if="opt.timerange" v-model="dataForm[opt.prop]" v-bind="opt.bind" clearable size="small" />
<el-date-picker
v-if="opt.timerange"
v-model="dataForm[opt.prop]"
v-bind="opt.bind"
clearable
size="small"
@keydown.enter.native.prevent="handleBtnClick('查询')" />
<el-upload
v-if="opt.upload"
size="small"
:key="'upload_' + Math.random().toString()"
class="inline-block pl-3"
action="https://jsonplaceholder.typicode.com/posts/"
>
action="https://jsonplaceholder.typicode.com/posts/">
<el-button type="primary">上传文件</el-button>
</el-upload>
<el-button
@@ -34,9 +53,9 @@
size="small"
:type="opt.button.type"
v-bind="opt.bind"
@click="handleBtnClick(opt.button.name)"
>{{ opt.button.name }}</el-button
>
@click="handleBtnClick(opt.button.name)">
{{ opt.button.name }}
</el-button>
</el-form-item>
</el-form>
</div>
@@ -61,21 +80,7 @@ export default {
dataForm: {},
};
},

// 这个 watch 出现得没啥必要......
// watch: {
// dataForm: {
// handler: (val) => {
// console.log("[BaseSearchForm::watcher::dataForm]", val);
// },
// deep: true,
// },
// },

created() {},
mounted() {
// console.log("[BaseSearchForm] configs:", JSON.parse(JSON.stringify(this.headConfig)));

this.headConfig.fields.forEach((field, index) => {
// 没有 field.prop ,则为按钮之类的
if (!field.prop) return;


+ 1
- 1
src/views/modules/pms/order/components/DialogJustForm.vue Visa fil

@@ -410,7 +410,7 @@ export default {
if (res.code === 0) {
this.$message.success(method === "POST" ? "添加成功" : "更新成功");
this.$emit("refreshDataList");
if (method === "POST") this.handleClose();
this.handleClose();
} else {
this.$message({
message: `${res.code}: ${res.msg}`,


+ 4
- 2
src/views/modules/pms/order/components/ListSectionWithHead.vue Visa fil

@@ -35,7 +35,8 @@
v-if="renderDialog"
fullscreen
:configs="dialogConfig"
@destroy-dialog="renderDialog = false" />
@destroy-dialog="renderDialog = false"
@refreshDataList="getAList(Object.assign({}, listQuery, extraSearchConditions, params));" />

<DialogWithMenu
modal-append-to-body
@@ -43,7 +44,8 @@
v-if="renderMenuDialog"
fullscreen
:configs="dialogConfig"
@destroy-dialog="renderMenuDialog = false" />
@destroy-dialog="renderMenuDialog = false"
@refreshDataList="getAList(Object.assign({}, listQuery, extraSearchConditions, params));" />

<DialogUpload
ref="uploadDialog"


+ 3
- 49
src/views/modules/pms/order/index.vue Visa fil

@@ -1,13 +1,6 @@
<template>
<div class="main-container">
<!-- <div class="inner-sidebar">
<a href="#ongoing" :class="{ active: activeTable === '#ongoing' }" @click.prevent="scrollTo('#ongoing')">进行中的订单</a>
<a href="#pending" :class="{ active: activeTable === '#pending' }" @click.prevent="scrollTo('#pending')">等待订单</a>
<a href="#finished" :class="{ active: activeTable === '#finished' }" @click.prevent="scrollTo('#finished')">完成订单</a>
</div> -->

<div class="list-view-with-head-list">
<!-- <ListViewWithHead :table-configs="tableConfigs" :head-configs="headFormConfigs" :dialog-configs="dialogConfigs" /> -->
<ListSectionWithHead
id="ongoing"
:refresh-key="keys.ongoing"
@@ -40,29 +33,15 @@
/> -->
</div>
</div>

<!-- <div style="padding: 16px; background: #fff; border-radius: 8px">
<el-table :data="dataList">
<el-table-column key="id" prop="id" label="ID"></el-table-column>
<el-table-column key="name" prop="name" label="名字"></el-table-column>
<el-table-column key="age" prop="age" label="年龄"></el-table-column>
<el-table-column key="opt" label="操作">
<template slot-scope="scope">
<el-button @click.native.prevent="handleUp(scope)">up</el-button>
<el-button @click.native.prevent="handleDown(scope)">down</el-button>
</template>
</el-table-column>
</el-table>
</div> -->
</template>

<script>
import initConfig from "./config";
import ListViewWithHead from "./components/ListViewWithHead.vue";
// import ListViewWithHead from "./components/ListViewWithHead.vue";
import ListSectionWithHead from "./components/ListSectionWithHead.vue";
export default {
name: "OrderView",
components: { ListViewWithHead, ListSectionWithHead },
components: { ListSectionWithHead },
provide() {
return {
urls: this.allUrls,
@@ -82,16 +61,6 @@ export default {
finished: Math.random().toString(),
},
};
// return {
// dataList: [
// { id: 1, name: "张三", age: 12 },
// { id: 2, name: "李四", age: 13 },
// { id: 3, name: "王五", age: 14 },
// { id: 4, name: "陈鼻", age: 15 },
// { id: 5, name: "肖上唇", age: 16 },
// ],
// limit: 20
// };
},
created() {},
mounted() {},
@@ -110,22 +79,7 @@ export default {
behavior: 'smooth'
})
},
// handleUp({ $index, row }) {
// console.log("row: ", $index, row);
// if ($index === 0) return;
// const [item] = this.dataList.splice($index, 1);
// console.log("item: ", item);
// this.dataList.splice($index - 1, 0, item);
// console.log("dataList: ", this.dataList);
// // this.dataList
// },
// handleDown({ $index, row }) {
// // const { id } = row;
// if ($index === this.limit) return;
// const [item] = this.dataList.splice($index, 1);
// this.dataList.splice($index + 1, 0, item);
// },
//

handleRefreshTable(tableNameList) {
if (Array.isArray(tableNameList)) {
tableNameList.forEach(name => {


+ 2
- 0
src/views/modules/sys/user-add-or-update.vue Visa fil

@@ -186,11 +186,13 @@ export default {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
console.log('========= HERE ===========')
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
console.log('========= THERE ===========')
this.visible = false
this.$emit('refreshDataList')
}


+ 19
- 21
src/views/modules/sys/user.vue Visa fil

@@ -2,35 +2,33 @@
<el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__user">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<base-table
:table-props="tableProps"
:page="listQuery.page"
:limit="listQuery.limit"
:table-data="tableData"
>
<base-table :table-props="tableProps" :page="listQuery.page" :limit="listQuery.limit" :table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
@clickBtn="(payload) => handleClick({
type: payload.type,
data: {
...payload.data,
name: payload.data.username
}
})" />
</base-table>
<pagination
:limit.sync="listQuery.limit"
:page.sync="listQuery.page"
:total="listQuery.total"
@pagination="getDataList"
/>
@pagination="getDataList" />
<!-- 弹窗, 新增 / 修改 -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
>
:before-close="handleCancel">
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
</base-dialog>
</div>
@@ -41,7 +39,7 @@
import basicPage from "@/mixins/basic-page";
import AddOrUpdate from "./user-add-or-update";
import i18n from "@/i18n";
import sysFilter from '@/filters/sys-filter'
import sysFilter from "@/filters/sys-filter";
const tableProps = [
{
prop: "username",
@@ -62,12 +60,12 @@ const tableProps = [
{
prop: "gender",
label: i18n.t("user.gender"),
filter: sysFilter('sex'),
filter: sysFilter("sex"),
},
{
prop: "status",
label: i18n.t("user.status"),
filter: sysFilter('userStatus'),
filter: sysFilter("userStatus"),
},
{
prop: "createDate",
@@ -121,7 +119,7 @@ export default {
components: {
AddOrUpdate,
},
methods:{
methods: {
//search-bar点击
buttonClick(val) {
switch (val.btnName) {
@@ -131,14 +129,14 @@ export default {
this.getDataList();
break;
case "add":
this.addOrEditTitle = '新增'
this.addOrEditTitle = "新增";
this.addOrUpdateVisible = true;
this.addOrUpdateHandle()
this.addOrUpdateHandle();
break;
default:
console.log(val)
}
console.log(val);
}
},
}
},
};
</script>

Laddar…
Avbryt
Spara