Commit 6ce821fb authored by “yiyousong”'s avatar “yiyousong”

fix:修改新增应用页面

parent 0fafb4d8
......@@ -44,6 +44,7 @@ export default {
let res = await getAppInfo({ id: this.appId });
if (res.data.code === 1) {
this.appInfo = res.data.data;
console.log(res.data.data);
}
},
......
......@@ -110,38 +110,7 @@
<script>
import { getVersionList, usedVersion, previewVersion } from "@/services/market";
import CheckSite from "../modal/CheckSite.vue";
const columns = [
{
title: "序号",
dataIndex: "num",
width: "65px",
scopedSlots: {
customRender: "num",
},
},
{
title: "版本号",
scopedSlots: { customRender: "version" },
},
{
title: "更新说明",
width: "40%",
dataIndex: "notes",
},
{
title: "应用包",
scopedSlots: { customRender: "fileName" },
},
{
title: "当前是否使用",
scopedSlots: { customRender: "used" },
},
{
title: "操作",
width: "10%",
scopedSlots: { customRender: "action" },
},
];
export default {
props: {
// 应用信息
......@@ -157,6 +126,40 @@ export default {
CheckSite,
},
data() {
const columns = [
{
title: "序号",
dataIndex: "num",
width: "65px",
scopedSlots: {
customRender: "num",
},
},
{
title: "版本号",
scopedSlots: { customRender: "version" },
},
{
title: "更新说明",
width: "40%",
customRender: (text) => {
return <span>{text.notes ? text.notes : "--"}</span>;
},
},
{
title: "应用包",
scopedSlots: { customRender: "fileName" },
},
{
title: "当前是否使用",
scopedSlots: { customRender: "used" },
},
{
title: "操作",
width: "10%",
scopedSlots: { customRender: "action" },
},
];
return {
api: process.env.VUE_APP_API_BASE_URL.includes("base")
? process.env.VUE_APP_API_BASE_URL.replace("base", "")
......@@ -190,7 +193,6 @@ export default {
let { data, total } = res.data.data;
this.tableData = data;
this.total = total;
console.log(data);
}
},
// 使用
......
......@@ -144,11 +144,11 @@ export default {
page: this.current,
size: this.size,
appId: this.appId,
fieldName: this.searchVal,
});
this.loading = false;
if (res.data.code === 1) {
let { data, total } = res.data.data;
if (!data.length && this.current > 1) {
this.current -= 1;
this.getTempleteList();
......
......@@ -18,6 +18,9 @@
<a-form-model-item label="应用名称" prop="appName">
<a-input v-model="form.appName" placeholder="请输入应用名称" />
</a-form-model-item>
<a-form-model-item label="应用编码" prop="appCode">
<a-input v-model="form.appCode" placeholder="请输入应用编码" />
</a-form-model-item>
<a-form-model-item label="应用主题" prop="appThemeName">
<a-input v-model="form.appThemeName" placeholder="请输入应用主题" />
<!-- <a-select v-model="form.appThemeName" placeholder="请选择应用主题">
......@@ -91,23 +94,24 @@
:multiple="false"
:file-list="fileList"
@change="handleChangeFile"
accept="application/x-zip-compressed"
>
<a-button type="primary">
<a-icon type="upload" /> 选择文件
</a-button>
</a-upload>
</a-form-model-item>
<!-- <a-form-model-item label="更新说明" prop="">
<a-form-model-item label="更新说明" prop="notes">
<a-textarea
placeholder="请输入应用简介"
v-model="form.name"
placeholder="请输入更新说明"
v-model="form.notes"
allow-clear
:autoSize="{
minRows: 4,
maxRows: 4,
}"
/>
</a-form-model-item> -->
</a-form-model-item>
<a-form-model-item label="更新数据" prop="dataUpdate">
<YSwitch
checkedChildren="有"
......@@ -142,6 +146,7 @@
import YSwitch from "../../../../components/yswitch/YSwitch.vue";
import { saveApp } from "@/services/market";
import { mapGetters } from "vuex";
import { changeCodeNumber } from "@/utils/validate";
export default {
components: {
YSwitch,
......@@ -175,6 +180,7 @@ export default {
siteId: undefined, // 站点id
siteName: "", // 站点名称
appName: "", // 应用名称
appCode: "", // 应用编码
appIconPath: "", // 应用图标
appThemeName: "", // 应用主题名称
type: 1, // 类型(1.终端应用,2.移动端应用)
......@@ -183,6 +189,7 @@ export default {
fileName: "", // 文件名称
filePath: "", // 文件相对路径地址
summary: "", // 简介
notes: "", // 更新说明
dataUpdate: 0, // 是否数据更新(0.否,1.是)
},
replaceFields: {
......@@ -195,6 +202,9 @@ export default {
appName: [
{ required: true, message: "请输入应用名称", trigger: "blur" },
],
appCode: [
{ required: true, validator: changeCodeNumber, trigger: "blur" },
],
appIconPath: [
{ required: true, message: "请上传应用图标", trigger: "change" },
],
......@@ -207,6 +217,9 @@ export default {
summary: [
{ required: true, message: "请输入应用简介", trigger: "blur" },
],
notes: [
{ required: true, message: "请输入应用更新说明", trigger: "blur" },
],
filePath: [
{ required: true, message: "请上传应用", trigger: "change" },
],
......@@ -277,6 +290,7 @@ export default {
},
// 上传应用
handleChangeFile(info) {
console.log(info);
let fileList = [...info.fileList];
fileList = fileList.slice(-1);
fileList = fileList.map((file) => {
......@@ -337,12 +351,28 @@ export default {
flex: 1;
display: flex;
flex-direction: column;
overflow-y: scroll;
}
.main {
height: 1px;
padding: 24px;
flex: 1;
overflow-y: auto;
&::-webkit-scrollbar {
width: 6px;
overflow-y: auto;
}
&::-webkit-scrollbar-thumb {
border-radius: 6px;
background-color: rgba(144, 147, 153, 0.5);
}
&::-webkit-scrollbar-track {
border-radius: 6px;
background: #fff;
}
.icon {
width: 100%;
height: 100%;
......
......@@ -68,6 +68,7 @@
<script>
import { saveTemplete } from "@/services/market";
import { changeCodeNumber } from "@/utils/validate";
const fieldTypeItem = [
{
value: "input",
......@@ -111,7 +112,7 @@ export default {
},
rules: {
fieldCode: [
{ required: true, message: "请输入字段编码", trigger: "blur" },
{ required: true, validator: changeCodeNumber, trigger: "blur" },
],
fieldName: [
{ required: true, message: "请输入字段名称", trigger: "blur" },
......
......@@ -99,3 +99,15 @@ export const changeWindowNumber = (rule, value, callback) => {
callback();
}
};
// 校验编码
export const changeCodeNumber = (rule, value, callback) => {
let reg = /^[a-zA-Z\d]{2,30}$/;
if (!value) {
callback(new Error("请输入编码"));
} else if (!reg.test(value)) {
callback(new Error("格式:数字,字母2至30位"));
} else {
callback();
}
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment