增加UD管理

20240109-yw
yuanwei 11 months ago
parent 1bd0caf0f7
commit 92e8b6512e

@ -0,0 +1,33 @@
import axios from "@/utils/request";
export function listUd(query) {
return axios({
url: "/ud/info/list",
method: "get",
params: query
});
}
// 保存
export function saveUd(data, formName, method = "post") {
let url =
formName !== "edit"
? "/ud/info/save"
: "/ud/info/edit";
return axios({
url: url,
method: method,
data: data
});
}
// 删除
export function deleteUd(data) {
return axios({
url: "/ud/info/delete",
method: "post",
data: data
});
}

@ -0,0 +1,41 @@
import axios from "@/utils/request";
export function listPlan(query) {
return axios({
url: "/ud/plan/list",
method: "get",
params: query
});
}
// 保存
export function savePlan(data, formName, method = "post") {
let url =
formName !== "edit"
? "/ud/plan/save"
: "/ud/plan/edit";
return axios({
url: url,
method: method,
data: data
});
}
// 删除
export function deletePlan(data) {
return axios({
url: "/ud/plan/delete",
method: "post",
data: data
});
}
export function updateStatusPlan(data) {
return axios({
url: "/ud/plan/updateStatus",
method: "post",
data: data
});
}

@ -0,0 +1,331 @@
// JScript source code
export default class SoftKey
{
constructor() {
}
StrEnc = function(InString, Key)
{
var n;var m;
var nlen;
var b=Buffer.from(InString);
var zero_buf = Buffer.from([0]);
b = Buffer.concat([b,zero_buf]);
nlen=b.length;
if( b.length < 8)
{
nlen= 8;
}
var outb=Buffer.alloc(nlen);
var inb=Buffer.alloc(nlen);
b.copy(inb);//如果少于8则会补0这里主要是用于补0
b.copy(outb);
for(n=0;n<=(nlen-8);n=n+8)
{
var tmpoutb = this.sub_EnCode(inb,n,Key);
for(m=0;m<8;m++)
{
outb[m+n]=tmpoutb[m];
}
}
return outb.toString('hex');
}
StrDec = function( InString, Key)//
{
var n,m;
var inb=new Buffer(InString, 'hex');
var outb=Buffer.alloc(inb.length );
inb.copy(outb);
for( n = 0; n<=inb.length - 8 ;n=n+ 8)
{
var tmpoutb =this.sub_DeCode(inb,n,Key);
for(m=0;m<8;m++)
{
outb[m+n]=tmpoutb[m];
}
}
return outb.toString();
}
EnCode = function(inb,Key)
{
this.sub_EnCode(inb,0,Key);
}
sub_EnCode = function(inb,pos,Key )
{
var cnDelta, y, z, a, b, c, d;
var outb=new Uint8Array(8);
var n, i, nlen;
var sum;
var temp, temp_1;
var buf = new Array(16);
var temp_string;
cnDelta = 2654435769;
sum = 0;
nlen = Key.length ;
i = 0;
for (n = 1; n <= nlen; n = n + 2)
{
temp_string= Key.substring(n-1, n-1+2);
buf[i] = this.HexToInt(temp_string);
i = i + 1;
}
a = 0; b = 0; c = 0; d = 0;
for (n = 0; n <= 3; n++)
{
a = (buf[n] << (n * 8)) | a;
b = (buf[n + 4] << (n * 8)) | b;
c = (buf[n + 4 + 4] << (n * 8)) | c;
d = (buf[n + 4 + 4 + 4] << (n * 8)) | d;
}
y = 0;
z = 0;
for (n = 0; n <= 3; n++)
{
y = (inb[n + pos] << (n * 8)) | y;
z = (inb[n + 4 + pos]<< (n * 8)) | z;
}
n = 32;
while (n > 0)
{
sum = cnDelta + sum;
temp = (z << 4) & 0xFFFFFFFF;
temp = (temp + a) & 0xFFFFFFFF;
temp_1 = (z + sum) & 0xFFFFFFFF;
temp = (temp ^ temp_1) & 0xFFFFFFFF;
temp_1 = (z >>>5) & 0xFFFFFFFF;
temp_1 = (temp_1 + b) & 0xFFFFFFFF;
temp = (temp ^ temp_1) & 0xFFFFFFFF;
temp = (temp + y) & 0xFFFFFFFF;
y = temp & 0xFFFFFFFF;
// y += ((z << 4) + a) ^ (z + sum) ^ ((z >> 5) + b);
temp = (y << 4) & 0xFFFFFFFF;
temp = (temp + c) & 0xFFFFFFFF;
temp_1 = (y + sum) & 0xFFFFFFFF;
temp = (temp ^ temp_1) & 0xFFFFFFFF;
temp_1 = (y >>> 5) & 0xFFFFFFFF;
temp_1 = (temp_1 + d) & 0xFFFFFFFF;
temp = (temp ^ temp_1) & 0xFFFFFFFF;
temp = (z + temp) & 0xFFFFFFFF;
z = temp & 0xFFFFFFFF;
// z += ((y << 4) + c) ^ (y + sum) ^ ((y >> 5) + d);
n = n - 1;
}
for (n = 0; n <= 3; n++)
{
outb[n] = ((y >>> (n * 8)) & 255);
outb[n + 4] = ((z >>> (n * 8)) & 255);
}
return outb;
}
DeCode = function()
{
sub_DeCode(inb,0,Key );
}
sub_DeCode = function(inb,pos,Key )
{
var cnDelta, y, z, a, b, c, d;
var outb=new Uint8Array(8);
var n, i, nlen;
var sum;
var temp, temp_1;
var buf = new Array(16);
var temp_string;
cnDelta = 2654435769;
sum = 3337565984;
nlen = Key.length ;
i = 0;
for (n = 1; n <= nlen; n = n + 2)
{
temp_string= Key.substring(n-1, n-1+2);
buf[i] = this.HexToInt(temp_string);
i = i + 1;
}
a = 0; b = 0; c = 0; d = 0;
for (n = 0; n <= 3; n++)
{
a = (buf[n] << (n * 8)) | a;
b = (buf[n + 4] << (n * 8)) | b;
c = (buf[n + 4 + 4] << (n * 8)) | c;
d = (buf[n + 4 + 4 + 4] << (n * 8)) | d;
}
y = 0;
z = 0;
for (n = 0; n <= 3; n++)
{
y = (inb[n + pos] << (n * 8)) | y;
z = (inb[n + 4 + pos]<< (n * 8)) | z;
}
n = 32;
while (n > 0)
{
temp = (y << 4) & 0xFFFFFFFF;
temp = (temp + c) & 0xFFFFFFFF;
temp_1 = (y + sum) & 0xFFFFFFFF;
temp = (temp ^ temp_1) & 0xFFFFFFFF;
temp_1 = (y >>> 5) & 0xFFFFFFFF;
temp_1 = (temp_1 + d) & 0xFFFFFFFF;
temp = (temp ^ temp_1) & 0xFFFFFFFF;
temp = (z - temp) & 0xFFFFFFFF;
z = temp & 0xFFFFFFFF;
// z += ((y << 4) + c) ^ (y + sum) ^ ((y >> 5) + d);
temp = (z << 4) & 0xFFFFFFFF;
temp = (temp + a) & 0xFFFFFFFF;
temp_1 = (z + sum) & 0xFFFFFFFF;
temp = (temp ^ temp_1) & 0xFFFFFFFF;
temp_1 = (z >>>5) & 0xFFFFFFFF;
temp_1 = (temp_1 + b) & 0xFFFFFFFF;
temp = (temp ^ temp_1) & 0xFFFFFFFF;
temp = ( y -temp) & 0xFFFFFFFF;
y = temp & 0xFFFFFFFF;
// y += ((z << 4) + a) ^ (z + sum) ^ ((z >> 5) + b);
sum = sum-cnDelta;
n = n - 1;
}
for (n = 0; n <= 3; n++)
{
outb[n] = ((y >>> (n * 8)) & 255);
outb[n + 4] = ((z >>> (n * 8)) & 255);
}
return outb;
}
/////////////////////
AddZero = function( InKey)
{
var nlen;
var n;
nlen =InKey.length;
for(n=nlen;n<=7;n++)
{
InKey = "0" + InKey;
}
return InKey;
}
myconvert = function( HKey, LKey)
{
HKey = this.AddZero(HKey);
LKey = this.AddZero(LKey);
var out_data=new Uint8Array(8)
var n;
for(n=0;n<=3;n++)
{
out_data[n] = this.HexToInt(HKey.substring( n * 2, n * 2+2));
}
for(n=0;n<=3;n++)
{
out_data[n + 4] = this.HexToInt(LKey.substring( n * 2, n * 2+2));
}
return out_data;
}
////bin2hex & hex2bin
ByteArrayToHexString = function(Inb,len)
{
var outstring= "";
for (var n = 0 ;n<= len - 1;n++)
{
outstring= outstring+this.myhex(Inb[n]) ;
}
return outstring;
}
HexStringToByteArray = function(InString)
{
var nlen;
var retutn_len;
var n,i;
var b;
var temp;
nlen = InString.length;
if (nlen < 16) retutn_len = 16;
retutn_len = nlen / 2;
b = new Uint8Array(retutn_len);
i = 0;
for(n=0;n<nlen;n=n+2)
{
temp = InString.substring( n, n+2);
b[i] = this.HexToInt(temp);
i = i + 1;
}
return b;
}
////////
//decimal to hex && hex2dec
myhex = function(value) {
if (value < 16)
return '0' + value.toString(16);
return value.toString(16);
};
HexToInt = function( s)
{
var hexch ="0123456789ABCDEF";
var i, j;
var r, n, k;
var ch;
s=s.toUpperCase();
k = 1; r = 0;
for (i = s.length; i > 0; i--)
{
ch = s.substring(i - 1, i-1+1);
n = 0;
for (j = 0; j < 16; j++)
{
if (ch == hexch.substring(j, j+1) )
{
n = j;
}
}
r += (n * k);
k *= 16;
}
return r;
};
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,244 @@
<template>
<div align="center">
<br />
<br />
要测试的话无需输入任何数据直接点提交就可以自动获到锁的信息<br />
<br />
<input name="KeyID" type="text" id="KeyID" size="20" />
<input name="UserName" type="text" id="UserName" size="20" />
<input name="Password" type="text" id="Password" size="20" />
<input name="rnd" type="text" id="rnd" v-model="myrnd" />
<input name="return_EncData" type="text" id="return_EncData" value="" />
<button v-on:click="login_onclick">提交</button>
<br /> <br />
<input name="IDInfo" type="text" id="IDInfo" v-model="IDInfo" />
<br /> <br />
<input name="UserNameInfo" type="text" id="UserNameInfo" v-model="UserNameInfo" />
<br /> <br />
<input name="PasswordInfo" type="text" id="PasswordInfo" v-model="PasswordInfo" />
<br /> <br />
<input name="strDataInfo" type="text" id="strDataInfo" v-model="strDataInfo" />
<br /> <br />
<input name="EncResultInfo" type="text" id="EncResultInfo" v-model="EncResultInfo" />
<br /> <br />
<input name="Msg" type="text" id="Msg" v-model="Msg" />
<br /> <br />
</div>
</template>
<script>
import SoftKey3W from '@/utils//Syunew3W.js'
import SoftKey from '@/utils//SoftKey.js'
function GetRandomNum(Min,Max)
{
var Range = Max - Min;
var Rand = Math.random();
return(Min + Math.round(Rand * Range)).toString();
}
function myonLoad()
{
try
{
var s_pnp=new SoftKey3W();
s_pnp.Socket_UK.onopen = function()
{
}
//使Sockey
s_pnp.Socket_UK.onmessage =function got_packet(Msg)
{
var PnpData = JSON.parse(Msg.data);
if(PnpData.type=="PnpEvent")//
{
if(PnpData.IsIn)
{
alert("UKEY已被插入被插入的锁的路径是"+PnpData.DevicePath);
}
else
{
alert("UKEY已被拨出被拨出的锁的路径是"+PnpData.DevicePath);
}
}
}
s_pnp.Socket_UK.onclose = function()
{
}
}
catch(e)
{
alert(e.name + ": " + e.message);
return false;
}
}
var digitArray = new Array('0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f');
function toHex( n ) {
var result = ''
var start = true;
for ( var i=32; i>0; ) {
i -= 4;
var digit = ( n >> i ) & 0xf;
if (!start || digit != 0) {
start = false;
result += digitArray[digit];
}
}
return ( result == '' ? '0' : result );
}
export default {
UserName:"",
Password:"",
return_EncData:"",
KeyID:"",
myrnd:"",
IDInfo:"",
UserNameInfo:"",
PasswordInfo:"",
strDataInfo:"",
Msg:"",
EncResultInfo:"",
strData:"",
data () {
return {
myrnd: '',
Msg:"",
}
},
mounted()
{
this.myrnd= GetRandomNum(1,65535)+GetRandomNum(1,65535);//
this.strData=this.myrnd
myonLoad();
},
methods:{
login_onclick:async function(){//使WEBSOCKET
await this.mylogin_onclick(this)//使awaitWEBSOCKET
//
this.IDInfo="UKEY的ID是"+this.KeyID;
this.UserNameInfo="从UKEY中获取到的用户名是"+this.UserName;
this.PasswordInfo="从UKEY中获取到的用户密码是"+this.Password;
//TEA
var Key;
//Key
//使
Key="1234567890ABCDEF1234567890ABCDEF1111";
var mSoftKey=new SoftKey(); //
//strData,
this.strDataInfo= "服务器运算的随机数是:"+this.strData;
//
var m_StrEnc = mSoftKey.StrEnc(this.strData,Key);// this.myrnd
console.log(m_StrEnc);
this.EncResultInfo="服务器运算的结果是:"+m_StrEnc;
//使
if (m_StrEnc.trim().toLocaleUpperCase==this.return_EncData.trim().toLocaleUpperCase)
{
this.Msg= "该用户是合法用户";
}
else
{
this.Msg= "该用户不是合法用户";
}
},
mylogin_onclick:async function(InThis)
{
var DevicePath
var that=InThis;
var ret, version, versionex
var mSoftKey3A = new SoftKey3W();//USBawait !!!!!!!!!
DevicePath = await mSoftKey3A.FindPort(1);//'
if (mSoftKey3A.GetLastError() == 0) {
window.alert("系统上发现有2把及以上的加密锁请只插入要进行的加密锁。"); return false;
}
DevicePath = await mSoftKey3A.FindPort(0);//'
if (mSoftKey3A.GetLastError() != 0) {
window.alert("未发现加密锁,请插入加密锁"); return false;
}
//IDIDID
{
that.KeyID = await mSoftKey3A.GetChipID(DevicePath);
if (mSoftKey3A.GetLastError() != 0) {
//IDID
that.KeyID = toHex(await mSoftKey3A.GetID_1(DevicePath)) + toHex(await mSoftKey3A.GetID_2(DevicePath));
if (mSoftKey3A.GetLastError() != 0) {
window.alert("获取ID错误,错误码是" + mSoftKey3A.GetLastError().toString());
return false;
}
}
}
var addr
//
{
addr = 0//0
//0,使"FFFFFFFF","FFFFFFFF"
var OutLenBuf = await mSoftKey3A.YReadEx(addr, 1, "test", "123456", DevicePath);
var nlen = OutLenBuf[0];
if (mSoftKey3A.GetLastError() != 0) {
window.alert("读取用户名长度时错误。错误码:" + mSoftKey3A.GetLastError().toString()); return false;
}
//1,使"FFFFFFFF","FFFFFFFF"
that.UserName = await mSoftKey3A.YReadString(addr + 1, nlen, "test", "123456", DevicePath);
if (mSoftKey3A.GetLastError() != 0) {
window.alert("读取用户名时错误。错误码:" + mSoftKey3A.GetLastError().toString()); return false;
}
}
//
{
addr = 20//0
//0,使"FFFFFFFF","FFFFFFFF"
var OutLenBuf = await mSoftKey3A.YReadEx(addr, 1, "test", "123456", DevicePath);
var nlen = OutLenBuf[0];
if (mSoftKey3A.GetLastError() != 0) {
window.alert("读取用户密码长度时错误。错误码:" + mSoftKey3A.GetLastError().toString()); return false;
}
//1,使"FFFFFFFF","FFFFFFFF"
that.Password = await mSoftKey3A.YReadString(addr + 1, nlen, "test", "123456", DevicePath);
if (mSoftKey3A.GetLastError() != 0) {
window.alert("读取用户密码时错误。错误码:" + mSoftKey3A.GetLastError().toString()); return false;
}
}
//HASH
that.return_EncData = await mSoftKey3A.EncString(that.myrnd, DevicePath);
console.log(that.return_EncData);
if (mSoftKey3A.GetLastError() != 0) {
window.alert("进行加密运行算时错误,错误码为:" + mSoftKey3A.GetLastError().toString());
return false;
}
}
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1, h2 {
font-weight: normal;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>

@ -0,0 +1,725 @@
<template>
<div>
<el-card>
<el-form v-if="queryList && queryList.length > 0" :model="filterQuery" class="query-form" size="mini" label-width="120px" v-show="showSearch" :inline="true">
<el-row style=" display:flex; flex-wrap: wrap; ">
<template v-for="(item, index) in queryList" >
<el-form-item v-if="item.columnType == 'input' && executeEval(row,item.expression,true)" :label="item.columnDesc+`:`" :key="item.id">
<el-input
v-model="filterQuery[item.columnName]"
:placeholder="item.columnDesc"
:disabled="executeEval(null,item.disabledFuc,false)"
@keyup.enter.native="executeFuc($event,'5',item.clickFuc)"
clearable
:autosize="{ minRows: 4, maxRows: 9}"
></el-input>
</el-form-item>
<el-form-item v-if="item.columnType == 'select' && executeEval(row,item.expression,true)" :label="item.columnDesc+`:`">
<el-select v-model="filterQuery[item.columnName]"
:placeholder="item.columnDesc"
:disabled="executeEval(null,item.disabledFuc,false)"
clearable>
<el-option
v-for="dict in item.lableRuleObj"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item v-if="item.columnType == 'selectServer' && executeEval(row,item.expression,true)" :label="item.columnDesc+`:`">
<el-select
v-model="filterQuery[item.columnName]"
:placeholder="item.columnDesc"
@change="executeFuc($event,'5',item.checkRules)"
:disabled="executeEval(null,item.disabledFuc,false)"
filterable
remote
:remote-method="(query) => executeFuc(query,'5',item.clickFuc)"
clearable>
<el-option
v-for="item in options[item.clickFuc]"
:key="item.code"
:label="item.label"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item v-if="item.columnType == 'datePicker' && item.columnName == 'actDateRange' && executeEval(row,item.expression,true)" :label="item.columnDesc+`:`">
<el-date-picker
:picker-options="pickerOptions"
v-model="actDateRange"
type="daterange"
format="yyyy 年 MM 月 dd 日"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item v-if="item.columnType == 'datePicker' && item.columnName == 'auditDateRange' && executeEval(row,item.expression,true)" :label="item.columnDesc+`:`">
<el-date-picker
:picker-options="pickerOptions"
v-model="auditDateRange"
type="daterange"
format="yyyy 年 MM 月 dd 日"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item v-if="item.columnType == 'date' && executeEval(row,item.expression,true)" :label="item.columnDesc+`:`">
<el-date-picker
v-model="filterQuery[item.columnName]"
:style="`width:${item.width+'px'}`"
value-format="yyyy-MM-dd"
:disabled="executeEval(null,item.disabledFuc,false)"
type="date"
:placeholder="item.columnDesc"
></el-date-picker>
</el-form-item>
</template>
</el-row>
</el-form>
<div class="top-right-btn">
<el-button-group>
<el-button icon="el-icon-view" type="primary" @click="hideSearch">/</el-button>
<el-button
type="primary"
icon="el-icon-refresh"
@click="onReset"
>重置
</el-button>
<el-button type="primary" icon="el-icon-search" @click="onSubmit"
>查询
</el-button
>
<el-button type="primary" icon="el-icon-plus" @click="(event) => addOrderMuti()">新增订单</el-button>
</el-button-group>
</div>
<el-table v-loading="loading" :data="list" style="width: 100%" border highlight-current-row
@row-click="(row) => executeFuc(row,'0',tableObj.handleChangeFuc)">
>
<template v-for="(item, index) in tableHeader">
<el-table-column
v-if="item.columnType == 'id' && executeEval(row,item.expression,true)"
type="index" :label="item.columnDesc"></el-table-column>
<el-table-column
v-if="item.columnType == 'selection'"
type="selection"
:width="item.width"
:selectable="(row,number) => executeFuc(row,'3',item.clickFuc)"
></el-table-column>
<el-table-column
v-if="item.columnType == 'radio' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<el-radio :label="scope.row.id" v-model="radioCheck"><span></span></el-radio>
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'laber' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<span :style="{color: executeFuc(scope.row,'4',item.lableRuleObj[scope.row[item.columnName]])}">{{ item.lableRuleObj[scope.row[item.columnName]] }}</span>
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'eltag' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<el-tag :type="executeFuc(scope.row,'4',item,item.lableRuleObj?item.lableRuleObj[scope.row[item.columnName]]:scope.row[item.columnName])">
<span>{{ item.lableRuleObj?item.lableRuleObj[scope.row[item.columnName]]:scope.row[item.columnName] }}</span>
</el-tag>
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'button' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:width="item.width"
:key="item.columnName"
fixed="right"
>
<template slot-scope="scope">
<el-button v-for="(buttonItem, buttonIndex) in item.buttonRulObj"
:type="buttonItem.type"
:size="buttonItem.size"
:style="buttonItem.style"
:key="buttonItem"
v-if="executeEval(scope.row,buttonItem.hasPermi,true)"
:disabled="executeEval(scope.row,buttonItem.disabledFuc,false)"
@click.native.stop="executeFuc(scope.row,'1',buttonItem.clickFuc)"
>{{ buttonItem.name }}
</el-button>
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'text' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<span :style="{color: executeFuc(scope.row,'4',item,scope.row[item.columnName])}">{{ scope.row[item.columnName] }}</span>
</template>
</el-table-column>
</template>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="filterQuery.page"
:limit.sync="filterQuery.limit"
@pagination="handleCurrentChange"
></pagination>
</el-card>
<el-card class="el-card">
<el-form v-if="queryList2 && queryList2.length > 0" :model="filterQuery" class="query-form" size="mini" label-width="120px" v-show="showSearch" :inline="true">
<el-row style=" display:flex; flex-wrap: wrap; ">
<template v-for="(item, index) in queryList2" >
<el-form-item v-if="item.columnType == 'input' && executeEval(row,item.expression,true)" :label="item.columnDesc+`:`" :key="item.id">
<el-input
v-model="filterInfoQuery[item.columnName]"
:placeholder="item.columnDesc"
:disabled="executeEval(null,item.disabledFuc,false)"
@keyup.enter.native="executeFuc($event,'5',item.clickFuc)"
clearable
:autosize="{ minRows: 4, maxRows: 9}"
></el-input>
</el-form-item>
<el-form-item v-if="item.columnType == 'select' && executeEval(row,item.expression,true)" :label="item.columnDesc+`:`">
<el-select v-model="filterInfoQuery[item.columnName]"
:placeholder="item.columnDesc"
:disabled="executeEval(null,item.disabledFuc,false)"
clearable>
<el-option
v-for="dict in item.lableRuleObj"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item v-if="item.columnType == 'selectServer' && executeEval(row,item.expression,true)" :label="item.columnDesc+`:`">
<el-select
v-model="filterInfoQuery[item.columnName]"
:placeholder="item.columnDesc"
@change="executeFuc($event,'5',item.checkRules)"
:disabled="executeEval(null,item.disabledFuc,false)"
filterable
remote
:remote-method="(query) => executeFuc(query,'5',item.clickFuc)"
clearable>
<el-option
v-for="item in options[item.clickFuc]"
:key="item.code"
:label="item.label"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item v-if="item.columnType == 'date' && executeEval(row,item.expression,true)" :label="item.columnDesc+`:`">
<el-date-picker
v-model="filterInfoQuery[item.columnName]"
:style="`width:${item.width+'px'}`"
value-format="yyyy-MM-dd"
:disabled="executeEval(null,item.disabledFuc,false)"
type="date"
:placeholder="item.columnDesc"
></el-date-picker>
</el-form-item>
</template>
</el-row>
</el-form>
<div class="top-right-btn">
<el-button-group>
<el-button
type="primary"
icon="el-icon-refresh"
@click="onInfoReset"
>重置
</el-button>
<el-button type="primary" icon="el-icon-search" @click="onInfoSubmit"
>查询
</el-button
>
<el-button type="primary" icon="el-icon-plus" @click="(event) => addInfoMuti()">新增U盾</el-button>
</el-button-group>
</div>
<el-divider style="margin: 15px"></el-divider>
<el-table v-loading="loadInfoLoading" :data="manuInfoList" style="width: 100%" ref="table"
highlight-current-row border >
<template v-for="(item, index) in tableHeader2">
<el-table-column
v-if="item.columnType == 'id' && executeEval(row,item.expression,true)"
type="index" :label="item.columnDesc"></el-table-column>
<el-table-column
v-if="item.columnType == 'selection'"
type="selection"
:width="item.width"
:selectable="(row,number) => executeFuc(row,'3',item.clickFuc)"
></el-table-column>
<el-table-column
v-if="item.columnType == 'radio' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<el-radio :label="scope.row.id" v-model="radioCheck"><span></span></el-radio>
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'laber' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<span :style="{color: executeFuc(scope.row,'4',item.lableRuleObj[scope.row[item.columnName]])}">{{ item.lableRuleObj[scope.row[item.columnName]] }}</span>
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'eltag' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<el-tag :type="executeFuc(scope.row,'4',item,item.lableRuleObj?item.lableRuleObj[scope.row[item.columnName]]:scope.row[item.columnName])">
<span>{{ item.lableRuleObj?item.lableRuleObj[scope.row[item.columnName]]:scope.row[item.columnName] }}</span>
</el-tag>
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'button' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:width="item.width"
:key="item.columnName"
fixed="right"
>
<template slot-scope="scope">
<el-button v-for="(buttonItem, buttonIndex) in item.buttonRulObj"
:type="buttonItem.type"
:size="buttonItem.size"
:style="buttonItem.style"
:key="buttonItem"
v-if="executeEval(scope.row,buttonItem.hasPermi,true)"
:disabled="executeEval(scope.row,buttonItem.disabledFuc,false)"
@click.native.stop="executeFuc(scope.row,'1',buttonItem.clickFuc)"
>{{ buttonItem.name }}
</el-button>
</template>
</el-table-column>
<el-table-column
v-if="item.columnType == 'text' && executeEval(row,item.expression,true)"
:prop="item.columnName"
:label="item.columnDesc"
:sortable="item.sort"
:width="item.width"
:show-overflow-tooltip="item.tooltip"
:key="item.columnName"
>
<template slot-scope="scope">
<span :style="{color: executeFuc(scope.row,'4',item,scope.row[item.columnName])}">{{ scope.row[item.columnName] }}</span>
</template>
</el-table-column>
</template>
</el-table>
<pagination
v-show="manuInfoTotal>0"
:total="manuInfoTotal"
:page.sync="filterInfoQuery.page"
:limit.sync="filterInfoQuery.limit"
@pagination="handleInfoChange"
></pagination>
</el-card>
<el-dialog
:title="formMap[formName]"
:visible.sync="orderMutiSetVisible"
:before-close="close"
width="60%"
v-if="orderMutiSetVisible"
@close='closeDialog'
:close-on-click-modal="false"
:close-on-press-escape="false"
>
<udPlanDialog
:closeDialog="closeDialog"
:inputQuery="inputQuery"
:formName="formName"
></udPlanDialog>
</el-dialog>
<el-dialog
:title="formInfoMap[formInfoName]"
:visible.sync="manuInfoDialogVisible"
:before-close="close"
width="60%"
v-if="manuInfoDialogVisible"
@close='closeInfoDialog'
:close-on-click-modal="false"
:close-on-press-escape="false"
>
<udInfoDialog
:closeDialog="closeInfoDialog"
:inputQuery="inputInfoQuery"
:formName="formInfoName"
></udInfoDialog>
</el-dialog>
</div>
</template>
<script>
import udInfoDialog from "@/views/ud/udInfoDialog";
import udPlanDialog from "@/views/ud/udPlanDialog";
import {deleteUd, listUd} from "@/api/ud/ud";
import {deletePlan,updateStatusPlan, listPlan} from "@/api/ud/udPlan";
import {executeFuc, getHead} from "@/utils/customConfig";
export default {
name: "ud",
data() {
return {
showSearch: true,
filterQuery: {
page: 1,
limit: 10,
},
total: 0,
loading: false,
list: [],
formName: 1,
formMap: {
1: "新增U盾订单",
2: "编辑U盾订单",
},
inputQuery:{},
orderMutiSetVisible: false,
formInfoName: 1,
formInfoMap: {
1: "新增U盾",
2: "编辑U盾",
},
inputInfoQuery:{},
manuInfoDialogVisible: false,
manuInfoList: [],
loadInfoLoading: false,
manuInfoTotal: 0,
filterInfoQuery: {
page: 1,
limit: 10,
},
changeCode:"",
actDateRange: [],
auditDateRange: [],
pickerOptions: {
shortcuts: [
{
text: "最近一周",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit("pick", [start, end]);
},
},
{
text: "最近一个月",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit("pick", [start, end]);
},
},
{
text: "最近三个月",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit("pick", [start, end]);
},
},
],
},
};
},
methods: {
onSubmit() {
if (this.actDateRange !== null) {
this.filterQuery.startTime = this.actDateRange[0];
this.filterQuery.endTime = this.actDateRange[1];
} else {
this.filterQuery.startTime = null;
this.filterQuery.endTime = null;
}
if (this.auditDateRange !== null) {
this.filterQuery.startAduditTime = this.auditDateRange[0];
this.filterQuery.endAduditTime = this.auditDateRange[1];
} else {
this.filterQuery.startAduditTime = null;
this.filterQuery.endAduditTime = null;
}
this.filterQuery.page = 1;
this.getList();
this.changeCode = "";
this.manuInfoList = [],
this.manuInfoTotal = 0
},
onInfoSubmit() {
this.filterInfoQuery.page = 1;
this.getInfoList();
},
onReset() {
this.$router.push({
path: "",
});
this.filterQuery = {
page: 1,
limit: 10,
};
this.getList();
this.changeCode = "";
this.actDateRange = [];
this.auditDateRange = [];
this.manuInfoList = [],
this.manuInfoTotal = 0
},
onInfoReset() {
this.$router.push({
path: "",
});
this.filterInfoQuery = {
producePlanId:this.changeCode,
page: 1,
limit: 10,
};
this.getInfoList();
},
hideSearch() {
this.showSearch = !this.showSearch;
},
handleCurrentChange(val) {
this.filterQuery.page = val.page;
this.getList();
},
handleInfoChange(val) {
this.filterInfoQuery.page = val.page;
},
closeDialog(){
this.orderMutiSetVisible = false;
this.getList();
},
addOrderMuti(){
this.inputQuery={
}
this.formName=1;
this.orderMutiSetVisible = true;
},
editDialog(_this,row){
_this.formName=2;
_this.inputQuery=row;
_this.orderMutiSetVisible = true;
},
closeInfoDialog(){
this.manuInfoDialogVisible = false;
this.getInfoList();
},
addInfoMuti(){
var changeCode = this.changeCode;
if(!changeCode){
this.$message.error("请先选择订单");
return;
}
this.inputInfoQuery={
producePlanId:changeCode,
uniqueId:'',
}
this.formInfoName=1;
this.manuInfoDialogVisible = true;
},
editInfoDialog(_this,row){
_this.formInfoName=2;
_this.inputInfoQuery=row;
_this.manuInfoDialogVisible = true;
},
supPlanClick(_this,row) {
_this.changeCode= row.id
_this.onInfoReset();
},
getList() {
this.loading = true;
listPlan(this.filterQuery)
.then((response) => {
this.loading = false;
this.list = response.data.list || [];
this.total = response.data.total || 0;
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
},
deleteDialog(_this,row) {
_this.$confirm("确认删除吗?", "提示", {
type: "warning",
})
.then(() => {
deletePlan(row)
.then((response) => {
if(response.code == 20000){
_this.getList()
}else{
_this.$message.error(response.message);
}
})
.catch(() => {
_this.$message.error(response.message);
});
});
},
updateStatus(_this,row) {
_this.$confirm("请确认订单是否已完成制作!", "提示", {
type: "warning",
})
.then(() => {
updateStatusPlan(row)
.then((response) => {
if(response.code == 20000){
_this.getList()
}else{
_this.$message.error(response.message);
}
})
.catch(() => {
_this.$message.error(response.message);
});
});
},
getInfoList() {
this.loadInfoLoading = true;
listUd(this.filterInfoQuery)
.then((response) => {
this.loadInfoLoading = false;
this.manuInfoList = response.data.list || [];
this.manuInfoTotal = response.data.total || 0;
})
.catch(() => {
this.filterInfoQuery = false;
this.manuInfoList = [];
this.manuInfoTotal = 0;
});
},
deleteInfoDialog(_this,row) {
_this.$confirm("确认删除吗?", "提示", {
type: "warning",
})
.then(() => {
deleteUd(row)
.then((response) => {
if(response.code == 20000){
_this.getInfoList()
}else{
_this.$message.error(response.message);
}
})
.catch(() => {
_this.$message.error(response.message);
});
});
},
executeFuc(row,type,clickFuc,value){
return executeFuc(this,row,type,clickFuc,value);
},
executeEval(row,expression,defaultRet){
if(expression){
return eval(expression);
}
return defaultRet;
}
},
components: {udInfoDialog,udPlanDialog},
created() {
getHead("ud-plan","1").then((re) => {
//
this.tableObj = re.data;
this.tableHeader = re.data.tableList;
this.queryList = re.data.queryList;
this.fromList = re.data.fromList;
this.getList()
});
getHead("ud-info","1").then((re) => {
//
this.tableObj2 = re.data;
this.tableHeader2 = re.data.tableList;
this.queryList2 = re.data.queryList;
this.fromList2 = re.data.fromList;
});
},
}
</script>
<style scoped>
</style>

@ -0,0 +1,338 @@
<template>
<div>
<el-card>
<el-row>
<div style="margin: 0px 60px 10px auto; height: 35px; float: right;">
<el-button-group>
<el-button
type="primary"
@click.native.stop="readUdInfo"
:loading="loading"
>开始/重新读取
</el-button
>
</el-button-group>
</div>
</el-row>
<el-form :model="inputQuery" label-width="120px" >
<template v-for="(itemRow, indexRow) in fromList">
<el-row :gutter="20" class="el-row" type="flex">
<template v-for="(item, index) in itemRow.list">
<el-col :span="item.width" class="el-col" type="flex">
<div class="text item">
<el-form-item v-if="item.columnType =='input'" :rules="item.checkRulesObj" :prop="item.columnName">
<span slot="label">
{{item.columnDesc}}
</span>
<el-input
v-model="inputQuery[item.columnName]"
:style="item.style"
:size="item.size"
:type="item.inputType"
:placeholder="item.columnDesc"
:disabled="item.disabled"
@input="executeFuc($event,'5',item.clickFuc)"
:autosize="{ minRows: 4, maxRows: 9}"
></el-input>
</el-form-item>
<el-form-item v-if="item.columnType =='radio'" :prop="item.columnName">
<span slot="label">
{{item.columnDesc}}
</span>
<el-radio-group :style="item.style" v-model="inputQuery[item.columnName]">
<el-radio
v-for="dict in item.lableRuleObj"
:key="parseInt(dict.value)"
:label="parseInt(dict.value)"
:disabled="item.disabled"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-if="item.columnType =='select'" :prop="item.columnName">
<span slot="label">
{{item.columnDesc}}
</span>
<el-select v-model="inputQuery[item.columnName]" :style="item.style">
<el-option
v-for="dict in item.lableRuleObj"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item v-if="item.columnType =='selectServer'" :prop="item.columnName">
<span slot="label">
{{item.columnDesc}}
</span>
<el-select
v-model="inputQuery[item.columnName]"
:placeholder="item.columnDesc"
:style="item.style"
@change="executeFuc($event,'5',item.clickFuc)"
:disabled="executeEval(null,item.disabledFuc,false)"
filterable
remote
:remote-method="(query) => executeFuc(query,'5',item.dataFuc)"
clearable>
<el-option
v-for="item in options[item.dataFuc]"
:key="item.code"
:label="item.code"
:value="item.code"
>
<span style="float: left">{{ item.code }}</span>
<span style="float: right; color: #8492a6; font-size: 13px;width:200px">{{
item.productName
}}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item v-if="item.columnType =='date'" :rules="item.checkRulesObj" :prop="item.columnName">
<span slot="label">
{{item.columnDesc}}
</span>
<el-date-picker
v-model="inputQuery[item.columnName]"
:style="item.style"
value-format="yyyy-MM-dd"
type="date"
:placeholder="item.columnDesc"
></el-date-picker>
</el-form-item>
<el-form-item v-if="item.columnType =='datetime'" :rules="item.checkRulesObj" :prop="item.columnName">
<span slot="label">
{{item.columnDesc}}
</span>
<el-date-picker
v-model="inputQuery[item.columnName]"
:style="item.style"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetime"
:placeholder="item.columnDesc"
></el-date-picker>
</el-form-item>
<el-form-item v-if="item.columnType =='treeCustom'" :prop="item.columnName">
<span slot="label">
{{item.columnDesc}}
</span>
<treeselect
v-model="inputQuery[item.columnName]"
:options="menuOptions"
:normalizer="normalizer"
:show-count="true"
:placeholder="item.columnName"
/>
</el-form-item>
</div>
</el-col>
</template>
</el-row>
</template>
<div style='text-align: center; margin-bottom: 10px;margin-top: 18px ;'>
<el-button type="primary" @click="submitInv"></el-button>
<el-button @click="closeDialog"></el-button>
</div>
</el-form>
</el-card>
</div>
</template>
<script>
import {saveUd} from "@/api/ud/ud";
import {
getHead,executeFuc
} from "@/utils/customConfig";
import SoftKey3W from '@/utils//Syunew3W.js'
import SoftKey from '@/utils//SoftKey.js'
function myonLoad() {
try {
var s_pnp=new SoftKey3W();
s_pnp.Socket_UK.onopen = function() {
}
//使Sockey
s_pnp.Socket_UK.onmessage =function got_packet(Msg) {
var PnpData = JSON.parse(Msg.data);
if(PnpData.type=="PnpEvent"){
if(PnpData.IsIn) {
console.log("UKEY已被插入被插入的锁的路径是"+PnpData.DevicePath);
}
else {
console.log("UKEY已被拨出被拨出的锁的路径是"+PnpData.DevicePath);
}
}
}
s_pnp.Socket_UK.onclose = function() {
}
}
catch(e){
this.$message.error(e.name + ": " + e.message);
return false;
}
}
export default {
name: "udDialog",
KeyID:"",
props: {
closeDialog: {
type: Function,
required: true,
},
formName: {
type: Object,
required: true,
},
inputQuery: {
type: Object,
required: true,
},
},
data() {
return {
tableHeader:[],
queryList:[],
fromList:[],
tableObj:[],
invList:[],
options: {
}
}
},
mounted() {
myonLoad();
},
methods: {
submitInv(){
if(this.formName==1){
saveUd(this.inputQuery,"add").then((response) => {
if(response.code == 20000){
this.closeDialog();
}else{
this.$message.error(response.message);
}
})
.catch(() => {
this.$message.error("添加失败");
});
}else{
saveUd(this.inputQuery,"edit").then((response) => {
if(response.code == 20000){
this.closeDialog();
}else{
this.$message.error(response.message);
}
})
.catch(() => {
this.$message.error("添加失败");
});
}
},
executeFuc(row,type,clickFuc,value){
return executeFuc(this,row,type,clickFuc,value);
},
executeEval(row,expression,defaultRet){
if(expression){
return eval(expression);
}
return defaultRet;
},
readUd:async function(InThis){
var DevicePath
var that=InThis;
var mSoftKey3A = new SoftKey3W();//USBawait !!!!!!!!!
DevicePath = await mSoftKey3A.FindPort(1);//'
if (mSoftKey3A.GetLastError() == 0) {
this.$message.error("系统上发现有2把及以上的加密锁请只插入要进行的加密锁。"); return false;
}
DevicePath = await mSoftKey3A.FindPort(0);//'
if (mSoftKey3A.GetLastError() != 0) {
this.$message.error("未发现加密锁,请插入加密锁"); return false;
}
//IDIDID
{
that.KeyID = await mSoftKey3A.GetChipID(DevicePath);
if (mSoftKey3A.GetLastError() != 0) {
//IDID
that.KeyID = toHex(await mSoftKey3A.GetID_1(DevicePath)) + toHex(await mSoftKey3A.GetID_2(DevicePath));
if (mSoftKey3A.GetLastError() != 0) {
this.$message.error("获取ID错误,错误码是" + mSoftKey3A.GetLastError().toString());
return false;
}
}
}
console.log(that.KeyID);
// var addr
// //
// {
// addr = 0//0
// //0,使"FFFFFFFF","FFFFFFFF"
// var OutLenBuf = await mSoftKey3A.YReadEx(addr, 1, "0DAF0B2D", "DB5C61FB", DevicePath);
// var nlen = OutLenBuf[0];
// if (mSoftKey3A.GetLastError() != 0) {
// window.alert("" + mSoftKey3A.GetLastError().toString()); return false;
// }
// //1,使"FFFFFFFF","FFFFFFFF"
// that.UserName = await mSoftKey3A.YReadString(addr + 1, nlen, "0DAF0B2D", "DB5C61FB", DevicePath);
// if (mSoftKey3A.GetLastError() != 0) {
// window.alert("" + mSoftKey3A.GetLastError().toString()); return false;
// }
// }
// //
// {
// addr = 20//0
// //0,使"FFFFFFFF","FFFFFFFF"
// var OutLenBuf = await mSoftKey3A.YReadEx(addr, 1, "0DAF0B2D", "DB5C61FB", DevicePath);
// var nlen = OutLenBuf[0];
// if (mSoftKey3A.GetLastError() != 0) {
// window.alert("" + mSoftKey3A.GetLastError().toString()); return false;
// }
// //1,使"FFFFFFFF","FFFFFFFF"
// that.Password = await mSoftKey3A.YReadString(addr + 1, nlen, "0DAF0B2D", "DB5C61FB", DevicePath);
// if (mSoftKey3A.GetLastError() != 0) {
// window.alert("" + mSoftKey3A.GetLastError().toString()); return false;
// }
// }
// console.log(that.UserName);
// console.log(that.Password);
that.return_EncData = await mSoftKey3A.EncString("1122222222", DevicePath);
console.log(that.return_EncData);
if (mSoftKey3A.GetLastError() != 0) {
window.alert("进行加密运行算时错误,错误码为:" + mSoftKey3A.GetLastError().toString());
return false;
}
// const aaa = await mSoftKey3A.SetCal_2("5cb4b5fcfe474657b5621f34d0ea6df9", DevicePath);
// console.log(aaa);
},
readUdInfo:async function() {//使WEBSOCKET
await this.readUd(this)//使awaitWEBSOCKET
this.inputQuery.uniqueId = this.KeyID
}
},
components: {},
created() {
getHead("ud-info","1").then((re) => {
//
this.tableObj = re.data;
this.tableHeader = re.data.tableList;
this.queryList = re.data.queryList;
this.fromList = re.data.fromList;
});
},
}
</script>
<style scoped>
</style>

@ -0,0 +1,216 @@
<template>
<div>
<el-card>
<el-form :model="inputQuery" label-width="120px" >
<template v-for="(itemRow, indexRow) in fromList">
<el-row :gutter="20" class="el-row" type="flex">
<template v-for="(item, index) in itemRow.list">
<el-col :span="item.width" class="el-col" type="flex">
<div class="text item">
<el-form-item v-if="item.columnType =='input'" :rules="item.checkRulesObj" :prop="item.columnName">
<span slot="label">
{{item.columnDesc}}
</span>
<el-input
v-model="inputQuery[item.columnName]"
:style="item.style"
:size="item.size"
:type="item.inputType"
:placeholder="item.columnDesc"
:disabled="item.disabled"
@input="executeFuc($event,'5',item.clickFuc)"
:autosize="{ minRows: 4, maxRows: 9}"
></el-input>
</el-form-item>
<el-form-item v-if="item.columnType =='radio'" :prop="item.columnName">
<span slot="label">
{{item.columnDesc}}
</span>
<el-radio-group :style="item.style" v-model="inputQuery[item.columnName]">
<el-radio
v-for="dict in item.lableRuleObj"
:key="parseInt(dict.value)"
:label="parseInt(dict.value)"
:disabled="item.disabled"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-if="item.columnType =='select'" :prop="item.columnName">
<span slot="label">
{{item.columnDesc}}
</span>
<el-select v-model="inputQuery[item.columnName]" :style="item.style">
<el-option
v-for="dict in item.lableRuleObj"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item v-if="item.columnType =='selectServer'" :prop="item.columnName">
<span slot="label">
{{item.columnDesc}}
</span>
<el-select
v-model="inputQuery[item.columnName]"
:placeholder="item.columnDesc"
:style="item.style"
@change="executeFuc($event,'5',item.clickFuc)"
:disabled="executeEval(null,item.disabledFuc,false)"
filterable
remote
:remote-method="(query) => executeFuc(query,'5',item.dataFuc)"
clearable>
<el-option
v-for="item in options[item.dataFuc]"
:key="item.code"
:label="item.code"
:value="item.code"
>
<span style="float: left">{{ item.code }}</span>
<span style="float: right; color: #8492a6; font-size: 13px;width:200px">{{
item.productName
}}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item v-if="item.columnType =='date'" :rules="item.checkRulesObj" :prop="item.columnName">
<span slot="label">
{{item.columnDesc}}
</span>
<el-date-picker
v-model="inputQuery[item.columnName]"
:style="item.style"
value-format="yyyy-MM-dd"
type="date"
:placeholder="item.columnDesc"
></el-date-picker>
</el-form-item>
<el-form-item v-if="item.columnType =='datetime'" :rules="item.checkRulesObj" :prop="item.columnName">
<span slot="label">
{{item.columnDesc}}
</span>
<el-date-picker
v-model="inputQuery[item.columnName]"
:style="item.style"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetime"
:placeholder="item.columnDesc"
></el-date-picker>
</el-form-item>
<el-form-item v-if="item.columnType =='treeCustom'" :prop="item.columnName">
<span slot="label">
{{item.columnDesc}}
</span>
<treeselect
v-model="inputQuery[item.columnName]"
:options="menuOptions"
:normalizer="normalizer"
:show-count="true"
:placeholder="item.columnName"
/>
</el-form-item>
</div>
</el-col>
</template>
</el-row>
</template>
<div style='text-align: center; margin-bottom: 10px;margin-top: 18px ;'>
<el-button type="primary" @click="submitInv"></el-button>
<el-button @click="closeDialog"></el-button>
</div>
</el-form>
</el-card>
</div>
</template>
<script>
import {savePlan} from "@/api/ud/udPlan";
import {
getHead,executeFuc
} from "@/utils/customConfig";
export default {
name: "planDialog",
props: {
closeDialog: {
type: Function,
required: true,
},
formName: {
type: Object,
required: true,
},
inputQuery: {
type: Object,
required: true,
},
},
data() {
return {
tableHeader:[],
queryList:[],
fromList:[],
tableObj:[],
invList:[],
options: {
}
}
},
methods: {
submitInv(){
if(this.formName==1){
savePlan(this.inputQuery,"add").then((response) => {
if(response.code == 20000){
this.closeDialog();
}else{
this.$message.error(response.message);
}
})
.catch(() => {
this.$message.error("添加失败");
});
}else{
savePlan(this.inputQuery,"edit").then((response) => {
if(response.code == 20000){
this.closeDialog();
}else{
this.$message.error(response.message);
}
})
.catch(() => {
this.$message.error("添加失败");
});
}
},
executeFuc(row,type,clickFuc,value){
return executeFuc(this,row,type,clickFuc,value);
},
executeEval(row,expression,defaultRet){
if(expression){
return eval(expression);
}
return defaultRet;
},
},
components: {},
created() {
getHead("ud-plan","1").then((re) => {
//
this.tableObj = re.data;
this.tableHeader = re.data.tableList;
this.queryList = re.data.queryList;
this.fromList = re.data.fromList;
});
},
}
</script>
<style scoped>
</style>
Loading…
Cancel
Save